diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 8541c83..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "env": { - "commonjs": true, - "es6": true, - "node": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 2018 - }, - "ignorePatterns": [ - "!node_modules/cylc-action-utils.js" - ] -} diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 0000000..ce8e6aa --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,13 @@ +const globals = require("globals") +const js = require("@eslint/js") + +/** @type {import('eslint').Linter.FlatConfig[]} */ +module.exports = [ + js.configs.recommended, + { + languageOptions: { + sourceType: "commonjs", + globals: globals.node, + }, + }, +] diff --git a/package-lock.json b/package-lock.json index 45ac014..4683c17 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,9 @@ "packages": { "": { "devDependencies": { - "eslint": "^9.0.0" + "@eslint/js": "^9.0.0", + "eslint": "^9.0.0", + "globals": "^15.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -64,6 +66,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.0.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.0.0.tgz", @@ -571,9 +585,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.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.0.0.tgz", + "integrity": "sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==", "dev": true, "engines": { "node": ">=18" @@ -1070,6 +1084,14 @@ "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true + } } }, "@eslint/js": { @@ -1445,9 +1467,9 @@ } }, "globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.0.0.tgz", + "integrity": "sha512-m/C/yR4mjO6pXDTm9/R/SpYTAIyaUB4EOzcaaMEl7mds7Mshct9GfejiJNQGjHHbdMPey13Kpu4TMbYi9ex1pw==", "dev": true }, "graphemer": { diff --git a/package.json b/package.json index 3032272..6ecdfc5 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ ".": "./cylc-action-utils.js" }, "devDependencies": { - "eslint": "^9.0.0" + "@eslint/js": "^9.0.0", + "eslint": "^9.0.0", + "globals": "^15.0.0" } }