You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-24Lines changed: 16 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,10 +38,11 @@ npm i -D @rxts/eslint-plugin-mdx
38
38
39
39
```json
40
40
{
41
+
"extends": ["plugin:@rxts/mdx/recommended"],
41
42
"overrides": [
42
43
{
43
44
"files": ["*.mdx"],
44
-
"extends": ["plugin:@rxts/mdx/recommended"]
45
+
"extends": ["plugin:@rxts/mdx/overrides"]
45
46
}
46
47
]
47
48
}
@@ -51,18 +52,16 @@ npm i -D @rxts/eslint-plugin-mdx
51
52
52
53
```json
53
54
{
55
+
"extends": ["plugin:@rxts/mdx/recommended"],
54
56
"overrides": [
55
57
{
56
58
"files": ["*.mdx"],
57
-
"parser": "eslint-mdx",
58
-
"plugins": ["@rxts/mdx"],
59
+
"globals": {
60
+
"React": false
61
+
},
59
62
"rules": {
60
-
"@rxts/mdx/no-jsx-html-comments": 2,
61
-
"@rxts/mdx/no-unescaped-entities": 1,
62
-
"@rxts/mdx/no-unused-expressions": 2,
63
-
"no-unused-expressions": 0,
64
-
"react/react-in-jsx-scope": 0,
65
-
"react/no-unescaped-entities": 0
63
+
"lines-between-class-members": 0,
64
+
"react/react-in-jsx-scope": 0
66
65
}
67
66
}
68
67
]
@@ -75,27 +74,20 @@ npm i -D @rxts/eslint-plugin-mdx
75
74
eslint . --ext js,mdx
76
75
```
77
76
78
-
3. Custom parser for ES syntax is also supported, although `babel-eslint` will be detected automatically what means you actually do not need to do this:
77
+
## Parser Options
78
+
79
+
1.`parser` (`string | Function`): Custom parser for ES syntax is supported, although `@typescript-eslint/parser` or `babel-eslint` will be detected automatically what means you actually do not need do this:
79
80
80
81
```json
81
82
{
82
-
"overrides": [
83
-
{
84
-
"files": ["*.mdx"],
85
-
"extends": ["plugin:@rxts/mdx/recommended"],
86
-
"parserOptions": {
87
-
"parser": "babel-eslint"
88
-
}
89
-
}
90
-
]
83
+
"extends": ["plugin:@rxts/mdx/recommended"],
84
+
"parserOptions": {
85
+
"parser": "babel-eslint"
86
+
}
91
87
}
92
88
```
93
89
94
-
## FAQ
95
-
96
-
### Why I need to use `overrides`?
97
-
98
-
This parser/plugin should only affects `.mdx` files, and `overrides` in `shared configuration` is still [not extendable](https://github.com/eslint/eslint/issues/12032) for now, of course you can manually config it on your own risk.
90
+
2.`extensions` (`string | string[]`): `eslint-mdx` will only resolve `.mdx` files by default, files with other extensions will be resolved by the `parser` option. If you want to resolve other extensions as like `.mdx`, you can use this option.
0 commit comments