From 92f62530396d898dd255e526e5cb501da4071d10 Mon Sep 17 00:00:00 2001 From: Justin Stayton Date: Mon, 26 Aug 2024 17:08:17 -0400 Subject: [PATCH] Update to latest ESLint v9 (#14) --- .eslintrc.json | 21 --------------------- eslint.config.js | 28 ++++++++++++++++++++++++++++ package.json | 6 ++++-- 3 files changed, 32 insertions(+), 23 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 7e84571..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "root": true, - "env": { - "node": true, - "es2021": true - }, - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "extends": ["eslint:recommended", "plugin:n/recommended", "prettier"], - "rules": { - "n/no-unsupported-features/node-builtins": [ - "error", - { - "ignores": ["test", "test.describe", "test.it"] - } - ] - }, - "ignorePatterns": ["docs"] -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..57b2214 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,28 @@ +import js from '@eslint/js' +import prettier from 'eslint-config-prettier' +import node from 'eslint-plugin-n' +import globals from 'globals' + +export default [ + { + languageOptions: { + globals: { ...globals.node }, + }, + }, + { + ignores: ['docs'], + }, + js.configs.recommended, + node.configs['flat/recommended'], + { + rules: { + 'n/no-unsupported-features/node-builtins': [ + 'error', + { + ignores: ['test', 'test.describe', 'test.it'], + }, + ], + }, + }, + prettier, +] diff --git a/package.json b/package.json index 98859dd..b914c9f 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,11 @@ "test": "node --test" }, "devDependencies": { - "eslint": "^8.57.0", + "@eslint/js": "^9.9.1", + "eslint": "^9.9.1", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-n": "^17.9.0", + "eslint-plugin-n": "^17.10.2", + "globals": "^15.9.0", "jsdoc": "^4.0.3", "prettier": "3.3.2", "release-it": "^17.4.0"