From 0da31f813e0204204b26a1ab2bcf3ddc485dc324 Mon Sep 17 00:00:00 2001 From: Kendall Gassner Date: Mon, 2 Dec 2024 16:25:50 +0000 Subject: [PATCH] fix --- eslint.config.js => .eslintrc.js | 0 eslint.config.mjs | 36 ++++++++++++++++++++ package-lock.json | 57 ++++++++++++++++++-------------- package.json | 3 ++ 4 files changed, 72 insertions(+), 24 deletions(-) rename eslint.config.js => .eslintrc.js (100%) create mode 100644 eslint.config.mjs diff --git a/eslint.config.js b/.eslintrc.js similarity index 100% rename from eslint.config.js rename to .eslintrc.js diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..ffb7750 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,36 @@ +import github from "eslint-plugin-github"; +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("plugin:github/recommended"), { + plugins: { + github, + }, + + languageOptions: { + globals: { + ...globals.node, + ...globals.jest, + }, + + ecmaVersion: 2020, + sourceType: "commonjs", + }, + + rules: { + "import/no-commonjs": "off", + "filenames/match-regex": "off", + "i18n-text/no-en": "off", + }, +}]; \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c679b1e..51704e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,11 @@ "lodash": "^4.17.15" }, "devDependencies": { + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.16.0", "eslint": "^9.16.0", "eslint-plugin-github": "^5.0.1", + "globals": "^15.13.0", "jest": "^29.5.0", "markdownlint": "^0.36.1", "markdownlint-cli2": "^0.15.0" @@ -763,6 +766,7 @@ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -781,11 +785,25 @@ "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, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@eslint/js": { "version": "9.16.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -2995,18 +3013,6 @@ } } }, - "node_modules/eslint-plugin-github/node_modules/globals": { - "version": "15.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", - "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", - "dev": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint-plugin-i18n-text": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-i18n-text/-/eslint-plugin-i18n-text-1.0.1.tgz", @@ -3618,10 +3624,11 @@ } }, "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.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", + "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", "dev": true, + "license": "MIT", "engines": { "node": ">=18" }, @@ -7399,6 +7406,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": { @@ -9017,12 +9032,6 @@ "integrity": "sha512-wlZhwlDFxkxIZ571aH0FoK4h4Vwx7P3HJx62Gp8hTc10bfpwT2x0nULuAHmQSJBOWPgPeVf+9YtnD4j50zVHmA==", "dev": true, "requires": {} - }, - "globals": { - "version": "15.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz", - "integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==", - "dev": true } } }, @@ -9457,9 +9466,9 @@ } }, "globals": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", - "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "version": "15.13.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.13.0.tgz", + "integrity": "sha512-49TewVEz0UxZjr1WYYsWpPrhyC/B/pA8Bq0fUmet2n+eR7yn0IvNzNaoBwnK6mdkzcN+se7Ez9zUgULTz2QH4g==", "dev": true }, "globalthis": { diff --git a/package.json b/package.json index 6e09e24..dbe8e18 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,11 @@ "lodash": "^4.17.15" }, "devDependencies": { + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "^9.16.0", "eslint": "^9.16.0", "eslint-plugin-github": "^5.0.1", + "globals": "^15.13.0", "jest": "^29.5.0", "markdownlint": "^0.36.1", "markdownlint-cli2": "^0.15.0"