From cdf54e4969714ad4fab68a022433d870eba177b2 Mon Sep 17 00:00:00 2001 From: Shinigami92 Date: Sat, 10 Aug 2024 08:21:52 +0200 Subject: [PATCH] infra: use eslint.config.ts --- eslint.config.js => eslint.config.ts | 1 - package.json | 4 +- pnpm-lock.yaml | 136 +++++++++++++++++---------- 3 files changed, 89 insertions(+), 52 deletions(-) rename eslint.config.js => eslint.config.ts (99%) diff --git a/eslint.config.js b/eslint.config.ts similarity index 99% rename from eslint.config.js rename to eslint.config.ts index 0df787c8129..6fd016df85c 100644 --- a/eslint.config.js +++ b/eslint.config.ts @@ -1,4 +1,3 @@ -// @ts-check /* eslint-disable @typescript-eslint/no-unsafe-argument */ import { fixupPluginRules, includeIgnoreFile } from '@eslint/compat'; import eslint from '@eslint/js'; diff --git a/package.json b/package.json index 78730763b89..ee4e2dfbe1f 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "docs:serve": "vitepress serve docs --port 5173", "docs:diff": "tsx ./scripts/diff.ts", "format": "prettier --cache --write .", - "lint": "eslint --cache --cache-strategy content .", + "lint": "eslint --cache --cache-strategy content --flag unstable_ts_config .", "ts-check": "tsc", "test": "vitest", "test:update-snapshots": "vitest run -u", @@ -99,6 +99,7 @@ "@eslint-types/unicorn": "52.0.0", "@eslint/compat": "1.1.1", "@eslint/js": "9.8.0", + "@types/eslint__js": "~8.42.3", "@types/node": "20.14.14", "@types/sanitize-html": "2.11.0", "@types/semver": "7.5.8", @@ -116,6 +117,7 @@ "eslint-plugin-prettier": "5.2.1", "eslint-plugin-unicorn": "55.0.0", "eslint-plugin-vitest": "0.5.4", + "jiti": "~1.21.6", "npm-run-all2": "6.2.2", "prettier": "3.3.3", "prettier-plugin-organize-imports": "4.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 462d4e00ebb..272645bdff8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,6 +35,9 @@ importers: '@eslint/js': specifier: 9.8.0 version: 9.8.0 + '@types/eslint__js': + specifier: ~8.42.3 + version: 8.42.3 '@types/node': specifier: 20.14.14 version: 20.14.14 @@ -64,28 +67,31 @@ importers: version: 13.13.2 eslint: specifier: 9.9.0 - version: 9.9.0 + version: 9.9.0(jiti@1.21.6) eslint-config-prettier: specifier: 9.1.0 - version: 9.1.0(eslint@9.9.0) + version: 9.1.0(eslint@9.9.0(jiti@1.21.6)) eslint-define-config: specifier: 2.1.0 version: 2.1.0 eslint-plugin-deprecation: specifier: 3.0.0 - version: 3.0.0(eslint@9.9.0)(typescript@5.5.4) + version: 3.0.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) eslint-plugin-jsdoc: specifier: 50.0.0 - version: 50.0.0(eslint@9.9.0) + version: 50.0.0(eslint@9.9.0(jiti@1.21.6)) eslint-plugin-prettier: specifier: 5.2.1 - version: 5.2.1(eslint-config-prettier@9.1.0(eslint@9.9.0))(eslint@9.9.0)(prettier@3.3.3) + version: 5.2.1(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@9.9.0(jiti@1.21.6)))(eslint@9.9.0(jiti@1.21.6))(prettier@3.3.3) eslint-plugin-unicorn: specifier: 55.0.0 - version: 55.0.0(eslint@9.9.0) + version: 55.0.0(eslint@9.9.0(jiti@1.21.6)) eslint-plugin-vitest: specifier: 0.5.4 - version: 0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(@vitest/ui@2.0.5)(jsdom@23.2.0)) + version: 0.5.4(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(@vitest/ui@2.0.5)(jsdom@23.2.0)) + jiti: + specifier: ~1.21.6 + version: 1.21.6 npm-run-all2: specifier: 6.2.2 version: 6.2.2 @@ -109,7 +115,7 @@ importers: version: 23.0.0 tsup: specifier: 8.2.4 - version: 8.2.4(postcss@8.4.41)(tsx@4.16.5)(typescript@5.5.4)(yaml@2.5.0) + version: 8.2.4(jiti@1.21.6)(postcss@8.4.41)(tsx@4.16.5)(typescript@5.5.4)(yaml@2.5.0) tsx: specifier: 4.16.5 version: 4.16.5 @@ -118,7 +124,7 @@ importers: version: 5.5.4 typescript-eslint: specifier: 7.18.0 - version: 7.18.0(eslint@9.9.0)(typescript@5.5.4) + version: 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) validator: specifier: 13.12.0 version: 13.12.0 @@ -817,12 +823,21 @@ packages: '@ts-morph/common@0.24.0': resolution: {integrity: sha512-c1xMmNHWpNselmpIqursHeOHHBTIsJLbB+NuovbTTRCNiTLEr/U9dbJ8qy0jd/O2x5pc3seWuOUN5R2IoOTp8A==} + '@types/eslint@9.6.0': + resolution: {integrity: sha512-gi6WQJ7cHRgZxtkQEoyHMppPjq9Kxo5Tjn2prSKDSmZrCz8TZ3jSRCeTJm+WoM+oB0WG37bRqLzaaU3q7JypGg==} + + '@types/eslint__js@8.42.3': + resolution: {integrity: sha512-alfG737uhmPdnvkrLdZLcEKJ/B8s9Y4hrZ+YAdzUeoArBlSUERA2E87ROfOaS4jd/C45fzOoZzidLc1IPwLqOw==} + '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/json-schema@7.0.15': + resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/linkify-it@5.0.0': resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} @@ -2233,6 +2248,10 @@ packages: jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + jiti@1.21.6: + resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} + hasBin: true + joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} @@ -3919,9 +3938,9 @@ snapshots: '@esbuild/win32-x64@0.23.0': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.9.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.9.0(jiti@1.21.6))': dependencies: - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.11.0': {} @@ -4142,12 +4161,23 @@ snapshots: mkdirp: 3.0.1 path-browserify: 1.0.1 + '@types/eslint@9.6.0': + dependencies: + '@types/estree': 1.0.5 + '@types/json-schema': 7.0.15 + + '@types/eslint__js@8.42.3': + dependencies: + '@types/eslint': 9.6.0 + '@types/estree@1.0.5': {} '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.2 + '@types/json-schema@7.0.15': {} + '@types/linkify-it@5.0.0': {} '@types/markdown-it@14.1.2': @@ -4186,15 +4216,15 @@ snapshots: '@types/node': 20.14.14 optional: true - '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.18.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/parser': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/type-utils': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) '@typescript-eslint/visitor-keys': 7.18.0 - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 @@ -4204,14 +4234,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.18.0(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/parser@7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@typescript-eslint/scope-manager': 7.18.0 '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) '@typescript-eslint/visitor-keys': 7.18.0 debug: 4.3.6(supports-color@8.1.1) - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -4222,12 +4252,12 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 - '@typescript-eslint/type-utils@7.18.0(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/type-utils@7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) debug: 4.3.6(supports-color@8.1.1) - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) ts-api-utils: 1.3.0(typescript@5.5.4) optionalDependencies: typescript: 5.5.4 @@ -4251,13 +4281,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.18.0(eslint@9.9.0)(typescript@5.5.4)': + '@typescript-eslint/utils@7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0(jiti@1.21.6)) '@typescript-eslint/scope-manager': 7.18.0 '@typescript-eslint/types': 7.18.0 '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) transitivePeerDependencies: - supports-color - typescript @@ -5189,30 +5219,30 @@ snapshots: escape-string-regexp@4.0.0: {} - eslint-config-prettier@9.1.0(eslint@9.9.0): + eslint-config-prettier@9.1.0(eslint@9.9.0(jiti@1.21.6)): dependencies: - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) eslint-define-config@2.1.0: {} - eslint-plugin-deprecation@3.0.0(eslint@9.9.0)(typescript@5.5.4): + eslint-plugin-deprecation@3.0.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4): dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - eslint: 9.9.0 + '@typescript-eslint/utils': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) + eslint: 9.9.0(jiti@1.21.6) ts-api-utils: 1.3.0(typescript@5.5.4) tslib: 2.6.3 typescript: 5.5.4 transitivePeerDependencies: - supports-color - eslint-plugin-jsdoc@50.0.0(eslint@9.9.0): + eslint-plugin-jsdoc@50.0.0(eslint@9.9.0(jiti@1.21.6)): dependencies: '@es-joy/jsdoccomment': 0.46.0 are-docs-informative: 0.0.2 comment-parser: 1.4.1 debug: 4.3.6(supports-color@8.1.1) escape-string-regexp: 4.0.0 - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) espree: 10.1.0 esquery: 1.6.0 parse-imports: 2.1.1 @@ -5222,23 +5252,24 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0(eslint@9.9.0))(eslint@9.9.0)(prettier@3.3.3): + eslint-plugin-prettier@5.2.1(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@9.9.0(jiti@1.21.6)))(eslint@9.9.0(jiti@1.21.6))(prettier@3.3.3): dependencies: - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.1 optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@9.9.0) + '@types/eslint': 9.6.0 + eslint-config-prettier: 9.1.0(eslint@9.9.0(jiti@1.21.6)) - eslint-plugin-unicorn@55.0.0(eslint@9.9.0): + eslint-plugin-unicorn@55.0.0(eslint@9.9.0(jiti@1.21.6)): dependencies: '@babel/helper-validator-identifier': 7.24.7 - '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0(jiti@1.21.6)) ci-info: 4.0.0 clean-regexp: 1.0.0 core-js-compat: 3.38.0 - eslint: 9.9.0 + eslint: 9.9.0(jiti@1.21.6) esquery: 1.6.0 globals: 15.9.0 indent-string: 4.0.0 @@ -5251,10 +5282,10 @@ snapshots: semver: 7.6.3 strip-indent: 3.0.0 - eslint-plugin-vitest@0.5.4(eslint@9.9.0)(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(@vitest/ui@2.0.5)(jsdom@23.2.0)): + eslint-plugin-vitest@0.5.4(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)(vitest@2.0.5(@types/node@20.14.14)(@vitest/ui@2.0.5)(jsdom@23.2.0)): dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - eslint: 9.9.0 + '@typescript-eslint/utils': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) + eslint: 9.9.0(jiti@1.21.6) optionalDependencies: vitest: 2.0.5(@types/node@20.14.14)(@vitest/ui@2.0.5)(jsdom@23.2.0) transitivePeerDependencies: @@ -5270,9 +5301,9 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.9.0: + eslint@9.9.0(jiti@1.21.6): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.9.0(jiti@1.21.6)) '@eslint-community/regexpp': 4.11.0 '@eslint/config-array': 0.17.1 '@eslint/eslintrc': 3.1.0 @@ -5306,6 +5337,8 @@ snapshots: optionator: 0.9.4 strip-ansi: 6.0.1 text-table: 0.2.0 + optionalDependencies: + jiti: 1.21.6 transitivePeerDependencies: - supports-color @@ -5790,6 +5823,8 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jiti@1.21.6: {} + joycon@3.1.1: {} js-tokens@4.0.0: {} @@ -6236,10 +6271,11 @@ snapshots: pluralize@8.0.0: {} - postcss-load-config@6.0.1(postcss@8.4.41)(tsx@4.16.5)(yaml@2.5.0): + postcss-load-config@6.0.1(jiti@1.21.6)(postcss@8.4.41)(tsx@4.16.5)(yaml@2.5.0): dependencies: lilconfig: 3.1.2 optionalDependencies: + jiti: 1.21.6 postcss: 8.4.41 tsx: 4.16.5 yaml: 2.5.0 @@ -6718,7 +6754,7 @@ snapshots: tslib@2.6.3: {} - tsup@8.2.4(postcss@8.4.41)(tsx@4.16.5)(typescript@5.5.4)(yaml@2.5.0): + tsup@8.2.4(jiti@1.21.6)(postcss@8.4.41)(tsx@4.16.5)(typescript@5.5.4)(yaml@2.5.0): dependencies: bundle-require: 5.0.0(esbuild@0.23.0) cac: 6.7.14 @@ -6730,7 +6766,7 @@ snapshots: globby: 11.1.0 joycon: 3.1.1 picocolors: 1.0.1 - postcss-load-config: 6.0.1(postcss@8.4.41)(tsx@4.16.5)(yaml@2.5.0) + postcss-load-config: 6.0.1(jiti@1.21.6)(postcss@8.4.41)(tsx@4.16.5)(yaml@2.5.0) resolve-from: 5.0.0 rollup: 4.20.0 source-map: 0.8.0-beta.0 @@ -6774,12 +6810,12 @@ snapshots: typedarray@0.0.6: {} - typescript-eslint@7.18.0(eslint@9.9.0)(typescript@5.5.4): + typescript-eslint@7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4): dependencies: - '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.9.0)(typescript@5.5.4))(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/parser': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - '@typescript-eslint/utils': 7.18.0(eslint@9.9.0)(typescript@5.5.4) - eslint: 9.9.0 + '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/parser': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) + '@typescript-eslint/utils': 7.18.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) + eslint: 9.9.0(jiti@1.21.6) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: