diff --git a/.eslintrc.json b/.eslintrc.json index 56f12605..117a3812 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -20,7 +20,7 @@ "prettier", "react-hooks", "import", - "vitest", + "@vitest", "testing-library", "eslint-plugin-react-compiler" ], @@ -53,10 +53,6 @@ "@typescript-eslint/no-use-before-define": "off", "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-explicit-any": "off", - "vitest/consistent-test-it": [ - "error", - { "fn": "it", "withinDescribe": "it" } - ], "import/order": [ "error", { @@ -110,10 +106,18 @@ }, "overrides": [ { - "extends": ["plugin:testing-library/react"], + "extends": [ + "plugin:testing-library/react", + "plugin:@vitest/legacy-recommended" + ], "files": ["tests/**/*.ts", "tests/**/*.tsx"], "rules": { "import/extensions": ["error", "never"], + "@vitest/expect-expect": "off", + "@vitest/consistent-test-it": [ + "error", + { "fn": "it", "withinDescribe": "it" } + ], "@typescript-eslint/no-unused-vars": "off" } }, diff --git a/package.json b/package.json index 8cb0bd35..b946a162 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "@typescript-eslint/eslint-plugin": "^8.13.0", "@typescript-eslint/parser": "^8.13.0", "@vitest/coverage-v8": "^2.1.4", + "@vitest/eslint-plugin": "^1.1.7", "@vitest/ui": "^2.1.4", "esbuild": "^0.24.0", "eslint": "8.57.0", @@ -129,7 +130,6 @@ "eslint-plugin-react-compiler": "19.0.0-beta-8a03594-20241020", "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-testing-library": "^6.4.0", - "eslint-plugin-vitest": "^0.5.4", "jest-leak-detector": "^29.7.0", "jsdom": "^25.0.1", "json": "^11.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f092b900..58c72cf8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,6 +48,9 @@ importers: '@vitest/coverage-v8': specifier: ^2.1.4 version: 2.1.4(vitest@2.1.4) + '@vitest/eslint-plugin': + specifier: ^1.1.7 + version: 1.1.7(@typescript-eslint/utils@8.13.0)(eslint@8.57.0)(typescript@5.6.3)(vitest@2.1.4) '@vitest/ui': specifier: ^2.1.4 version: 2.1.4(vitest@2.1.4) @@ -81,9 +84,6 @@ importers: eslint-plugin-testing-library: specifier: ^6.4.0 version: 6.4.0(eslint@8.57.0)(typescript@5.6.3) - eslint-plugin-vitest: - specifier: ^0.5.4 - version: 0.5.4(@typescript-eslint/eslint-plugin@8.13.0)(eslint@8.57.0)(typescript@5.6.3)(vitest@2.1.4) jest-leak-detector: specifier: ^29.7.0 version: 29.7.0 @@ -4756,14 +4756,6 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/scope-manager@7.18.0: - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - dev: true - /@typescript-eslint/scope-manager@8.13.0: resolution: {integrity: sha512-XsGWww0odcUT0gJoBZ1DeulY1+jkaHUciUq4jKNv4cpInbvvrtDoyBH9rE/n2V29wQJPk8iCH1wipra9BhmiMA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -4804,11 +4796,6 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@7.18.0: - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} - dev: true - /@typescript-eslint/types@8.13.0: resolution: {integrity: sha512-4cyFErJetFLckcThRUFdReWJjVsPCqyBlJTi6IDEpc1GWCIIZRFxVppjWLIMcQhNGhdWJJRYFHpHoDWvMlDzng==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -4876,28 +4863,6 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.18.0(typescript@5.6.3): - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.7 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.5 - semver: 7.6.3 - ts-api-utils: 1.4.0(typescript@5.6.3) - typescript: 5.6.3 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/typescript-estree@8.13.0(typescript@5.6.3): resolution: {integrity: sha512-v7SCIGmVsRK2Cy/LTLGN22uea6SaUIlpBcO/gnMGT/7zPtxp90bphcGf4fyrCQl3ZtiBKqVTG32hb668oIYy1g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -4940,22 +4905,6 @@ packages: - typescript dev: true - /@typescript-eslint/utils@7.18.0(eslint@8.57.0)(typescript@5.6.3): - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - eslint: ^8.56.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.1(eslint@8.57.0) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.6.3) - eslint: 8.57.0 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /@typescript-eslint/utils@8.13.0(eslint@8.57.0)(typescript@5.6.3): resolution: {integrity: sha512-A1EeYOND6Uv250nybnLZapeXpYMl8tkzYUxqmoKAWnI4sei3ihf2XdZVd+vVOmHGcp3t+P7yRrNsyyiXTvShFQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -4993,14 +4942,6 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@7.18.0: - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} - dependencies: - '@typescript-eslint/types': 7.18.0 - eslint-visitor-keys: 3.4.3 - dev: true - /@typescript-eslint/visitor-keys@8.13.0: resolution: {integrity: sha512-7N/+lztJqH4Mrf0lb10R/CbI1EaAMMGyF5y0oJvFoAhafwgiRA7TXyd8TFn8FC8k5y2dTsYogg238qavRGNnlw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -5071,6 +5012,25 @@ packages: - supports-color dev: true + /@vitest/eslint-plugin@1.1.7(@typescript-eslint/utils@8.13.0)(eslint@8.57.0)(typescript@5.6.3)(vitest@2.1.4): + resolution: {integrity: sha512-pTWGW3y6lH2ukCuuffpan6kFxG6nIuoesbhMiQxskyQMRcCN5t9SXsKrNHvEw3p8wcCsgJoRqFZVkOTn6TjclA==} + peerDependencies: + '@typescript-eslint/utils': '>= 8.0' + eslint: '>= 8.57.0' + typescript: '>= 5.0.0' + vitest: '*' + peerDependenciesMeta: + typescript: + optional: true + vitest: + optional: true + dependencies: + '@typescript-eslint/utils': 8.13.0(eslint@8.57.0)(typescript@5.6.3) + eslint: 8.57.0 + typescript: 5.6.3 + vitest: 2.1.4(@vitest/ui@2.1.4)(jsdom@25.0.1) + dev: true + /@vitest/expect@2.1.4: resolution: {integrity: sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==} dependencies: @@ -8302,28 +8262,6 @@ packages: - typescript dev: true - /eslint-plugin-vitest@0.5.4(@typescript-eslint/eslint-plugin@8.13.0)(eslint@8.57.0)(typescript@5.6.3)(vitest@2.1.4): - resolution: {integrity: sha512-um+odCkccAHU53WdKAw39MY61+1x990uXjSPguUCq3VcEHdqJrOb8OTMrbYlY6f9jAKx7x98kLVlIe3RJeJqoQ==} - engines: {node: ^18.0.0 || >= 20.0.0} - peerDependencies: - '@typescript-eslint/eslint-plugin': '*' - eslint: ^8.57.0 || ^9.0.0 - vitest: '*' - peerDependenciesMeta: - '@typescript-eslint/eslint-plugin': - optional: true - vitest: - optional: true - dependencies: - '@typescript-eslint/eslint-plugin': 8.13.0(@typescript-eslint/parser@8.13.0)(eslint@8.57.0)(typescript@5.6.3) - '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.6.3) - eslint: 8.57.0 - vitest: 2.1.4(@vitest/ui@2.1.4)(jsdom@25.0.1) - transitivePeerDependencies: - - supports-color - - typescript - dev: true - /eslint-scope@4.0.3: resolution: {integrity: sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==} engines: {node: '>=4.0.0'} diff --git a/tests/proxyMap.bench.ts b/tests/proxyMap.bench.ts index 8a6bacf4..44d4eaed 100644 --- a/tests/proxyMap.bench.ts +++ b/tests/proxyMap.bench.ts @@ -1,6 +1,6 @@ -/* eslint-disable vitest/consistent-test-it */ -import { bench, describe, test } from 'vitest' -import { proxy, snapshot } from 'valtio' +/* eslint-disable @vitest/consistent-test-it */ +import { bench, describe } from 'vitest' +import { snapshot } from 'valtio' import { proxyMap } from 'valtio/utils' // Helper function to generate test data