P粉2367436892023-09-03 13:09:12
As far as I know, you have two options:
Change parser: "vue-eslint-parser"
to @typescript-eslint/parser
Add overrides for .ts files and set the parser to @typescript-eslint/parser
P粉0388567252023-09-03 00:38:58
I guess I'm too tired or too old, anyway, the problem is that there are two parserOptions
sections in the same lint file. This is the final working version:
module.exports = { root: true, env: { browser: true, es2021: true, }, extends: [ "eslint:recommended", "plugin:vue/vue3-essential", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking", "prettier", ], parser: "vue-eslint-parser", parserOptions: { parser: "@typescript-eslint/parser", project: ["./tsconfig.json"], ecmaVersion: "latest", sourceType: "module", extraFileExtensions: [".vue"], }, // parserOptions: { // ecmaVersion: "latest", // sourceType: "module", // }, plugins: ["vue", "@typescript-eslint"], };