diff --git a/eslint.config.js b/eslint.config.js index 3e1f7af5..36a477d8 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,18 +1,25 @@ // @ts-check +import { dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; + import js from '@eslint/js'; import vitest from '@vitest/eslint-plugin'; import { defineConfig, globalIgnores } from 'eslint/config'; import prettierConfig from 'eslint-config-prettier/flat'; import { importX } from 'eslint-plugin-import-x'; +import nodePlugin from 'eslint-plugin-n'; import globals from 'globals'; import tseslint from 'typescript-eslint'; +const __dirname = dirname(fileURLToPath(import.meta.url)); + const config = defineConfig( js.configs.recommended, tseslint.configs.recommendedTypeChecked, importX.flatConfigs.recommended, importX.flatConfigs.typescript, + nodePlugin.configs['flat/recommended'], { name: 'Language options', files: ['**/*.{js,mjs,cjs,ts,mts}'], @@ -25,7 +32,7 @@ const config = defineConfig( parser: tseslint.parser, parserOptions: { projectService: true, - tsconfigRootDir: import.meta.dirname, + tsconfigRootDir: __dirname, }, }, }, @@ -73,6 +80,10 @@ const config = defineConfig( 'import-x/no-mutable-exports': 'error', 'import-x/no-named-default': 'error', 'import-x/no-relative-packages': 'warn', + + // Node + // This one is covered by TypeScript + 'n/no-missing-import': 'off', }, }, { diff --git a/package.json b/package.json index 2814aeba..56d17e55 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "eslint-doc-generator": "2.4.0", "eslint-import-resolver-typescript": "4.4.4", "eslint-plugin-import-x": "4.16.1", - "eslint-plugin-node": "11.1.0", + "eslint-plugin-n": "17.23.1", "eslint-plugin-promise": "7.2.1", "eslint-remote-tester": "4.0.3", "eslint-remote-tester-repositories": "2.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 49234121..71738234 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,9 +60,9 @@ importers: eslint-plugin-import-x: specifier: 4.16.1 version: 4.16.1(@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.35.0(jiti@2.6.1)) - eslint-plugin-node: - specifier: 11.1.0 - version: 11.1.0(eslint@9.35.0(jiti@2.6.1)) + eslint-plugin-n: + specifier: 17.23.1 + version: 17.23.1(eslint@9.35.0(jiti@2.6.1))(typescript@5.9.3) eslint-plugin-promise: specifier: 7.2.1 version: 7.2.1(eslint@9.35.0(jiti@2.6.1)) @@ -1731,6 +1731,10 @@ packages: resolution: {integrity: sha512-i6UzDscO/XfAcNYD75CfICkmfLedpyPDdozrLMmQc5ORaQcdMoc21OnlEylMIqI7U8eniKrPMxxtj8k0vhmJhA==} engines: {node: '>=14'} + enhanced-resolve@5.18.4: + resolution: {integrity: sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q==} + engines: {node: '>=10.13.0'} + env-ci@11.2.0: resolution: {integrity: sha512-D5kWfzkmaOQDioPmiviWAVtKmpPT4/iJmMVQxWxMPJTFyTkdc5JQUfc5iXEeWxcOdsYTKSAiA/Age4NUOqKsRA==} engines: {node: ^18.17 || >=20.6.1} @@ -1807,6 +1811,12 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} + eslint-compat-utils@0.5.1: + resolution: {integrity: sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==} + engines: {node: '>=12'} + peerDependencies: + eslint: '>=6.0.0' + eslint-config-prettier@10.1.8: resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==} hasBin: true @@ -1870,11 +1880,11 @@ packages: eslint-import-resolver-webpack: optional: true - eslint-plugin-es@3.0.1: - resolution: {integrity: sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==} - engines: {node: '>=8.10.0'} + eslint-plugin-es-x@7.8.0: + resolution: {integrity: sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=4.19.1' + eslint: '>=8' eslint-plugin-import-x@4.16.1: resolution: {integrity: sha512-vPZZsiOKaBAIATpFE2uMI4w5IRwdv/FpQ+qZZMR4E+PeOcM4OeoEbqxRMnywdxP19TyB/3h6QBB0EWon7letSQ==} @@ -1899,11 +1909,11 @@ packages: '@typescript-eslint/parser': optional: true - eslint-plugin-node@11.1.0: - resolution: {integrity: sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==} - engines: {node: '>=8.10.0'} + eslint-plugin-n@17.23.1: + resolution: {integrity: sha512-68PealUpYoHOBh332JLLD9Sj7OQUDkFpmcfqt8R9sySfFSeuGJjMTJQvCRRB96zO3A/PELRLkPrzsHmzEFQQ5A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: '>=5.16.0' + eslint: '>=8.23.0' eslint-plugin-promise@7.2.1: resolution: {integrity: sha512-SWKjd+EuvWkYaS+uN2csvj0KoP43YTu7+phKQ5v+xw6+A0gutVX2yqCeCkC3uLCJFiPfR2dD8Es5L7yUsmvEaA==} @@ -1933,14 +1943,6 @@ packages: resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - - eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2179,6 +2181,10 @@ packages: resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} engines: {node: '>=18'} + globals@15.15.0: + resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} + engines: {node: '>=18'} + globals@16.3.0: resolution: {integrity: sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==} engines: {node: '>=18'} @@ -2187,6 +2193,9 @@ packages: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -3207,10 +3216,6 @@ packages: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} - regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - registry-auth-token@5.1.0: resolution: {integrity: sha512-GdekYuwLXLxMuFTwAPg5UKGLW/UXzQrZvH/Zj791BQif5T05T0RsaLfHc9q3ZOKi7n+BoprPD9mJ0O0k4xzUlw==} engines: {node: '>=14'} @@ -3550,6 +3555,10 @@ packages: resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==} engines: {node: '>=20'} + tapable@2.3.0: + resolution: {integrity: sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg==} + engines: {node: '>=6'} + temp-dir@3.0.0: resolution: {integrity: sha512-nHc6S/bwIilKHNRgK/3jlhDoIHcp45YgyiwcAk46Tr0LfEqGBVpmiAyuiuxeVE44m3mXnEeVhaipLOEWmH+Njw==} engines: {node: '>=14.16'} @@ -3631,6 +3640,11 @@ packages: peerDependencies: typescript: '>=4.8.4' + ts-declaration-location@1.0.7: + resolution: {integrity: sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA==} + peerDependencies: + typescript: '>=4.0.0' + tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} @@ -4091,7 +4105,7 @@ snapshots: '@commitlint/is-ignored@19.8.1': dependencies: '@commitlint/types': 19.8.1 - semver: 7.7.2 + semver: 7.7.3 '@commitlint/lint@19.8.1': dependencies: @@ -4710,7 +4724,7 @@ snapshots: read-pkg: 9.0.1 registry-auth-token: 5.1.0 semantic-release: 25.0.2(typescript@5.9.3) - semver: 7.7.2 + semver: 7.7.3 tempy: 3.1.0 '@semantic-release/release-notes-generator@14.1.0(semantic-release@25.0.2(typescript@5.9.3))': @@ -4871,7 +4885,7 @@ snapshots: fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 - semver: 7.7.2 + semver: 7.7.3 ts-api-utils: 2.1.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: @@ -4885,7 +4899,7 @@ snapshots: '@typescript-eslint/visitor-keys': 8.49.0 debug: 4.4.3 minimatch: 9.0.5 - semver: 7.7.2 + semver: 7.7.3 tinyglobby: 0.2.15 ts-api-utils: 2.1.0(typescript@5.9.3) typescript: 5.9.3 @@ -5397,7 +5411,7 @@ snapshots: conventional-commits-filter: 5.0.0 handlebars: 4.7.8 meow: 13.2.0 - semver: 7.7.2 + semver: 7.7.3 conventional-commits-filter@5.0.0: {} @@ -5539,7 +5553,7 @@ snapshots: '@one-ini/wasm': 0.2.0 commander: 14.0.2 minimatch: 10.0.1 - semver: 7.7.2 + semver: 7.7.3 emoji-regex@10.5.0: {} @@ -5551,6 +5565,11 @@ snapshots: empathic@2.0.0: {} + enhanced-resolve@5.18.4: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.0 + env-ci@11.2.0: dependencies: execa: 8.0.1 @@ -5724,6 +5743,11 @@ snapshots: escape-string-regexp@5.0.0: {} + eslint-compat-utils@0.5.1(eslint@9.35.0(jiti@2.6.1)): + dependencies: + eslint: 9.35.0(jiti@2.6.1) + semver: 7.7.3 + eslint-config-prettier@10.1.8(eslint@9.35.0(jiti@2.6.1)): dependencies: eslint: 9.35.0(jiti@2.6.1) @@ -5794,11 +5818,12 @@ snapshots: - supports-color optional: true - eslint-plugin-es@3.0.1(eslint@9.35.0(jiti@2.6.1)): + eslint-plugin-es-x@7.8.0(eslint@9.35.0(jiti@2.6.1)): dependencies: + '@eslint-community/eslint-utils': 4.9.0(eslint@9.35.0(jiti@2.6.1)) + '@eslint-community/regexpp': 4.12.1 eslint: 9.35.0(jiti@2.6.1) - eslint-utils: 2.1.0 - regexpp: 3.2.0 + eslint-compat-utils: 0.5.1(eslint@9.35.0(jiti@2.6.1)) eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.43.0(eslint@9.35.0(jiti@2.6.1))(typescript@5.9.3))(eslint-import-resolver-node@0.3.9)(eslint@9.35.0(jiti@2.6.1)): dependencies: @@ -5848,15 +5873,20 @@ snapshots: - supports-color optional: true - eslint-plugin-node@11.1.0(eslint@9.35.0(jiti@2.6.1)): + eslint-plugin-n@17.23.1(eslint@9.35.0(jiti@2.6.1))(typescript@5.9.3): dependencies: + '@eslint-community/eslint-utils': 4.9.0(eslint@9.35.0(jiti@2.6.1)) + enhanced-resolve: 5.18.4 eslint: 9.35.0(jiti@2.6.1) - eslint-plugin-es: 3.0.1(eslint@9.35.0(jiti@2.6.1)) - eslint-utils: 2.1.0 + eslint-plugin-es-x: 7.8.0(eslint@9.35.0(jiti@2.6.1)) + get-tsconfig: 4.13.0 + globals: 15.15.0 + globrex: 0.1.2 ignore: 5.3.2 - minimatch: 3.1.2 - resolve: 1.22.11 - semver: 6.3.1 + semver: 7.7.3 + ts-declaration-location: 1.0.7(typescript@5.9.3) + transitivePeerDependencies: + - typescript eslint-plugin-promise@7.2.1(eslint@9.35.0(jiti@2.6.1)): dependencies: @@ -5888,12 +5918,6 @@ snapshots: esrecurse: 4.3.0 estraverse: 5.3.0 - eslint-utils@2.1.0: - dependencies: - eslint-visitor-keys: 1.3.0 - - eslint-visitor-keys@1.3.0: {} - eslint-visitor-keys@3.4.3: {} eslint-visitor-keys@4.2.1: {} @@ -6090,7 +6114,8 @@ snapshots: fsevents@2.3.3: optional: true - function-bind@1.1.2: {} + function-bind@1.1.2: + optional: true function-timeout@1.0.2: {} @@ -6194,6 +6219,8 @@ snapshots: globals@14.0.0: {} + globals@15.15.0: {} + globals@16.3.0: {} globalthis@1.0.4: @@ -6202,6 +6229,8 @@ snapshots: gopd: 1.2.0 optional: true + globrex@0.1.2: {} + gopd@1.2.0: optional: true @@ -6248,6 +6277,7 @@ snapshots: hasown@2.0.2: dependencies: function-bind: 1.1.2 + optional: true highlight.js@10.7.3: {} @@ -6404,6 +6434,7 @@ snapshots: is-core-module@2.16.1: dependencies: hasown: 2.0.2 + optional: true is-data-view@1.0.2: dependencies: @@ -6737,7 +6768,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.7.2 + semver: 7.7.3 markdown-table@3.0.4: {} @@ -6826,13 +6857,13 @@ snapshots: normalize-package-data@6.0.2: dependencies: hosted-git-info: 7.0.2 - semver: 7.7.2 + semver: 7.7.3 validate-npm-package-license: 3.0.4 normalize-package-data@8.0.0: dependencies: hosted-git-info: 9.0.2 - semver: 7.7.2 + semver: 7.7.3 validate-npm-package-license: 3.0.4 normalize-url@8.1.0: {} @@ -7013,7 +7044,8 @@ snapshots: path-key@4.0.0: {} - path-parse@1.0.7: {} + path-parse@1.0.7: + optional: true path-scurry@1.11.1: dependencies: @@ -7170,8 +7202,6 @@ snapshots: set-function-name: 2.0.2 optional: true - regexpp@3.2.0: {} - registry-auth-token@5.1.0: dependencies: '@pnpm/npm-conf': 2.3.1 @@ -7191,6 +7221,7 @@ snapshots: is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + optional: true restore-cursor@3.1.0: dependencies: @@ -7344,11 +7375,12 @@ snapshots: semver-diff@5.0.0: dependencies: - semver: 7.7.2 + semver: 7.7.3 semver-regex@4.0.5: {} - semver@6.3.1: {} + semver@6.3.1: + optional: true semver@7.7.2: {} @@ -7603,10 +7635,13 @@ snapshots: has-flag: 4.0.0 supports-color: 7.2.0 - supports-preserve-symlinks-flag@1.0.0: {} + supports-preserve-symlinks-flag@1.0.0: + optional: true tagged-tag@1.0.0: {} + tapable@2.3.0: {} + temp-dir@3.0.0: {} tempy@3.1.0: @@ -7674,6 +7709,11 @@ snapshots: dependencies: typescript: 5.9.3 + ts-declaration-location@1.0.7(typescript@5.9.3): + dependencies: + picomatch: 4.0.3 + typescript: 5.9.3 + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29