Closed
Description
Subject of the issue
After enabling "plugin:mdx/recommended"
extension in .eslintrc.js
, .vue
files of a Vue project suddenly start incorrectly reporting syntax error during eslint --ext .js,.ts,.vue,.mdx --ignore-path .gitignore .
, even though this extension shouldn't affect .vue
files at all (at least I wasn't able to find anything similar in provided documentations after hours of searching).
/sandbox/components/IconLink.vue
22:8 error Parsing error: '}' expected
/sandbox/components/Logo.vue
3:4 error Parsing error: Identifier expected
/sandbox/layouts/default.vue
9:13 error Parsing error: '}' expected
/sandbox/pages/about.vue
15:14 error Parsing error: '}' expected
/sandbox/pages/index.vue
4:12 error Parsing error: Identifier expected
✖ 5 problems (5 errors, 0 warnings)
Your environment
- OS: Windows 10, reproducible in codesandbox environment
- Packages:
"devDependencies": {
"@nuxt/typescript-build": "^2.0.3",
"@nuxtjs/eslint-config-typescript": "^5.0.0",
"@nuxtjs/eslint-module": "^3.0.1",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-mdx": "^1.8.2",
"eslint-plugin-nuxt": "^2.0.0",
"eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.2.1"
}
- Env:
yarn --version
is1.22.4
Steps to reproduce
- Open https://codesandbox.io/s/modest-bird-4p917?file=/.eslintrc.js
-> A sample Nuxt project with minor modifications and additional (eslint) dependencies - Run
yarn lint
in a new terminal
Expected behaviour
Documentation of this library claims that it only affects .mdx
files, so there should be no new sudden errors.
- (Unrelated note: is there any chance you could provide a recommended setup example for Nuxt projects that use storybook module, to let new users benefit from immediate compatibility with zero-configuration project and pre-configured TS/eslint/prettier or even remark-lint? A working example would immensely help us with debugging; plus it'd be also nice if you had a CI test that lints a sample project, so that we could send a repro PR and have GitHub Actions execute it.)
Actual behaviour
The valid .vue
files fail on lint. If you remove "plugin:mdx/recommended"
from .eslintrc.js
and try again, this time there's no error.