Closed chrisnruud closed 1 month ago
Debugging via espree seems that ecmaversion that is passed in is "2025"
debug: ecmaversion is 2025
eslint:languages:js Invalid ecmaVersion.
eslint:languages:js Error: Invalid ecmaVersion.
at normalizeEcmaVersion (/Users/aurora/repositories/eslint9test/node_modules/espree/dist/espree.cjs:354:15)
at normalizeOptions (/Users/aurora/repositories/eslint9test/node_modules/espree/dist/espree.cjs:385:25)
at new Espree (/Users/aurora/repositories/eslint9test/node_modules/espree/dist/espree.cjs:486:29)
at Object.parse (/Users/aurora/repositories/eslint9test/node_modules/espree/dist/espree.cjs:836:12)
at parseScript$1 (/Users/aurora/repositories/eslint9test/node_modules/vue-eslint-parser/index.js:1142:18)
at parseAsSFC (/Users/aurora/repositories/eslint9test/node_modules/vue-eslint-parser/index.js:6435:18)
at Object.parseForESLint (/Users/aurora/repositories/eslint9test/node_modules/vue-eslint-parser/index.js:6402:53)
at Object.parse (/Users/aurora/repositories/eslint9test/node_modules/eslint/lib/languages/js/index.js:186:26)
at ParserService.parseSync (/Users/aurora/repositories/eslint9test/node_modules/eslint/lib/services/parser-service.js:36:33)
at #flatVerifyWithoutProcessors (/Users/aurora/repositories/eslint9test/node_modules/eslint/lib/linter/linter.js:1683:47) +3ms
And this again seems to be an upstream issue with eslint-plugin-vue that supplies espree 9.6.1 that doesnt support es2025 (16) but v10 does.
Seems like this issue was resolvable by re-creating package.json, which suggests that the current npm create vue@latest
does some minor package mismanagment
Adding "espree": "^10.2.0",
to package.json helped me as well
It is indeed a bug, though very subtle. Fixed in 14.0.1.
Thanks for reporting!
Vue components doesn't need script tags, eslint fails when trying to parse components with no script tag with
reproduction available in https://github.com/chrisnruud/eslint9test