From 7f73041de5d8e1fa596905897914f4cec5e49c25 Mon Sep 17 00:00:00 2001 From: Stefan Topfstedt Date: Fri, 6 Nov 2026 14:46:00 -0800 Subject: [PATCH 1/2] bring in extra linting rules. --- package.json | 1 + pnpm-lock.yaml | 111 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) diff --git a/package.json b/package.json index 7e1fa85..cb79c36 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "@vitest/coverage-v8": "^4.0.13", "eslint": "^10.1.0", "eslint-config-prettier": "^10.1.8", + "eslint-plugin-n": "^18.5.0", "eslint-plugin-prettier": "^5.5.4", "globals": "^17.4.0", "husky": "^9.1.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6487b7b..8c1e977 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -203,6 +203,9 @@ importers: eslint-config-prettier: specifier: ^10.1.8 version: 10.1.8(eslint@10.14.0(supports-color@7.2.0)) + eslint-plugin-n: + specifier: ^18.5.0 + version: 18.5.0(eslint@10.14.0(supports-color@7.2.0))(typescript@5.9.3) eslint-plugin-prettier: specifier: ^5.5.4 version: 5.5.7(eslint-config-prettier@10.1.8(eslint@10.14.0(supports-color@7.2.0)))(eslint@10.14.0(supports-color@7.2.0))(prettier@3.9.10) @@ -569,6 +572,9 @@ packages: ajv@6.15.0: resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + argparse@3.0.4: + resolution: {integrity: sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -618,6 +624,10 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} + enhanced-resolve@5.26.1: + resolution: {integrity: sha512-PPnnSJq3azKOIewXR/uppBV/6h98dprBJ/WaQ9Qgj10xX1lJLNfg+XShpbsrSqcDSy2yYYyhfXM1wWhftqgyzw==} + engines: {node: '>=10.13.0'} + es-module-lexer@2.3.2: resolution: {integrity: sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw==} @@ -625,12 +635,37 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} + 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 peerDependencies: eslint: '>=7.0.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: '>=8' + + eslint-plugin-n@18.5.0: + resolution: {integrity: sha512-M7uF6MTN/An+AXqvyIbXq7npJIZOkd5eKo8iMMvWrcDVNyZVdA6TF2lw01aKQfCEidRfpnR78GhAjZorlXNHiw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} + peerDependencies: + eslint: '>=8.57.1' + ts-declaration-location: ^1.0.6 + typescript: '>=5.0.0' + peerDependenciesMeta: + ts-declaration-location: + optional: true + typescript: + optional: true + eslint-plugin-prettier@5.5.7: resolution: {integrity: sha512-WjHyn3GrFd+ZR0rzsLiM4zJZ35PZMOE0SUIxzGmnWNG0126yNfJKJzObmmkYDwHJfGlkz3PSlzyG9ez/LJntwg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -739,14 +774,27 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] + get-tsconfig@4.14.3: + resolution: {integrity: sha512-++QEw4DIY7WGoukz+/+A/8dGYPT9l9yIadnmSgZ8Rjr3YVSVDipQSO9CdnJo9ePqFqUUqh+wk9uIaoiAwsiPkA==} + glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} + globals@15.15.0: + resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} + engines: {node: '>=18'} + globals@17.14.0: resolution: {integrity: sha512-UtdkTVyAJePQv0J2M9Xe4L0ruNSDV314XiIJsADI2Zf40bcdAonE/D/OhAU8AT99oij9mhLByb+NvA3QWZYgCg==} engines: {node: '>=18'} + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + handlebars@4.7.10: resolution: {integrity: sha512-P5VJMVM7qgBn6vjXMw8WG9uVI+ncf2pi72j4de4yz5ZULLj2RGqLYaKOYGsgyrViQ0tePOVlN1tDCCXXtFqXKg==} engines: {node: '>=0.4.7'} @@ -815,6 +863,10 @@ packages: js-tokens@10.0.0: resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} + js-yaml@5.5.0: + resolution: {integrity: sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==} + hasBin: true + json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -1014,6 +1066,9 @@ packages: resolution: {integrity: sha512-+Owyggi9IxT1ePKGafcI87ubSmxol6smwJ+RAHDQlx9+9cPwFWDiKFFCPuWhr9ignlGpZ9vDQLw67N4dcTVFEA==} engines: {node: '>=20'} + resolve-pkg-maps@1.0.0: + resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + rolldown@1.2.16: resolution: {integrity: sha512-bWvlMpFKiTfDKfnK7FC2MPgPeWCf/Kpwsq49ApdW+FQaBZb6O6dZ4MAPbPUjp7hYQrw/RobqCzn64BRrQecGHw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -1057,6 +1112,10 @@ packages: resolution: {integrity: sha512-U+/AXT6LWsxnj2vz9HeUuPWBNgdWxjyIEjEPdbJARC9txmgPzo2VEdqnFo4hHaNyMPtycyVJrSaQYeQv/PoyyA==} engines: {node: ^14.18.0 || >=16.0.0} + tapable@2.3.3: + resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} + engines: {node: '>=6'} + tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} @@ -1532,6 +1591,8 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + argparse@3.0.4: {} + assertion-error@2.0.1: {} ast-v8-to-istanbul@1.0.7: @@ -1576,14 +1637,46 @@ snapshots: detect-libc@2.1.2: {} + enhanced-resolve@5.26.1: + dependencies: + graceful-fs: 4.2.11 + tapable: 2.3.3 + es-module-lexer@2.3.2: {} escape-string-regexp@4.0.0: {} + eslint-compat-utils@0.5.1(eslint@10.14.0(supports-color@7.2.0)): + dependencies: + eslint: 10.14.0(supports-color@7.2.0) + semver: 7.8.6 + eslint-config-prettier@10.1.8(eslint@10.14.0(supports-color@7.2.0)): dependencies: eslint: 10.14.0(supports-color@7.2.0) + eslint-plugin-es-x@7.8.0(eslint@10.14.0(supports-color@7.2.0)): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.14.0(supports-color@7.2.0)) + '@eslint-community/regexpp': 4.12.2 + eslint: 10.14.0(supports-color@7.2.0) + eslint-compat-utils: 0.5.1(eslint@10.14.0(supports-color@7.2.0)) + + eslint-plugin-n@18.5.0(eslint@10.14.0(supports-color@7.2.0))(typescript@5.9.3): + dependencies: + '@eslint-community/eslint-utils': 4.10.1(eslint@10.14.0(supports-color@7.2.0)) + enhanced-resolve: 5.26.1 + eslint: 10.14.0(supports-color@7.2.0) + eslint-plugin-es-x: 7.8.0(eslint@10.14.0(supports-color@7.2.0)) + get-tsconfig: 4.14.3 + globals: 15.15.0 + globrex: 0.1.2 + ignore: 5.3.2 + js-yaml: 5.5.0 + semver: 7.8.6 + optionalDependencies: + typescript: 5.9.3 + eslint-plugin-prettier@5.5.7(eslint-config-prettier@10.1.8(eslint@10.14.0(supports-color@7.2.0)))(eslint@10.14.0(supports-color@7.2.0))(prettier@3.9.10): dependencies: eslint: 10.14.0(supports-color@7.2.0) @@ -1702,12 +1795,22 @@ snapshots: fsevents@2.3.3: optional: true + get-tsconfig@4.14.3: + dependencies: + resolve-pkg-maps: 1.0.0 + glob-parent@6.0.2: dependencies: is-glob: 4.0.3 + globals@15.15.0: {} + globals@17.14.0: {} + globrex@0.1.2: {} + + graceful-fs@4.2.11: {} + handlebars@4.7.10: dependencies: minimist: 1.2.8 @@ -1762,6 +1865,10 @@ snapshots: js-tokens@10.0.0: {} + js-yaml@5.5.0: + dependencies: + argparse: 3.0.4 + json-schema-traverse@0.4.1: {} json-stable-stringify-without-jsonify@1.0.1: {} @@ -1917,6 +2024,8 @@ snapshots: dependencies: hookified: 2.2.0 + resolve-pkg-maps@1.0.0: {} + rolldown@1.2.16: dependencies: '@oxc-project/types': 0.156.0 @@ -1965,6 +2074,8 @@ snapshots: '@dual-bundle/import-meta-resolve': 4.2.1 '@pkgr/core': 0.3.6 + tapable@2.3.3: {} + tinybench@2.9.0: {} tinyexec@1.3.1: {} From 05425d7793766f5c308446a1fd32fe97694fdd2b Mon Sep 17 00:00:00 2001 From: Stefan Topfstedt Date: Fri, 6 Nov 2026 14:46:19 -0800 Subject: [PATCH 2/2] lint against missing file suffixes on relative imports. --- eslint.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eslint.config.js b/eslint.config.js index 6ff3367..b4aed74 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -2,6 +2,7 @@ import js from '@eslint/js'; import tsPlugin from '@typescript-eslint/eslint-plugin'; import tsParser from '@typescript-eslint/parser'; import prettierConfig from 'eslint-config-prettier'; +import nPlugin from 'eslint-plugin-n'; import prettierPlugin from 'eslint-plugin-prettier'; import globals from 'globals'; @@ -24,11 +25,15 @@ export default [ }, plugins: { '@typescript-eslint': tsPlugin, + n: nPlugin, prettier: prettierPlugin, }, rules: { ...tsPlugin.configs.recommended.rules, ...tsPlugin.configs['recommended-type-checked'].rules, + + 'n/file-extension-in-import': ['error', 'always'], + 'prettier/prettier': 'error', '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/no-unused-vars': [ @@ -57,10 +62,14 @@ export default [ }, plugins: { '@typescript-eslint': tsPlugin, + n: nPlugin, prettier: prettierPlugin, }, rules: { ...tsPlugin.configs.recommended.rules, + + 'n/file-extension-in-import': ['error', 'always'], + 'prettier/prettier': 'error', '@typescript-eslint/no-unused-vars': [ 'error',