From c8e32384cc67be8b8888d18140a8a57528597308 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Wed, 1 May 2024 11:38:12 +0100 Subject: [PATCH] Migrate to ESLint v9 --- .eslintrc.json | 17 ----------------- eslint.config.mjs | 19 +++++++++++++++++++ package-lock.json | 20 +++++++++++++++++--- package.json | 2 ++ 4 files changed, 38 insertions(+), 20 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index b101258..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "env": { - "commonjs": true, - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "parserOptions": { - "ecmaVersion": 2018 - }, - "rules": { - } -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..8519e68 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,19 @@ +import globals from "globals" +import js from "@eslint/js" + +/** @type {import('eslint').Linter.FlatConfig[]} */ +export default [ + js.configs.recommended, + { + languageOptions: { + sourceType: "commonjs", + globals: globals.node, + }, + }, + { + files: ["**/*.mjs"], + languageOptions: { + sourceType: "module", + }, + } +] diff --git a/package-lock.json b/package-lock.json index 6b4259a..fbbf629 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,9 @@ "version": "0.1.0", "license": "GPL-3.0", "devDependencies": { + "@eslint/js": "^9.1.1", "eslint": "^9.1.1", + "globals": "^15.1.0", "vscode-tmgrammar-test": "^0.1.1" } }, @@ -69,6 +71,18 @@ "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": "9.1.1", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.1.1.tgz", @@ -639,9 +653,9 @@ } }, "node_modules/globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.1.0.tgz", + "integrity": "sha512-926gJqg+4mkxwYKiFvoomM4J0kWESfk3qfTvRL2/oc/tK/eTDBbrfcKnSa2KtfdxB5onoL7D3A3qIHQFpd4+UA==", "dev": true, "engines": { "node": ">=18" diff --git a/package.json b/package.json index fe87725..daad990 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ }, "homepage": "https://github.com/cylc/cylc-textmate-grammar#readme", "devDependencies": { + "@eslint/js": "^9.1.1", "eslint": "^9.1.1", + "globals": "^15.1.0", "vscode-tmgrammar-test": "^0.1.1" } }