diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index e008f685a..000000000 --- a/.eslintrc +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": [ - "eslint:recommended", - "plugin:cypress/recommended", - "plugin:mocha/recommended", - "plugin:jsonc/recommended-with-json" - ], - "plugins": [ - "@stylistic/js", - "cypress", - "mocha", - "jsonc" - ], - "env": { - "cypress/globals": true, - "node": true - }, - "rules": { - "@stylistic/js/indent": ["error", 2, { "SwitchCase": 1, "MemberExpression": "off" }], - "mocha/no-exclusive-tests": "error", - "mocha/no-skipped-tests": "error", - "mocha/no-mocha-arrows": "off" - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..bc64bde46 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,32 @@ +import globals from 'globals' +import { FlatCompat } from '@eslint/eslintrc' +import pluginJs from '@eslint/js' +import eslintPluginJsonc from 'eslint-plugin-jsonc' +import stylisticJs from '@stylistic/eslint-plugin-js' +import mochaPlugin from 'eslint-plugin-mocha' + +const compat = new FlatCompat() + +export default [ + pluginJs.configs.recommended, + ...eslintPluginJsonc.configs['flat/recommended-with-json'], + mochaPlugin.configs.flat.recommended, + { + plugins: { + '@stylistic/js': stylisticJs, + }, + rules: { + '@stylistic/js/indent': ['error', 2, { 'SwitchCase': 1, 'MemberExpression': 'off' }], + 'mocha/no-exclusive-tests': 'error', + 'mocha/no-skipped-tests': 'error', + 'mocha/no-mocha-arrows': 'off' + }, + languageOptions: { + globals: { + ...globals.node + }, + } + }, ...compat.config({ + extends: ['plugin:cypress/recommended'], + }) +] diff --git a/package-lock.json b/package-lock.json index 91e3af444..5e12c33aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,10 +14,11 @@ }, "devDependencies": { "@bahmutov/print-env": "1.3.0", - "@stylistic/eslint-plugin-js": "1.7.2", + "@eslint/eslintrc": "3.0.2", + "@stylistic/eslint-plugin-js": "1.8.0", "cypress": "13.8.1", "eslint": "8.57.0", - "eslint-plugin-cypress": "3.0.2", + "eslint-plugin-cypress": "3.1.1", "eslint-plugin-jsonc": "2.15.1", "eslint-plugin-mocha": "10.4.3", "globby": "11.1.0", @@ -296,15 +297,15 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.0.2.tgz", + "integrity": "sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -312,12 +313,53 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/espree": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", + "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@eslint/js": { "version": "8.57.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", @@ -1180,12 +1222,12 @@ } }, "node_modules/@stylistic/eslint-plugin-js": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-1.7.2.tgz", - "integrity": "sha512-ZYX7C5p7zlHbACwFLU+lISVh6tdcRP/++PWegh2Sy0UgMT5kU0XkPa2tKWEtJYzZmPhJxu9LxbnWcnE/tTwSDQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin-js/-/eslint-plugin-js-1.8.0.tgz", + "integrity": "sha512-jdvnzt+pZPg8TfclZlTZPiUbbima93ylvQ+wNgHLNmup3obY6heQvgewSu9i2CfS61BnRByv+F9fxQLPoNeHag==", "dev": true, "dependencies": { - "@types/eslint": "^8.56.8", + "@types/eslint": "^8.56.10", "acorn": "^8.11.3", "escape-string-regexp": "^4.0.0", "eslint-visitor-keys": "^3.4.3", @@ -2900,9 +2942,9 @@ } }, "node_modules/eslint-plugin-cypress": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-3.0.2.tgz", - "integrity": "sha512-5hIWc3SqXSuR+Sd7gmNMzx8yJ3LWQQS0e+qLvEVF4C1JfFtu1s9imtEm1KxlCBCcKb7+6CyR9KQYs0GiI02AlA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-cypress/-/eslint-plugin-cypress-3.1.1.tgz", + "integrity": "sha512-rsP/72X99KNOAq26o5VAb6SICvdfjwvvWjs9n5a9UD14B5kCzzE45NJR/yJYw3fsGXUUKiwkv6eU5wRthM8kPw==", "dev": true, "dependencies": { "globals": "^13.20.0" @@ -3007,6 +3049,29 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", diff --git a/package.json b/package.json index 4a867003c..e5389b5ff 100644 --- a/package.json +++ b/package.json @@ -61,10 +61,11 @@ }, "devDependencies": { "@bahmutov/print-env": "1.3.0", - "@stylistic/eslint-plugin-js": "1.7.2", + "@eslint/eslintrc": "3.0.2", + "@stylistic/eslint-plugin-js": "1.8.0", "cypress": "13.8.1", "eslint": "8.57.0", - "eslint-plugin-cypress": "3.0.2", + "eslint-plugin-cypress": "3.1.1", "eslint-plugin-jsonc": "2.15.1", "eslint-plugin-mocha": "10.4.3", "globby": "11.1.0",