Skip to content

Commit

Permalink
tests: Make ecmaVersion() compatible with ESLint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Jun 13, 2024
1 parent a1015e7 commit eaf4b7c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/lib/rules/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
const eslintPkg = require('eslint/package.json');

const USE_LANGUAGE_OPTIONS = eslintPkg.version.startsWith('9.');

function ecmaVersion(version) {
if (USE_LANGUAGE_OPTIONS) {
return {
languageOptions: {
ecmaVersion: version
}
};
}

return {
parserOptions: {
ecmaVersion: version
Expand Down

0 comments on commit eaf4b7c

Please sign in to comment.