diff --git a/.eslintrc.yaml b/.eslintrc.yaml deleted file mode 100644 index 34237f9..0000000 --- a/.eslintrc.yaml +++ /dev/null @@ -1,16 +0,0 @@ -env: - es6: true - node: true - mocha: true - -root: true - -rules: - no-var: "error" - no-cond-assign: ["error", "except-parens"] - no-trailing-spaces: ["error", { "skipBlankLines": false }] - no-empty: [ "error", { "allowEmptyCatch": true } ] - no-shadow: "error" - prefer-template: "warn" - -extends: ["eslint:recommended"] diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..e11c1ab --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,39 @@ +import globals from "globals"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import js from "@eslint/js"; +import { FlatCompat } from "@eslint/eslintrc"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +export default [...compat.extends("eslint:recommended"), { + languageOptions: { + globals: { + ...globals.node, + ...globals.mocha, + }, + }, + + rules: { + "no-var": "error", + "no-cond-assign": ["error", "except-parens"], + + "no-trailing-spaces": ["error", { + skipBlankLines: false, + }], + + "no-empty": ["error", { + allowEmptyCatch: true, + }], + + "no-shadow": "error", + "prefer-template": "warn", + "no-unused-vars": "warn", + }, +}]; \ No newline at end of file diff --git a/package.json b/package.json index eea09c7..9738c7c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "dependencies": {}, "devDependencies": { - "eslint": "^8.57.0", + "eslint": "^9.19.0", "uglify-es": "*" }, "scripts": { @@ -19,7 +19,6 @@ }, "files": [ "lib", - "LICENSE", "ipaddr.min.js" ], "keywords": [