diff --git a/bin/languages.js b/bin/languages.js index a423427..eb29012 100755 --- a/bin/languages.js +++ b/bin/languages.js @@ -3,7 +3,7 @@ import { writeFileSync } from "node:fs"; import linguistLanguages from "linguist-languages"; import { format } from "prettier"; -import packageJSON from "../package.json" assert { type: "json" }; +import packageJSON from "../package.json" with { type: "json" }; function getSupportLanguages() { const supportLanguages = []; diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b86a651 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,21 @@ +import eslintJs from "@eslint/js"; +import eslintConfigPrettier from "eslint-config-prettier"; +import globals from "globals"; + +export default [ + eslintJs.configs.recommended, + eslintConfigPrettier, + { + languageOptions: { + globals: { + ...globals.builtin, + ...globals.jest, + ...globals.node + } + }, + rules: { + "no-unused-vars": "off" + } + }, + { ignores: ["bin/languages.js", "dist"] } +]; diff --git a/package.json b/package.json index 65a75d3..241e7ba 100644 --- a/package.json +++ b/package.json @@ -34,35 +34,16 @@ "prettier": "^3.0.0" }, "devDependencies": { - "eslint": "^9.0.0", - "eslint-config-prettier": "^10.0.1", + "@eslint/js": "^9.21.0", + "eslint": "^9.21.0", + "eslint-config-prettier": "^10.0.2", + "globals": "^16.0.0", "husky": "^9.0.6", "jest": "^29.2.1", "linguist-languages": "^7.21.0", "lint-staged": "^15.0.1", - "prettier": "^3.0.0" - }, - "eslintConfig": { - "extends": [ - "eslint:recommended", - "prettier" - ], - "env": { - "jest": true, - "node": true - }, - "rules": { - "no-unused-vars": "off" - }, - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - } + "prettier": "^3.5.3" }, - "eslintIgnore": [ - "bin/languages.js", - "dist" - ], "jest": { "testRegex": ".test.js$", "transform": {} diff --git a/yarn.lock b/yarn.lock index 13d4f80..830a375 100644 --- a/yarn.lock +++ b/yarn.lock @@ -407,7 +407,7 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@9.21.0": +"@eslint/js@9.21.0", "@eslint/js@^9.21.0": version "9.21.0" resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.21.0.tgz#4303ef4e07226d87c395b8fad5278763e9c15c08" integrity sha512-BqStZ3HX8Yz6LvsF5ByXYrtigrV5AXADWLAGc7PH/1SxOb7/FIYYMszZZWiUou/GB9P2lXWk2SV4d+Z8h0nknw== @@ -1258,7 +1258,7 @@ escape-string-regexp@^4.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^10.0.1: +eslint-config-prettier@^10.0.2: version "10.0.2" resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.0.2.tgz#47444de8aa104ce82c2f91ad2a5e96b62c01e20d" integrity sha512-1105/17ZIMjmCOJOPNfVdbXafLCLj3hPmkmB7dLgt7XsQ/zkxSuDerE/xgO3RxoHysR1N1whmquY0lSn2O0VLg== @@ -1281,7 +1281,7 @@ eslint-visitor-keys@^4.2.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz#687bacb2af884fcdda8a6e7d65c606f46a14cd45" integrity sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw== -eslint@^9.0.0: +eslint@^9.21.0: version "9.21.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.21.0.tgz#b1c9c16f5153ff219791f627b94ab8f11f811591" integrity sha512-KjeihdFqTPhOMXTt7StsDxriV4n66ueuF/jfPNC3j/lduHwr/ijDwJMsF+wyMJethgiKi5wniIE243vi07d3pg== @@ -1549,6 +1549,11 @@ globals@^14.0.0: resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== +globals@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-16.0.0.tgz#3d7684652c5c4fbd086ec82f9448214da49382d8" + integrity sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A== + graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" @@ -2504,7 +2509,7 @@ prelude-ls@^1.2.1: resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.0.0: +prettier@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.5.3.tgz#4fc2ce0d657e7a02e602549f053b239cb7dfe1b5" integrity sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==