From 90361d4d19e865e8448c678535efed044959fb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Verit=C3=A9=20Mugabo?= Date: Fri, 5 Apr 2024 20:46:31 -0400 Subject: [PATCH] feat: plugin key (#411) --- fixtures/package.json | 6 +-- fixtures/pnpm-lock.yaml | 82 ++++++++++++++++++++--------------------- src/index.ts | 6 +++ 3 files changed, 50 insertions(+), 44 deletions(-) diff --git a/fixtures/package.json b/fixtures/package.json index 8e4e8f9..a3e95ba 100644 --- a/fixtures/package.json +++ b/fixtures/package.json @@ -12,11 +12,11 @@ "license": "MIT", "dependencies": { "eslint-plugin-json": "^3.1.0", - "eslint-plugin-vitest": "0.4.2-beta.1", - "vitest": "^1.3.1" + "eslint-plugin-vitest": "0.4.2-beta.2", + "vitest": "^1.4.0" }, "devDependencies": { - "@vitest/ui": "^1.3.1", + "@vitest/ui": "^1.4.0", "eslint": "^8.57.0" } } diff --git a/fixtures/pnpm-lock.yaml b/fixtures/pnpm-lock.yaml index aecc260..fa348e4 100644 --- a/fixtures/pnpm-lock.yaml +++ b/fixtures/pnpm-lock.yaml @@ -9,16 +9,16 @@ dependencies: specifier: ^3.1.0 version: 3.1.0 eslint-plugin-vitest: - specifier: 0.4.2-beta.1 - version: 0.4.2-beta.1(eslint@8.57.0)(typescript@5.4.4)(vitest@1.3.1) + specifier: 0.4.2-beta.2 + version: 0.4.2-beta.2(eslint@8.57.0)(typescript@5.4.4)(vitest@1.4.0) vitest: - specifier: ^1.3.1 - version: 1.3.1(@vitest/ui@1.3.1) + specifier: ^1.4.0 + version: 1.4.0(@vitest/ui@1.4.0) devDependencies: '@vitest/ui': - specifier: ^1.3.1 - version: 1.3.1(vitest@1.3.1) + specifier: ^1.4.0 + version: 1.4.0(vitest@1.4.0) eslint: specifier: ^8.57.0 version: 8.57.0 @@ -463,48 +463,48 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@vitest/expect@1.3.1: - resolution: {integrity: sha512-xofQFwIzfdmLLlHa6ag0dPV8YsnKOCP1KdAeVVh34vSjN2dcUiXYCD9htu/9eM7t8Xln4v03U9HLxLpPlsXdZw==} + /@vitest/expect@1.4.0: + resolution: {integrity: sha512-Jths0sWCJZ8BxjKe+p+eKsoqev1/T8lYcrjavEaz8auEJ4jAVY0GwW3JKmdVU4mmNPLPHixh4GNXP7GFtAiDHA==} dependencies: - '@vitest/spy': 1.3.1 - '@vitest/utils': 1.3.1 + '@vitest/spy': 1.4.0 + '@vitest/utils': 1.4.0 chai: 4.4.1 - /@vitest/runner@1.3.1: - resolution: {integrity: sha512-5FzF9c3jG/z5bgCnjr8j9LNq/9OxV2uEBAITOXfoe3rdZJTdO7jzThth7FXv/6b+kdY65tpRQB7WaKhNZwX+Kg==} + /@vitest/runner@1.4.0: + resolution: {integrity: sha512-EDYVSmesqlQ4RD2VvWo3hQgTJ7ZrFQ2VSJdfiJiArkCerDAGeyF1i6dHkmySqk573jLp6d/cfqCN+7wUB5tLgg==} dependencies: - '@vitest/utils': 1.3.1 + '@vitest/utils': 1.4.0 p-limit: 5.0.0 pathe: 1.1.2 - /@vitest/snapshot@1.3.1: - resolution: {integrity: sha512-EF++BZbt6RZmOlE3SuTPu/NfwBF6q4ABS37HHXzs2LUVPBLx2QoY/K0fKpRChSo8eLiuxcbCVfqKgx/dplCDuQ==} + /@vitest/snapshot@1.4.0: + resolution: {integrity: sha512-saAFnt5pPIA5qDGxOHxJ/XxhMFKkUSBJmVt5VgDsAqPTX6JP326r5C/c9UuCMPoXNzuudTPsYDZCoJ5ilpqG2A==} dependencies: magic-string: 0.30.8 pathe: 1.1.2 pretty-format: 29.7.0 - /@vitest/spy@1.3.1: - resolution: {integrity: sha512-xAcW+S099ylC9VLU7eZfdT9myV67Nor9w9zhf0mGCYJSO+zM2839tOeROTdikOi/8Qeusffvxb/MyBSOja1Uig==} + /@vitest/spy@1.4.0: + resolution: {integrity: sha512-Ywau/Qs1DzM/8Uc+yA77CwSegizMlcgTJuYGAi0jujOteJOUf1ujunHThYo243KG9nAyWT3L9ifPYZ5+As/+6Q==} dependencies: tinyspy: 2.2.1 - /@vitest/ui@1.3.1(vitest@1.3.1): - resolution: {integrity: sha512-2UrFLJ62c/eJGPHcclstMKlAR7E1WB1ITe1isuowEPJJHi3HfqofvsUqQ1cGrEF7kitG1DJuwURUA3HLDtQkXA==} + /@vitest/ui@1.4.0(vitest@1.4.0): + resolution: {integrity: sha512-XC6CMhN1gzYcGbpn6/Oanj4Au2EXwQEX6vpcOeLlZv8dy7g11Ukx8zwtYQbwxs9duK2s9j2o5rbQiCP5DPAcmw==} peerDependencies: - vitest: 1.3.1 + vitest: 1.4.0 dependencies: - '@vitest/utils': 1.3.1 + '@vitest/utils': 1.4.0 fast-glob: 3.3.2 fflate: 0.8.2 flatted: 3.3.1 pathe: 1.1.2 picocolors: 1.0.0 sirv: 2.0.4 - vitest: 1.3.1(@vitest/ui@1.3.1) + vitest: 1.4.0(@vitest/ui@1.4.0) - /@vitest/utils@1.3.1: - resolution: {integrity: sha512-d3Waie/299qqRyHTm2DjADeTaNdNSVsnwHPWrs20JMpjh6eiVq7ggggweO8rc4arhf6rRkWuHKwvxGvejUXZZQ==} + /@vitest/utils@1.4.0: + resolution: {integrity: sha512-mx3Yd1/6e2Vt/PUC98DcqTirtfxUyAZ32uK82r8rZzbtBeBo+nqgnjx/LvqQdWsrvNtm14VmurNgcf4nqY5gJg==} dependencies: diff-sequences: 29.6.3 estree-walker: 3.0.3 @@ -712,12 +712,12 @@ packages: vscode-json-languageservice: 4.2.1 dev: false - /eslint-plugin-vitest@0.4.2-beta.1(eslint@8.57.0)(typescript@5.4.4)(vitest@1.3.1): - resolution: {integrity: sha512-XMcAvL1G0npzRXeyHuTtv2jk3qQorCV+gDdbdun/7+fiDOYsNTiKmMu3KI6Aot2iDH6129ZyGDjKdfO7cOL0vQ==} + /eslint-plugin-vitest@0.4.2-beta.2(eslint@8.57.0)(typescript@5.4.4)(vitest@1.4.0): + resolution: {integrity: sha512-cZXchWmETNjpIuBmD/a62kAuZpbe0eINEwJtCu2hbQL6H1kQ5bK8Lvb92y4JjaaUb/POXcEjJAI7gWHDgkMTxQ==} engines: {node: ^18.0.0 || >= 20.0.0} peerDependencies: '@typescript-eslint/eslint-plugin': '*' - eslint: '>=8.0.0' + eslint: ^8.57.0 || ^9.0.0 vitest: '*' peerDependenciesMeta: '@typescript-eslint/eslint-plugin': @@ -727,7 +727,7 @@ packages: dependencies: '@typescript-eslint/utils': 7.5.0(eslint@8.57.0)(typescript@5.4.4) eslint: 8.57.0 - vitest: 1.3.1(@vitest/ui@1.3.1) + vitest: 1.4.0(@vitest/ui@1.4.0) transitivePeerDependencies: - supports-color - typescript @@ -1433,8 +1433,8 @@ packages: dependencies: punycode: 2.3.1 - /vite-node@1.3.1: - resolution: {integrity: sha512-azbRrqRxlWTJEVbzInZCTchx0X69M/XPTCz4H+TLvlTcR/xH/3hkRqhOakT41fMJCMzXTu4UvegkZiEoJAWvng==} + /vite-node@1.4.0: + resolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: @@ -1487,15 +1487,15 @@ packages: optionalDependencies: fsevents: 2.3.3 - /vitest@1.3.1(@vitest/ui@1.3.1): - resolution: {integrity: sha512-/1QJqXs8YbCrfv/GPQ05wAZf2eakUPLPa18vkJAKE7RXOKfVHqMZZ1WlTjiwl6Gcn65M5vpNUB6EFLnEdRdEXQ==} + /vitest@1.4.0(@vitest/ui@1.4.0): + resolution: {integrity: sha512-gujzn0g7fmwf83/WzrDTnncZt2UiXP41mHuFYFrdwaLRVQ6JYQEiME2IfEjU3vcFL3VKa75XhI3lFgn+hfVsQw==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 1.3.1 - '@vitest/ui': 1.3.1 + '@vitest/browser': 1.4.0 + '@vitest/ui': 1.4.0 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -1512,12 +1512,12 @@ packages: jsdom: optional: true dependencies: - '@vitest/expect': 1.3.1 - '@vitest/runner': 1.3.1 - '@vitest/snapshot': 1.3.1 - '@vitest/spy': 1.3.1 - '@vitest/ui': 1.3.1(vitest@1.3.1) - '@vitest/utils': 1.3.1 + '@vitest/expect': 1.4.0 + '@vitest/runner': 1.4.0 + '@vitest/snapshot': 1.4.0 + '@vitest/spy': 1.4.0 + '@vitest/ui': 1.4.0(vitest@1.4.0) + '@vitest/utils': 1.4.0 acorn-walk: 8.3.2 chai: 4.4.1 debug: 4.3.4 @@ -1531,7 +1531,7 @@ packages: tinybench: 2.6.0 tinypool: 0.8.2 vite: 5.1.5 - vite-node: 1.3.1 + vite-node: 1.4.0 why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/src/index.ts b/src/index.ts index 8419978..f02cd28 100644 --- a/src/index.ts +++ b/src/index.ts @@ -201,12 +201,18 @@ const plugin = { Object.assign(plugin.configs, { recommended: { + plugins: { + vitest: plugin + }, rules: createConfig(recommended) } }) Object.assign(plugin.configs, { all: { + plugins: { + vitest: plugin + }, rules: createConfig(allRules) } })