Skip to content

Commit e470ddc

Browse files
committed
fix: eslint@5 is actually supported
1 parent 52c2267 commit e470ddc

File tree

3 files changed

+122
-95
lines changed

3 files changed

+122
-95
lines changed

README.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
> [ESLint](https://eslint.org/) Parser/Plugin for [MDX](https://github.com/mdx-js/mdx)
1111
12-
## Peer Dependency
13-
14-
Please use `eslint >= 6.0.0`.
15-
1612
## Install
1713

1814
```sh
@@ -25,18 +21,37 @@ npm i -D @rxts/eslint-plugin-mdx
2521

2622
## Usage
2723

28-
1. In your ESLint config file, add:
29-
30-
```json
31-
{
32-
"overrides": [
33-
{
34-
"files": ["*.mdx"],
35-
"extends": ["plugin:@rxts/mdx/recommended"]
36-
}
37-
]
38-
}
39-
```
24+
1. In your ESLint config file:
25+
26+
1. If you're using `eslint >= 6.0.0`, add:
27+
28+
```json
29+
{
30+
"overrides": [
31+
{
32+
"files": ["*.mdx"],
33+
"extends": ["plugin:@rxts/mdx/recommended"]
34+
}
35+
]
36+
}
37+
```
38+
39+
2. If you're using `eslint@^5.0.0`, you need to enable this parse/plugin manually, because `eslint@5` does not support `extends` for `overrides` property in its configuration:
40+
41+
```json
42+
{
43+
"overrides": [
44+
{
45+
"files": ["*.mdx"],
46+
"parser": "@rxts/eslint-plugin-mdx",
47+
"plugins": ["@rxts/mdx"],
48+
"rules": {
49+
"react/react-in-jsx-scope": 0
50+
}
51+
}
52+
]
53+
}
54+
```
4055

4156
2. Make sure ESLint knows to run on `.mdx` files:
4257

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rxts/eslint-plugin-mdx",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "ESLint Parser/Plugin for MDX",
55
"repository": "[email protected]:rx-ts/eslint-plugin-mdx.git",
66
"author": "JounQin <[email protected]>",
@@ -17,7 +17,7 @@
1717
"lint": "eslint . --ext js,mdx,ts,tsx"
1818
},
1919
"peerDependencies": {
20-
"eslint": ">=6.0.0"
20+
"eslint": ">=5.0.0"
2121
},
2222
"dependencies": {
2323
"@mdx-js/mdx": "^1.1.0",
@@ -44,7 +44,7 @@
4444
"prettier": "1.18.2",
4545
"prettier-config-1stg": "^0.1.0",
4646
"react": "^16.8.6",
47-
"standard-version": "^6.0.1",
47+
"standard-version": "^7.0.0",
4848
"ts-node": "^8.3.0",
4949
"typescript": "^3.5.3"
5050
}

0 commit comments

Comments
 (0)