From 914bfb0d19d616be314936016dd0fa3e386c68e1 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 28 Mar 2024 08:53:59 +0100 Subject: [PATCH 1/9] fix(cli): make frameworks not required --- src/cli/run.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli/run.ts b/src/cli/run.ts index c08de89d73..3f2290f061 100644 --- a/src/cli/run.ts +++ b/src/cli/run.ts @@ -69,6 +69,7 @@ export async function run(options: CliRunOptions = {}) { return p.multiselect[], FrameworkOption>({ message: c.reset(message), options: frameworkOptions, + required: false, }) }, extra: ({ results }) => { From 0b364eeec6c733774820cdbeceac7c123aeb96d5 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 28 Mar 2024 08:54:52 +0100 Subject: [PATCH 2/9] fix: lower peer-deps requirement to `eslint-plugin-svelte`, fix #437 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ef03075c31..58f59cb7b3 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.4", - "eslint-plugin-svelte": "^2.36.0-0", + "eslint-plugin-svelte": "^2.35.1", "prettier-plugin-astro": "^0.13.0", "prettier-plugin-slidev": "^1.0.5", "svelte-eslint-parser": "^0.33.1" From 24400786d52ed8617c8883f3b4caea6ee4349a81 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 28 Mar 2024 08:55:00 +0100 Subject: [PATCH 3/9] chore: release v2.11.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 58f59cb7b3..2e1ed9bd66 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@antfu/eslint-config", "type": "module", - "version": "2.11.3", + "version": "2.11.4", "packageManager": "pnpm@8.15.5", "description": "Anthony's ESLint config", "author": "Anthony Fu (https://github.com/antfu/)", From c68d090e3235298a81955f36d9aea32ff03e0a85 Mon Sep 17 00:00:00 2001 From: younggglcy Date: Fri, 29 Mar 2024 00:11:19 +0800 Subject: [PATCH 4/9] chore: bump `@antfu/install-pkg` to ^0.3.2 (#438) --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2e1ed9bd66..945f9a140b 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ } }, "dependencies": { - "@antfu/install-pkg": "^0.3.1", + "@antfu/install-pkg": "^0.3.2", "@clack/prompts": "^0.7.0", "@stylistic/eslint-plugin": "^1.7.0", "@typescript-eslint/eslint-plugin": "^7.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5030dce8d8..a320285217 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@antfu/install-pkg': - specifier: ^0.3.1 - version: 0.3.1 + specifier: ^0.3.2 + version: 0.3.2 '@clack/prompts': specifier: ^0.7.0 version: 0.7.0 @@ -251,8 +251,8 @@ packages: synckit: 0.8.8 dev: true - /@antfu/install-pkg@0.3.1: - resolution: {integrity: sha512-A3zWY9VeTPnxlMiZtsGHw2lSd3ghwvL8s9RiGOtqvDxhhFfZ781ynsGBa/iUnDJ5zBrmTFQrJDud3TGgRISaxw==} + /@antfu/install-pkg@0.3.2: + resolution: {integrity: sha512-FFYqME8+UHlPnRlX/vn+8cTD4Wo/nG/lzRxpABs3XANBmdJdNImVz3QvjNAE/W3PSCNbG387FOz8o5WelnWOlg==} dependencies: execa: 8.0.1 dev: false From cb5090f5609b8dee5a468b23fafeadaf266fddf1 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 29 Mar 2024 11:49:11 +0100 Subject: [PATCH 5/9] fix: consistent on config names --- package.json | 10 ++-- pnpm-lock.yaml | 121 +++++++++++++++++++++----------------- src/configs/formatters.ts | 2 +- src/configs/imports.ts | 2 +- src/configs/javascript.ts | 2 +- src/configs/sort.ts | 4 +- 6 files changed, 77 insertions(+), 64 deletions(-) diff --git a/package.json b/package.json index 945f9a140b..84fd34684a 100644 --- a/package.json +++ b/package.json @@ -93,12 +93,12 @@ "@typescript-eslint/eslint-plugin": "^7.4.0", "@typescript-eslint/parser": "^7.4.0", "eslint-config-flat-gitignore": "^0.1.3", - "eslint-flat-config-utils": "^0.1.1", + "eslint-flat-config-utils": "^0.1.2", "eslint-merge-processors": "^0.1.0", "eslint-plugin-antfu": "^2.1.2", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import-x": "^0.4.4", - "eslint-plugin-jsdoc": "^48.2.1", + "eslint-plugin-jsdoc": "^48.2.2", "eslint-plugin-jsonc": "^2.14.1", "eslint-plugin-markdown": "^4.0.1", "eslint-plugin-n": "^16.6.2", @@ -131,18 +131,18 @@ "@types/node": "^20.11.30", "@types/prompts": "^2.4.9", "@types/yargs": "^17.0.32", - "@unocss/eslint-plugin": "^0.58.7", + "@unocss/eslint-plugin": "^0.58.8", "astro-eslint-parser": "^0.16.3", "bumpp": "^9.4.0", "eslint": "9.0.0-rc.0", - "eslint-flat-config-viewer": "^0.1.14", + "eslint-flat-config-viewer": "^0.1.19", "eslint-plugin-astro": "^0.33.1", "eslint-plugin-format": "^0.1.0", "eslint-plugin-react": "^7.34.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", "eslint-plugin-svelte": "2.36.0-next.13", - "eslint-typegen": "^0.1.4", + "eslint-typegen": "^0.1.6", "esno": "^4.7.0", "execa": "^8.0.1", "fast-glob": "^3.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a320285217..2cc7364e15 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: specifier: ^0.1.3 version: 0.1.3 eslint-flat-config-utils: - specifier: ^0.1.1 - version: 0.1.1 + specifier: ^0.1.2 + version: 0.1.2 eslint-merge-processors: specifier: ^0.1.0 version: 0.1.0(eslint@9.0.0-rc.0) @@ -42,8 +42,8 @@ importers: specifier: ^0.4.4 version: 0.4.4(eslint@9.0.0-rc.0)(typescript@5.4.3) eslint-plugin-jsdoc: - specifier: ^48.2.1 - version: 48.2.1(eslint@9.0.0-rc.0) + specifier: ^48.2.2 + version: 48.2.2(eslint@9.0.0-rc.0) eslint-plugin-jsonc: specifier: ^2.14.1 version: 2.14.1(eslint@9.0.0-rc.0) @@ -136,8 +136,8 @@ importers: specifier: ^17.0.32 version: 17.0.32 '@unocss/eslint-plugin': - specifier: ^0.58.7 - version: 0.58.7(eslint@9.0.0-rc.0)(typescript@5.4.3) + specifier: ^0.58.8 + version: 0.58.8(eslint@9.0.0-rc.0)(typescript@5.4.3) astro-eslint-parser: specifier: ^0.16.3 version: 0.16.3 @@ -148,8 +148,8 @@ importers: specifier: 9.0.0-rc.0 version: 9.0.0-rc.0 eslint-flat-config-viewer: - specifier: ^0.1.14 - version: 0.1.14(eslint@9.0.0-rc.0)(typescript@5.4.3) + specifier: ^0.1.19 + version: 0.1.19(eslint@9.0.0-rc.0)(typescript@5.4.3) eslint-plugin-astro: specifier: ^0.33.1 version: 0.33.1(eslint@9.0.0-rc.0) @@ -169,8 +169,8 @@ importers: specifier: 2.36.0-next.13 version: 2.36.0-next.13(eslint@9.0.0-rc.0)(svelte@4.2.12) eslint-typegen: - specifier: ^0.1.4 - version: 0.1.4 + specifier: ^0.1.6 + version: 0.1.6 esno: specifier: ^4.7.0 version: 4.7.0 @@ -1197,52 +1197,52 @@ packages: '@typescript-eslint/types': 7.4.0 eslint-visitor-keys: 3.4.3 - /@unhead/dom@1.8.20: - resolution: {integrity: sha512-TXRQSVbqBOQc02m3wxgj55m93U8a3WBHV9xJi2zVX/iHEJgeQbZMJ+rV0YJkHy2OHAC0MfjVQA5NDLaVwtromw==} + /@unhead/dom@1.9.3: + resolution: {integrity: sha512-l7KO6zv8T/yKpWOtcKww3k6RLENEiwiapoiPwtKlwWBFJekSjgM1+1AVu58yWqadFYHGP0/XhMwxKrOaOL+Vkw==} dependencies: - '@unhead/schema': 1.8.20 - '@unhead/shared': 1.8.20 + '@unhead/schema': 1.9.3 + '@unhead/shared': 1.9.3 dev: true - /@unhead/schema@1.8.20: - resolution: {integrity: sha512-n0e5jsKino8JTHc4wpr4l8MXXIrj0muYYAEVa0WSYkIVnMiBr1Ik3l6elhCr4fdSyJ3M2DQQleea/oZCr11XCw==} + /@unhead/schema@1.9.3: + resolution: {integrity: sha512-emFHDYxn6u5SVwSRXMpYBCYKBua+GCjUwTLLdUupInthW3UraSUuXakmv06wDvejE8pTrBOPrGWescIYmwm69A==} dependencies: hookable: 5.5.3 zhead: 2.2.4 dev: true - /@unhead/shared@1.8.20: - resolution: {integrity: sha512-J0fdtavcMtXcG0g9jmVW03toqfr8A0G7k+Q6jdpwuUPhWk/vhfZn3aiRV+F8LlU91c/AbGWDv8T1MrtMQbb0Sg==} + /@unhead/shared@1.9.3: + resolution: {integrity: sha512-9wJ+wNmAVDCsCFKE3YHMwNkmFqKzCqQfp53ABJHQFOvY336s4nMWtiMNMjxF4aY4pJk8Qpwd8dRlgpLlyH0KZg==} dependencies: - '@unhead/schema': 1.8.20 + '@unhead/schema': 1.9.3 dev: true - /@unhead/ssr@1.8.20: - resolution: {integrity: sha512-Cq1NcdYZ/IAkJ0muqdOBxJXb5dn+uV+RvIXDykRb9lGgriU/S0fzUw8XYTYMwLlvW6rSMrtRx319hz2D3ZrBkA==} + /@unhead/ssr@1.9.3: + resolution: {integrity: sha512-oFFynkmAoHoDU2uG3otBnYOj5rmi14fqaUpA4tzsRlyLiwyF3Hd8nXec9YM7JaBzstoiy2NGf7dTfY7eNc8NoQ==} dependencies: - '@unhead/schema': 1.8.20 - '@unhead/shared': 1.8.20 + '@unhead/schema': 1.9.3 + '@unhead/shared': 1.9.3 dev: true - /@unocss/config@0.58.7: - resolution: {integrity: sha512-ZMSFWJI8DfE/4HiIU+hkTSKUtEkennRn+raej5HCGTfy5xpdYCm9Zdrw/cYqkN2LPHM8o076Z2sD6H4MV5HrvA==} + /@unocss/config@0.58.8: + resolution: {integrity: sha512-x0/FCP1vuU7z2Y1e4m5fazLEr9DyXQZ9aM8Rt72V8ElD9CmEwxGmxt6MVB+LkuXglH3srr9Btnhuir4P6jI92g==} engines: {node: '>=14'} dependencies: - '@unocss/core': 0.58.7 + '@unocss/core': 0.58.8 unconfig: 0.3.11 dev: true - /@unocss/core@0.58.7: - resolution: {integrity: sha512-Df5ytibV0MB7kWLggzLHsJUj08Of2oqXmPg7QjRUghMvCT3dl2LUIZXiztYPMH0F4x0cPebNoa/pavNt8xz9eQ==} + /@unocss/core@0.58.8: + resolution: {integrity: sha512-R3KuNTzF6G+bb2Qqg4LNLTWHh4TGU8iQJ4KOlpWHrPKAhDSCZ3XY9lSXoepCPwv+JcGEwA97Msa3zZ5p+QDoFg==} dev: true - /@unocss/eslint-plugin@0.58.7(eslint@9.0.0-rc.0)(typescript@5.4.3): - resolution: {integrity: sha512-b2i18LAADv0j5L4O+6ju+6PHBucnvgD8ipvDZvZWEX0EFIiFVO9CoMLJhMpONcahnPmWWrs/sELhwQu3uyCKVg==} + /@unocss/eslint-plugin@0.58.8(eslint@9.0.0-rc.0)(typescript@5.4.3): + resolution: {integrity: sha512-xJrWTx2iR1reI/HYymSQsdNXQVohq0woEWnsaEed6lVUNMGnjMjqbVcGVj+5IBxR9tWc/tIz7tLXGkz8x3xqOg==} engines: {node: '>=14'} dependencies: '@typescript-eslint/utils': 7.4.0(eslint@9.0.0-rc.0)(typescript@5.4.3) - '@unocss/config': 0.58.7 - '@unocss/core': 0.58.7 + '@unocss/config': 0.58.8 + '@unocss/core': 0.58.8 magic-string: 0.30.8 synckit: 0.9.0 transitivePeerDependencies: @@ -1984,6 +1984,10 @@ packages: resolution: {integrity: sha512-M1Ob1zPSIvlARiJUkKqvAZ3VAqQY6Jcuth/pBKQ2b1dX/Qx0OnJ8Vux6J2H5PTMQeRzWrrbTu70VxBfv/OPDJA==} dev: true + /destr@2.0.3: + resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} + dev: true + /devalue@4.3.2: resolution: {integrity: sha512-KqFl6pOgOW+Y6wJgu80rHpo2/3H07vr8ntR9rkkFIRETewbf5GaYYcakYfiKz89K+sLsuPkQIZaXDMjUObZwWg==} dev: true @@ -2218,30 +2222,31 @@ packages: parse-gitignore: 2.0.0 dev: false - /eslint-flat-config-utils@0.1.1: - resolution: {integrity: sha512-lQc7hFsNu54In+XbJdMmI06zJ5d8+3oDD+Y6badqZ434g9Xm6w+7DGv+mlzQgpf/eMX5iK2kUroTsFdy/WC8Sg==} + /eslint-flat-config-utils@0.1.2: + resolution: {integrity: sha512-NfeUJrbARSHGux2no/zz+YOjfMuPXpedcxRTqov3mlx9PJV2CYAJEj2EjbNSEyHMXQwNCfTtQVZXMSiktQTcpA==} dependencies: '@types/eslint': 8.56.6 dev: false - /eslint-flat-config-viewer@0.1.14(eslint@9.0.0-rc.0)(typescript@5.4.3): - resolution: {integrity: sha512-2ErHkowC7N9jiLHYAEI7lrm9phEPkyuZTCbRjVmj3B9yk/zVHhLCSlPGWzkgAEDW2MQRGSkvlbbhD7C9FRhYXQ==} + /eslint-flat-config-viewer@0.1.19(eslint@9.0.0-rc.0)(typescript@5.4.3): + resolution: {integrity: sha512-P+H9M2GmDYFmEra165LaQ+k+J8vOBRAJVWa6wedVrXPMYWf1u9H3eWI5TjQixaOelX4rV1qT1MOaYmoNdx/MZQ==} hasBin: true peerDependencies: eslint: ^8.50.0 dependencies: - '@unhead/shared': 1.8.20 - '@unhead/ssr': 1.8.20 + '@unhead/shared': 1.9.3 + '@unhead/ssr': 1.9.3 chokidar: 3.6.0 consola: 3.2.3 devalue: 4.3.2 eslint: 9.0.0-rc.0 + fast-glob: 3.3.2 get-port-please: 3.1.2 jiti: 1.21.0 minimatch: 9.0.3 - ofetch: 1.3.3 + ofetch: 1.3.4 open: 10.1.0 - unhead: 1.8.20 + unhead: 1.9.3 vue: 3.4.21(typescript@5.4.3) vue-bundle-renderer: 2.0.0 ws: 8.16.0 @@ -2368,8 +2373,8 @@ packages: - typescript dev: false - /eslint-plugin-jsdoc@48.2.1(eslint@9.0.0-rc.0): - resolution: {integrity: sha512-iUvbcyDZSO/9xSuRv2HQBw++8VkV/pt3UWtX9cpPH0l7GKPq78QC/6+PmyQHHvNZaTjAce6QVciEbnc6J/zH5g==} + /eslint-plugin-jsdoc@48.2.2(eslint@9.0.0-rc.0): + resolution: {integrity: sha512-S0Gk+rpT5w/ephKCncUY7kUsix9uE4B9XI8D/fS1/26d8okE+vZsuG1IvIt4B6sJUdQqsnzi+YXfmh+HJG11CA==} engines: {node: '>=18'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 @@ -2696,8 +2701,8 @@ packages: esrecurse: 4.3.0 estraverse: 5.3.0 - /eslint-typegen@0.1.4: - resolution: {integrity: sha512-Sb/xFinq1B5ZmcM+OispI9BQbuS1gb058WSeads/40y0/iYjxLLng77Q6MZPzEcpYuP8vV2t5qsC1Ca2Plc19Q==} + /eslint-typegen@0.1.6: + resolution: {integrity: sha512-M6a9l3ifdZvZIJahUQmf1c1gVxoNu9e8E1Uwzu3bg2jKH1dfSkO8KSViNio54vEQCvyVPfJky5U246hZf4j1RA==} dependencies: '@types/eslint': 8.56.6 json-schema-to-typescript-lite: 14.0.0 @@ -3869,6 +3874,10 @@ packages: resolution: {integrity: sha512-bW9T/uJDPAJB2YNYEpWzE54U5O3MQidXsOyTfnbKYtTtFexRvGzb1waphBN4ZwP6EcIvYYEOwW0b72BpAqydTw==} dev: true + /node-fetch-native@1.6.4: + resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==} + dev: true + /node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} dev: false @@ -3975,12 +3984,12 @@ packages: es-abstract: 1.22.5 dev: true - /ofetch@1.3.3: - resolution: {integrity: sha512-s1ZCMmQWXy4b5K/TW9i/DtiN8Ku+xCiHcjQ6/J/nDdssirrQNOoB165Zu8EqLMA2lln1JUth9a0aW9Ap2ctrUg==} + /ofetch@1.3.4: + resolution: {integrity: sha512-KLIET85ik3vhEfS+3fDlc/BAZiAp+43QEC/yCo5zkNoY2YaKvNkOaFr/6wCFgFH1kuYQM5pMNi0Tg8koiIemtw==} dependencies: - destr: 2.0.1 - node-fetch-native: 1.6.1 - ufo: 1.3.2 + destr: 2.0.3 + node-fetch-native: 1.6.4 + ufo: 1.5.3 dev: true /ohash@1.1.3: @@ -5118,6 +5127,10 @@ packages: /ufo@1.3.2: resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} + /ufo@1.5.3: + resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} + dev: true + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -5139,12 +5152,12 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - /unhead@1.8.20: - resolution: {integrity: sha512-IJOCYact/7Za3M7CeeCWs8Vze53kHvKDUy/EXtkTm/an5StgqOt2uCnS3HrkioIMKdHBpy/qtTc6E3BoGMOq7Q==} + /unhead@1.9.3: + resolution: {integrity: sha512-nV6d4ALJph73hCJT1tAd4z30Q2Gv8vNUvK0netM/EetL2scdggf9brcX3OyPqWhZbnFIOE+AouH2oE1KPznkcw==} dependencies: - '@unhead/dom': 1.8.20 - '@unhead/schema': 1.8.20 - '@unhead/shared': 1.8.20 + '@unhead/dom': 1.9.3 + '@unhead/schema': 1.9.3 + '@unhead/shared': 1.9.3 hookable: 5.5.3 dev: true diff --git a/src/configs/formatters.ts b/src/configs/formatters.ts index c7ddc52abe..4df933d85b 100644 --- a/src/configs/formatters.ts +++ b/src/configs/formatters.ts @@ -63,7 +63,7 @@ export async function formatters( const configs: TypedFlatConfigItem[] = [ { - name: 'antfu:formatters:setup', + name: 'antfu:formatter:setup', plugins: { format: pluginFormat, }, diff --git a/src/configs/imports.ts b/src/configs/imports.ts index 34b2d071a7..a254476dde 100644 --- a/src/configs/imports.ts +++ b/src/configs/imports.ts @@ -36,7 +36,7 @@ export async function imports(options: OptionsStylistic = {}): Promise { return [ { files: ['**/package.json'], - name: 'antfu:sort-package-json', + name: 'antfu:sort:package-json', rules: { 'jsonc/sort-array-values': [ 'error', @@ -116,7 +116,7 @@ export function sortTsconfig(): TypedFlatConfigItem[] { return [ { files: ['**/tsconfig.json', '**/tsconfig.*.json'], - name: 'antfu:sort-tsconfig', + name: 'antfu:sort:tsconfig', rules: { 'jsonc/sort-keys': [ 'error', From b3153eab6fcbc4ced86cffca1c4a1d5f10d0ccf1 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 29 Mar 2024 11:49:52 +0100 Subject: [PATCH 6/9] chore: release v2.11.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 84fd34684a..5b629d8f01 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@antfu/eslint-config", "type": "module", - "version": "2.11.4", + "version": "2.11.5", "packageManager": "pnpm@8.15.5", "description": "Anthony's ESLint config", "author": "Anthony Fu (https://github.com/antfu/)", From 9238901cdd38e27b4b4c11dc7dc30df05c9eadeb Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 29 Mar 2024 22:06:08 +0100 Subject: [PATCH 7/9] docs: move to `@eslint/config-inspector` --- README.md | 4 +-- package.json | 4 +-- pnpm-lock.yaml | 69 +++++++++++++++++++++++++++----------------------- 3 files changed, 42 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index a26de71860..30e743c54c 100644 --- a/README.md +++ b/README.md @@ -578,12 +578,12 @@ npx simple-git-hooks ## View what rules are enabled -I built a visual tool to help you view what rules are enabled in your project and apply them to what files, [eslint-flat-config-viewer](https://github.com/antfu/eslint-flat-config-viewer) +I built a visual tool to help you view what rules are enabled in your project and apply them to what files, [@eslint/config-inspector](https://github.com/eslint/config-inspector) Go to your project root that contains `eslint.config.js` and run: ```bash -npx eslint-flat-config-viewer +npx @eslint/config-inspector ``` ## Versioning Policy diff --git a/package.json b/package.json index 5b629d8f01..00b239be01 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "scripts": { "build": "nr typegen && tsup --format esm,cjs --clean --dts", "stub": "tsup --format esm", - "dev": "tsup --format esm,cjs --watch & eslint-flat-config-viewer", + "dev": "tsup --format esm,cjs --watch & npx @eslint/config-inspector", "watch": "tsup --format esm,cjs --watch", "lint": "eslint .", "typegen": "esno scripts/typegen.ts", @@ -125,6 +125,7 @@ "@antfu/eslint-config": "workspace:*", "@antfu/eslint-plugin-prettier": "^5.0.1-1", "@antfu/ni": "^0.21.12", + "@eslint/config-inspector": "^0.0.2", "@stylistic/eslint-plugin-migrate": "^1.7.0", "@types/eslint": "^8.56.6", "@types/fs-extra": "^11.0.4", @@ -135,7 +136,6 @@ "astro-eslint-parser": "^0.16.3", "bumpp": "^9.4.0", "eslint": "9.0.0-rc.0", - "eslint-flat-config-viewer": "^0.1.19", "eslint-plugin-astro": "^0.33.1", "eslint-plugin-format": "^0.1.0", "eslint-plugin-react": "^7.34.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2cc7364e15..40f1887bae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -117,6 +117,9 @@ importers: '@antfu/ni': specifier: ^0.21.12 version: 0.21.12 + '@eslint/config-inspector': + specifier: ^0.0.2 + version: 0.0.2(eslint@9.0.0-rc.0)(typescript@5.4.3) '@stylistic/eslint-plugin-migrate': specifier: ^1.7.0 version: 1.7.0(eslint@9.0.0-rc.0)(typescript@5.4.3) @@ -147,9 +150,6 @@ importers: eslint: specifier: 9.0.0-rc.0 version: 9.0.0-rc.0 - eslint-flat-config-viewer: - specifier: ^0.1.19 - version: 0.1.19(eslint@9.0.0-rc.0)(typescript@5.4.3) eslint-plugin-astro: specifier: ^0.33.1 version: 0.33.1(eslint@9.0.0-rc.0) @@ -562,6 +562,34 @@ packages: resolution: {integrity: sha512-EdyFKr1BHcx45o6gMZuCkFS64XHzVGFql0V3oL6mZwepnueulpmjsPxTiRRdrYdRknmQA+vjj1/znFkGRrPWHQ==} dev: true + /@eslint/config-inspector@0.0.2(eslint@9.0.0-rc.0)(typescript@5.4.3): + resolution: {integrity: sha512-epfkIBqZ2QsoPgK70IB5EZBdLI+mxPFFVQzqv9NbNimRyeawI+r2IsGLbWcl957Iy/NOj3Pr29KCJGuq3bS7/A==} + hasBin: true + peerDependencies: + eslint: ^8.50.0 + dependencies: + '@unhead/shared': 1.9.3 + '@unhead/ssr': 1.9.3 + chokidar: 3.6.0 + consola: 3.2.3 + devalue: 4.3.2 + eslint: 9.0.0-rc.0 + fast-glob: 3.3.2 + get-port-please: 3.1.2 + jiti: 1.21.0 + minimatch: 9.0.4 + ofetch: 1.3.4 + open: 10.1.0 + unhead: 1.9.3 + vue: 3.4.21(typescript@5.4.3) + vue-bundle-renderer: 2.0.0 + ws: 8.16.0 + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + dev: true + /@eslint/eslintrc@2.1.4: resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -2228,34 +2256,6 @@ packages: '@types/eslint': 8.56.6 dev: false - /eslint-flat-config-viewer@0.1.19(eslint@9.0.0-rc.0)(typescript@5.4.3): - resolution: {integrity: sha512-P+H9M2GmDYFmEra165LaQ+k+J8vOBRAJVWa6wedVrXPMYWf1u9H3eWI5TjQixaOelX4rV1qT1MOaYmoNdx/MZQ==} - hasBin: true - peerDependencies: - eslint: ^8.50.0 - dependencies: - '@unhead/shared': 1.9.3 - '@unhead/ssr': 1.9.3 - chokidar: 3.6.0 - consola: 3.2.3 - devalue: 4.3.2 - eslint: 9.0.0-rc.0 - fast-glob: 3.3.2 - get-port-please: 3.1.2 - jiti: 1.21.0 - minimatch: 9.0.3 - ofetch: 1.3.4 - open: 10.1.0 - unhead: 1.9.3 - vue: 3.4.21(typescript@5.4.3) - vue-bundle-renderer: 2.0.0 - ws: 8.16.0 - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - dev: true - /eslint-formatting-reporter@0.0.0(eslint@9.0.0-rc.0): resolution: {integrity: sha512-k9RdyTqxqN/wNYVaTk/ds5B5rA8lgoAmvceYN7bcZMBwU7TuXx5ntewJv81eF3pIL/CiJE+pJZm36llG8yhyyw==} peerDependencies: @@ -3804,6 +3804,13 @@ packages: dependencies: brace-expansion: 2.0.1 + /minimatch@9.0.4: + resolution: {integrity: sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minipass@3.3.6: resolution: {integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==} engines: {node: '>=8'} From 5ab92df06ff0add5ec00b5ae71bde277b9145105 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 30 Mar 2024 12:12:54 +0100 Subject: [PATCH 8/9] feat: generate types for core rules as well, resolve #439 --- package.json | 6 +++--- pnpm-lock.yaml | 52 +++++++++++++++++++++++----------------------- scripts/typegen.ts | 8 +++++++ 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 00b239be01..fd462094e7 100644 --- a/package.json +++ b/package.json @@ -125,11 +125,11 @@ "@antfu/eslint-config": "workspace:*", "@antfu/eslint-plugin-prettier": "^5.0.1-1", "@antfu/ni": "^0.21.12", - "@eslint/config-inspector": "^0.0.2", + "@eslint/config-inspector": "^0.1.0", "@stylistic/eslint-plugin-migrate": "^1.7.0", "@types/eslint": "^8.56.6", "@types/fs-extra": "^11.0.4", - "@types/node": "^20.11.30", + "@types/node": "^20.12.2", "@types/prompts": "^2.4.9", "@types/yargs": "^17.0.32", "@unocss/eslint-plugin": "^0.58.8", @@ -142,7 +142,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.6", "eslint-plugin-svelte": "2.36.0-next.13", - "eslint-typegen": "^0.1.6", + "eslint-typegen": "^0.2.0", "esno": "^4.7.0", "execa": "^8.0.1", "fast-glob": "^3.3.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 40f1887bae..de59f6dc17 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -118,8 +118,8 @@ importers: specifier: ^0.21.12 version: 0.21.12 '@eslint/config-inspector': - specifier: ^0.0.2 - version: 0.0.2(eslint@9.0.0-rc.0)(typescript@5.4.3) + specifier: ^0.1.0 + version: 0.1.0(eslint@9.0.0-rc.0)(typescript@5.4.3) '@stylistic/eslint-plugin-migrate': specifier: ^1.7.0 version: 1.7.0(eslint@9.0.0-rc.0)(typescript@5.4.3) @@ -130,8 +130,8 @@ importers: specifier: ^11.0.4 version: 11.0.4 '@types/node': - specifier: ^20.11.30 - version: 20.11.30 + specifier: ^20.12.2 + version: 20.12.2 '@types/prompts': specifier: ^2.4.9 version: 2.4.9 @@ -169,8 +169,8 @@ importers: specifier: 2.36.0-next.13 version: 2.36.0-next.13(eslint@9.0.0-rc.0)(svelte@4.2.12) eslint-typegen: - specifier: ^0.1.6 - version: 0.1.6 + specifier: ^0.2.0 + version: 0.2.0 esno: specifier: ^4.7.0 version: 4.7.0 @@ -212,7 +212,7 @@ importers: version: 5.4.3 vitest: specifier: ^1.4.0 - version: 1.4.0(@types/node@20.11.30) + version: 1.4.0(@types/node@20.12.2) vue: specifier: ^3.4.21 version: 3.4.21(typescript@5.4.3) @@ -562,8 +562,8 @@ packages: resolution: {integrity: sha512-EdyFKr1BHcx45o6gMZuCkFS64XHzVGFql0V3oL6mZwepnueulpmjsPxTiRRdrYdRknmQA+vjj1/znFkGRrPWHQ==} dev: true - /@eslint/config-inspector@0.0.2(eslint@9.0.0-rc.0)(typescript@5.4.3): - resolution: {integrity: sha512-epfkIBqZ2QsoPgK70IB5EZBdLI+mxPFFVQzqv9NbNimRyeawI+r2IsGLbWcl957Iy/NOj3Pr29KCJGuq3bS7/A==} + /@eslint/config-inspector@0.1.0(eslint@9.0.0-rc.0)(typescript@5.4.3): + resolution: {integrity: sha512-IN6ya0BFv/y1VsRD6SOSLJCSWMo0WFdsHSfmhcKAJXQzetpNJ6MMvgQ37Vaxl+NngagiT3cr72cJ8bDYLrHRNQ==} hasBin: true peerDependencies: eslint: ^8.50.0 @@ -927,7 +927,7 @@ packages: resolution: {integrity: sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==} dependencies: '@types/jsonfile': 6.1.3 - '@types/node': 20.11.30 + '@types/node': 20.12.2 dev: true /@types/json-schema@7.0.14: @@ -940,7 +940,7 @@ packages: /@types/jsonfile@6.1.3: resolution: {integrity: sha512-/yqTk2SZ1wIezK0hiRZD7RuSf4B3whFxFamB1kGStv+8zlWScTMcHanzfc0XKWs5vA1TkHeckBlOyM8jxU8nHA==} dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 dev: true /@types/mdast@3.0.14: @@ -949,8 +949,8 @@ packages: '@types/unist': 2.0.9 dev: false - /@types/node@20.11.30: - resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==} + /@types/node@20.12.2: + resolution: {integrity: sha512-zQ0NYO87hyN6Xrclcqp7f8ZbXNbRfoGWNcMvHTPQp9UUrwI0mI7XBz+cu7/W6/VClYo2g63B0cjull/srU7LgQ==} dependencies: undici-types: 5.26.5 @@ -961,7 +961,7 @@ packages: /@types/prompts@2.4.9: resolution: {integrity: sha512-qTxFi6Buiu8+50/+3DGIWLHM6QuWsEKugJnnP6iv2Mc4ncxE4A/OJkjuVOA+5X0X1S/nq5VJRa8Lu+nwcvbrKA==} dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 kleur: 3.0.3 dev: true @@ -2623,7 +2623,7 @@ packages: '@typescript-eslint/eslint-plugin': 7.4.0(@typescript-eslint/parser@7.4.0)(eslint@9.0.0-rc.0)(typescript@5.4.3) '@typescript-eslint/utils': 7.4.0(eslint@9.0.0-rc.0)(typescript@5.4.3) eslint: 9.0.0-rc.0 - vitest: 1.4.0(@types/node@20.11.30) + vitest: 1.4.0(@types/node@20.12.2) transitivePeerDependencies: - supports-color - typescript @@ -2701,8 +2701,8 @@ packages: esrecurse: 4.3.0 estraverse: 5.3.0 - /eslint-typegen@0.1.6: - resolution: {integrity: sha512-M6a9l3ifdZvZIJahUQmf1c1gVxoNu9e8E1Uwzu3bg2jKH1dfSkO8KSViNio54vEQCvyVPfJky5U246hZf4j1RA==} + /eslint-typegen@0.2.0: + resolution: {integrity: sha512-zaAQemIb3RfMjxCMv+sgoXAAhrMZDlx8rZ35zaIUS7ebZHvj1QjjspQnHnZ8UA/7U00u9tI+Lv1pjX1A73HHPQ==} dependencies: '@types/eslint': 8.56.6 json-schema-to-typescript-lite: 14.0.0 @@ -5210,7 +5210,7 @@ packages: spdx-expression-parse: 3.0.1 dev: false - /vite-node@1.4.0(@types/node@20.11.30): + /vite-node@1.4.0(@types/node@20.12.2): resolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5219,7 +5219,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.0 - vite: 5.0.5(@types/node@20.11.30) + vite: 5.0.5(@types/node@20.12.2) transitivePeerDependencies: - '@types/node' - less @@ -5230,7 +5230,7 @@ packages: - supports-color - terser - /vite@5.0.5(@types/node@20.11.30): + /vite@5.0.5(@types/node@20.12.2): resolution: {integrity: sha512-OekeWqR9Ls56f3zd4CaxzbbS11gqYkEiBtnWFFgYR2WV8oPJRRKq0mpskYy/XaoCL3L7VINDhqqOMNDiYdGvGg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5258,14 +5258,14 @@ packages: terser: optional: true dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 esbuild: 0.19.12 postcss: 8.4.35 rollup: 4.4.1 optionalDependencies: fsevents: 2.3.3 - /vitest@1.4.0(@types/node@20.11.30): + /vitest@1.4.0(@types/node@20.12.2): resolution: {integrity: sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -5290,7 +5290,7 @@ packages: jsdom: optional: true dependencies: - '@types/node': 20.11.30 + '@types/node': 20.12.2 '@vitest/expect': 1.4.0 '@vitest/runner': 1.4.0 '@vitest/snapshot': 1.4.0 @@ -5308,8 +5308,8 @@ packages: strip-literal: 2.0.0 tinybench: 2.5.1 tinypool: 0.8.2 - vite: 5.0.5(@types/node@20.11.30) - vite-node: 1.4.0(@types/node@20.11.30) + vite: 5.0.5(@types/node@20.12.2) + vite-node: 1.4.0(@types/node@20.12.2) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -5323,7 +5323,7 @@ packages: /vue-bundle-renderer@2.0.0: resolution: {integrity: sha512-oYATTQyh8XVkUWe2kaKxhxKVuuzK2Qcehe+yr3bGiaQAhK3ry2kYE4FWOfL+KO3hVFwCdLmzDQTzYhTi9C+R2A==} dependencies: - ufo: 1.3.2 + ufo: 1.5.3 dev: true /vue-eslint-parser@9.4.2(eslint@9.0.0-rc.0): diff --git a/scripts/typegen.ts b/scripts/typegen.ts index 5fd3fc430c..3c068fcd9c 100644 --- a/scripts/typegen.ts +++ b/scripts/typegen.ts @@ -1,8 +1,16 @@ import fs from 'node:fs/promises' import { flatConfigsToRulesDTS } from 'eslint-typegen/core' +import { builtinRules } from 'eslint/use-at-your-own-risk' import { astro, combine, comments, formatters, imports, javascript, jsdoc, jsonc, markdown, node, perfectionist, react, sortPackageJson, stylistic, svelte, test, toml, typescript, unicorn, unocss, vue, yaml } from '../src' const configs = await combine( + { + plugins: { + '': { + rules: Object.fromEntries(builtinRules.entries()), + }, + }, + }, astro(), comments(), formatters(), From 4d77eed3c91f3c126ad3f0235cc216be695c11dc Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sat, 30 Mar 2024 12:14:26 +0100 Subject: [PATCH 9/9] chore: release v2.11.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fd462094e7..482c89c4de 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@antfu/eslint-config", "type": "module", - "version": "2.11.5", + "version": "2.11.6", "packageManager": "pnpm@8.15.5", "description": "Anthony's ESLint config", "author": "Anthony Fu (https://github.com/antfu/)",