-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linting TSX in Vue SFC file throw error #176
Comments
same question |
It seems to be always interpreted as |
Any idea? |
这么巧,还有一小时前的,今天也遇到这个问题了 |
This fixed the issue for me: Eslint: "parser": "vue-eslint-parser", |
in your {
"compilerOptions": {
"jsx": "preserve",
"jsxImportSource": "vue"
}
} Probably I think, Weather you are using Typescript (Typescript support compile js/jsx too), if you are using // vue eslint config, this is eslint 9 flat config
const eslint9FlatConfig = [
{
files: ["*.vue", "**/*.vue"],
languageOptions: {
parser: "vue-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
sourceType: "module",
ecmaFeatures: {
jsx: true
}
}
}
}
] And this works for me, also in single repo and monorepo. |
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
8.22.0
What version of
eslint-plugin-vue
andvue-eslint-parser
are you using?What did you do?
Configuration
What did you expect to happen?
no error
What actually happened?
throw Error Parsing error: '>' expected.eslint
when I use single .tsx file these has no error
Link to Minimal Reproducible Example
https://github.com/Cat1007/parseErrorDemo
see src/HasErrorComp.vue
Additional comments
No response
The text was updated successfully, but these errors were encountered: