Unable to lint MDX components in `2.0.0-next.2`
See original GitHub issueInitial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
2.0.0-next.2
Link to runnable example
No response
Steps to reproduce
module.exports = {
overrides: [
{
files: '*.md{,x}',
parser: 'eslint-mdx',
processor: 'mdx/remark',
plugins: ['mdx'],
settings: {
'mdx/code-blocks': true
}
},
{
files: ['*.md{,x}', '*.{j,t}s{,x}'],
extends: 'plugin:react/recommended'
}
]
}
# Hello world
\```js
<Foo />
\```
<Foo />
\```jsx
<Foo />
\```
Expected behavior
/Users/dimitri/Desktop/mdx-repro/test.mdx
7:1 error 'React' must be in scope when using JSX react/react-in-jsx-scope
7:2 error 'Foo' is not defined react/jsx-no-undef
4:1 error 'React' must be in scope when using JSX react/react-in-jsx-scope
4:2 error 'Foo' is not defined react/jsx-no-undef
10:1 error 'React' must be in scope when using JSX react/react-in-jsx-scope
10:2 error 'Foo' is not defined react/jsx-no-undef
✖ 6 problems (6 errors, 0 warnings)
Actual behavior
4:1 error 'React' must be in scope when using JSX react/react-in-jsx-scope
4:2 error 'Foo' is not defined react/jsx-no-undef
10:1 error 'React' must be in scope when using JSX react/react-in-jsx-scope
10:2 error 'Foo' is not defined react/jsx-no-undef
✖ 4 problems (4 errors, 0 warnings)
Runtime
No response
Package manager
No response
OS
No response
Build and bundle tools
No response
Issue Analytics
- State:
- Created a year ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
MDX2: Can't resolve '@mdx-js/react' · Issue #18094 - GitHub
Describe the bug Trying to integrate storybook@next with CRA and running into a runtime error To Reproduce Please run 'npm run storybook' in ......
Read more >Troubleshooting MDX
Unexpected `$type` in code: only import/exports are supported. This error is thrown by our MDX parser. It was introduced in version 2. It...
Read more >eslint-plugin-mdx - npm
ESLint Parser/Plugin for MDX, helps you lint all ES syntaxes. Linting code blocks can be enabled with mdx/code-blocks setting too!
Read more >Advanced Features: Using MDX - Next.js
MDX is a superset of markdown that lets you write JSX directly in your markdown files. It is a powerful way to add...
Read more >storybook failed to fetch dynamically imported module - You.com
so I am using web test runner for lit element version 2 what is happening when I am importing scss file in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@B2o5T Besides, the two rules are disabled for mdx content in the recommended config at https://github.com/mdx-js/eslint-mdx/blob/master/packages/eslint-plugin-mdx/src/configs/overrides.ts#L23-L35, that’s why I can’t reproduce it at #393
Of course, the missing tokens are still a problem, but that would be another issue, so close this one for now.
Edit, Just notice you didn’t use
plugin:mdx/recommended
at all.@B2o5T
Please try:
It should just work now:
https://github.com/mdx-js/eslint-mdx/pull/394/files#diff-7dc63d54389fc5b805a5cebe74578027e4837d2eb08085555c7792fad8da8552R397