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
> [ESLint](https://eslint.org/) Parser/Plugin for [MDX](https://github.com/mdx-js/mdx), helps you lint all ES syntaxes excluding `code` block of course.
20
+
> [ESLint] Parser/Plugin for [MDX], helps you lint all ES syntaxes excluding `code` block of course.
21
21
> Work perfectly with `eslint-plugin-import`, `eslint-plugin-prettier` or any other eslint plugins.
22
22
23
23
## Install
@@ -57,6 +57,7 @@ npm i -D @rxts/eslint-plugin-mdx
57
57
"parser": "@rxts/eslint-plugin-mdx",
58
58
"plugins": ["@rxts/mdx"],
59
59
"rules": {
60
+
"@rxts/mdx/no-jsx-html-comments": 2,
60
61
"@rxts/mdx/no-unused-expressions": 2,
61
62
"no-unused-expressions": 0,
62
63
"react/react-in-jsx-scope": 0
@@ -72,7 +73,7 @@ npm i -D @rxts/eslint-plugin-mdx
72
73
eslint . --ext js,mdx
73
74
```
74
75
75
-
3. Custom parser for ES syntax is also supported:
76
+
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:
76
77
77
78
```json
78
79
{
@@ -88,14 +89,38 @@ npm i -D @rxts/eslint-plugin-mdx
88
89
}
89
90
```
90
91
92
+
## FAQ
93
+
94
+
### Why I need to use `overrides`?
95
+
96
+
This parser/plugin should only affects `.mdx` files, of course you manually config it on your own risk.
97
+
98
+
## Rules
99
+
100
+
### @rxts/mdx/no-jsx-html-comments
101
+
102
+
HTML style comments in jsx block is invalid, this rule will help you to fix it by transforming it to JSX style comments.
103
+
104
+
### @rxts/mdx/no-unused-expressions
105
+
106
+
`MDX` can render `jsx` block automatically without exporting them, but `eslint` will report `no-unused-expressions` issue which could be unexpected, this rule is a replacement of it, so make sure that you've turned off the original `no-unused-expressions` rule.
107
+
91
108
## Limitation
92
109
93
-
> This parser/plugin can only handle ES syntaxes for you, markdown related syntaxes will just be ignored, you can use [markdownlint](https://github.com/markdownlint/markdownlint) to lint that part.
110
+
> This parser/plugin can only handle ES syntaxes for you, markdown related syntaxes will just be ignored, you can use [markdownlint] or [remake-lint] to lint that part.
111
+
112
+
I have a very preliminary idea to integrate with [remake-lint].
94
113
95
114
## Changelog
96
115
97
116
Detailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).
0 commit comments