Closed jjoselv closed 4 years ago
Your posted content is unreadable, please format it correctly first, thx.
I can imagine this is a usage question.
.mdx
files require eslint-mdx
as parser, but other preset overrides mdx's recommended config, so the following should do the trick:
{
overrides: [
{
files: '*.mdx',
parser: 'eslint-mdx'
}
]
}
With the overrides I managed to make it work via command line, but VS Code MDX extension reports different from command line (basically it appears to be ignoring the yaml config)
Maybe you just need to reload VSCode.
Nope, still "No Problems" in VS Code, when from the command line it says:
42 problems (22 errors, 20 warnings)
12 errors and 5 warnings potentially fixable with the '--fix' option.
Then I have no idea what is happening, I can't reproduce it, and no helpful information.
What can I give you to diagnose it?
Hi again I've spent near 5 hours trying to make eslint extension for VSCode to run in debug mode to be able to pass a log to you, but no luck 😢 I can give you the settings that I have in my settings.json
"eslint.probe": [
"markdown",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"html",
"vue",
"mdx"
],
"eslint.options": {
"extensions": [".js", ".jsx", ".md", ".mdx", ".ts", ".tsx"],
},
"eslint.debug": true
Hm, the debug mode works when typing on a js file, but doesn't when doing it on a mdx file 😩
OH! It started working when I added this to the settings.json:
"eslint.validate": [
"mdx",
"markdown",
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"html",
"vue"
],
OH! It started working when I added this to the settings.json:
"eslint.validate": [ "mdx", "markdown", "javascript", "javascriptreact", "typescript", "typescriptreact", "html", "vue" ],
Wow, that's weird, it is said eslint.validate
is a legacy option.
eslint.validate
- an array of language identifiers specifying the files for which validation is to be enforced. This is an old legacy setting and should in normal cases not be necessary anymore. Defaults to["javascript", "javascriptreact"]
.
Maybe we should report it in vscode-eslint.
True. Thanks for sticking and for opening the issue! And for the understanding and patience throughout this issue, very much appreciated 👍🏻
OH! It started working when I added this to the settings.json:
"eslint.validate": [ "mdx", "markdown", "javascript", "javascriptreact", "typescript", "typescriptreact", "html", "vue" ],
Doesn't that slow it down when saving file? for me it gets stuck saying Saving 'index.mdx': Getting code actions from ''ESLint', 'Tailwind CSS IntelliSense''
and takes 10-20 seconds to save.
I have the same problems & I dont know how to fix it :(
Subject of the issue
I am receiving this error with a file as simple as this:
`
Menu List
Let's define a story for our
TableRowMenu
component:error:
/stories/TableRowMenu.stories.mdx
1:0 error Parsing error: #####/TableRowMenu.stories.mdx: Unexpected token (1:0)
Additionaly, I cannot manage to set VSCode to read the mdx files
Version of the plugin: v0.2.2
Settings: "eslint.options": { "lintFiles": ["./src/", "./stories/"], "extenstions": [".js", ".jsx", ".md", ".mdx", ".ts", ".tsx"] }, "eslint.probe": [ "javascript", "javascriptreact", "typescript", "typescriptreact", "html", "vue", "markdown", "mdx" ]
Your environment
Steps to reproduce
I launch this command:
eslint --config .eslintrc.yml --ext .js,.jsx,.mdx "src/" "stories/"
The .eslintrc.yml:
`
extends:
settings: react: version: latest
parser: '@babel/eslint-parser'
parserOptions: ecmaVersion: 6 sourceType: 'module' ecmaFeatures: jsx: true experimentalDecorators: true
globals: DEV: true SERVER: true
plugins:
Expected behaviour
I think it should not through an error
Actual behaviour
The error happens