Skip to content

Commit aae95d6

Browse files
committed
fix: explicitly set ecmaVersion to 2024 for vue-eslint-parser
Fixes #87
1 parent 70815e1 commit aae95d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: src/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ export default function createConfig({
8181
// Leave the template parser unspecified,
8282
// so that it could be determined by `<script lang="...">`
8383
},
84+
// The internal espree version used by vue-eslint-parser is 9.x, which supports ES2024 at most.
85+
// While the parser may try to load the latest version of espree, it's not guaranteed to work.
86+
// For example, if npm accidentally hoists the older version to the top of the node_modules,
87+
// or if the user installs the older version of espree at the project root,
88+
// the older versions would be used.
89+
// But ESLint 9 allows setting the ecmaVersion to 2025, which may cause a crash.
90+
// So we set the ecmaVersion to 2024 here to avoid the potential issue.
91+
ecmaVersion: 2024,
8492
ecmaFeatures: {
8593
jsx: mayHaveJsxInSfc,
8694
},

0 commit comments

Comments
 (0)