diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index c73f1d33..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "browser": true, - "node": true, - "es6": true, - "commonjs": true - }, - "parserOptions": { - "ecmaVersion": 2017 - }, - "extends": ["eslint:recommended", "prettier"], - "rules": { - "eqeqeq": ["error", "always"], - "no-alert": "error" - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..2217695b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,32 @@ +const js = require("@eslint/js"); +const eslintConfigPrettier = require("eslint-config-prettier"); + +module.exports = [ + js.configs.recommended, + eslintConfigPrettier, + { + languageOptions: { + ecmaVersion: 2017, + sourceType: "commonjs", + globals: { + // Browser globals + window: "readonly", + document: "readonly", + navigator: "readonly", + console: "readonly", + // Node globals + module: "readonly", + require: "readonly", + exports: "readonly", + process: "readonly", + __dirname: "readonly", + __filename: "readonly", + Buffer: "readonly", + }, + }, + rules: { + eqeqeq: ["error", "always"], + "no-alert": "error", + }, + }, +]; diff --git a/package-lock.json b/package-lock.json index 4a0d22b7..c9b95120 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "chai": "^6.2.2", "eslint": "^9.15.0", "eslint-config-prettier": "^10.1.8", - "eslint-webpack-plugin": "^4.0.1", + "eslint-webpack-plugin": "^5.0.2", "mocha": "^11.7.1", "prettier": "^3.6.2", "prettier-check": "^2.0.0", @@ -488,9 +488,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.56.12", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.12.tgz", - "integrity": "sha512-03ruubjWyOHlmljCVoxSuNDdmfZDzsrrz0P2LeJsOXr+ZwFQ+0yQIwNCwt/GYhV7Z31fgtXJTAEs+FYlEL851g==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-9.6.1.tgz", + "integrity": "sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==", "dev": true, "license": "MIT", "dependencies": { @@ -1500,20 +1500,21 @@ } }, "node_modules/eslint-webpack-plugin": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-4.2.0.tgz", - "integrity": "sha512-rsfpFQ01AWQbqtjgPRr2usVRxhWDuG0YDYcG8DJOteD3EFnpeuYuOwk0PQiN7PRBTqS6ElNdtPZPggj8If9WnA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/eslint-webpack-plugin/-/eslint-webpack-plugin-5.0.2.tgz", + "integrity": "sha512-cB7EO2o+4gPUzK6zxgegSet8uu/hHwzOiG+2976MHWiwWFj9mmPbTrzlW0InFl6hl89S1D9MPKK5F7vNFpZc4g==", "dev": true, "license": "MIT", "dependencies": { - "@types/eslint": "^8.56.10", + "@types/eslint": "^9.6.1", + "flatted": "^3.3.3", "jest-worker": "^29.7.0", - "micromatch": "^4.0.5", + "micromatch": "^4.0.8", "normalize-path": "^3.0.0", - "schema-utils": "^4.2.0" + "schema-utils": "^4.3.0" }, "engines": { - "node": ">= 14.15.0" + "node": ">= 18.12.0" }, "funding": { "type": "opencollective", diff --git a/package.json b/package.json index 98407cce..4ec90873 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "chai": "^6.2.2", "eslint": "^9.15.0", "eslint-config-prettier": "^10.1.8", - "eslint-webpack-plugin": "^4.0.1", + "eslint-webpack-plugin": "^5.0.2", "mocha": "^11.7.1", "prettier": "^3.6.2", "prettier-check": "^2.0.0",