test: use @vitest/eslint-plugin (#2845)

This commit is contained in:
Marcin Kulpa 2024-11-10 02:27:01 +01:00 committed by GitHub
parent f689d78a31
commit 8b9c374565
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 39 additions and 97 deletions

View File

@ -20,7 +20,7 @@
"prettier",
"react-hooks",
"import",
"vitest",
"@vitest",
"testing-library",
"eslint-plugin-react-compiler"
],
@ -51,10 +51,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/namespace": "off",
"import/named": "off",
"import/order": [
@ -110,11 +106,19 @@
},
"overrides": [
{
"extends": ["plugin:testing-library/react"],
"extends": [
"plugin:testing-library/react",
"plugin:@vitest/legacy-recommended"
],
"files": ["tests/**/*.ts", "tests/**/*.tsx"],
"rules": {
"testing-library/no-node-access": "off",
"import/extensions": ["error", "never"],
"@vitest/expect-expect": "off",
"@vitest/consistent-test-it": [
"error",
{ "fn": "it", "withinDescribe": "it" }
],
"@typescript-eslint/no-unused-vars": "off"
}
},

View File

@ -120,6 +120,7 @@
"@typescript-eslint/eslint-plugin": "^8.12.2",
"@typescript-eslint/parser": "^8.12.2",
"@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",
@ -131,7 +132,6 @@
"eslint-plugin-react-compiler": "19.0.0-beta-6fc168f-20241025",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-testing-library": "^6.4.0",
"eslint-plugin-vitest": "^0.5.4",
"immer": "^10.1.1",
"jsdom": "^25.0.1",
"json": "^11.0.0",

106
pnpm-lock.yaml generated
View File

@ -44,6 +44,9 @@ devDependencies:
'@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.12.2)(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)
@ -77,9 +80,6 @@ devDependencies:
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.12.2)(eslint@8.57.0)(typescript@5.6.3)(vitest@2.1.4)
immer:
specifier: ^10.1.1
version: 10.1.1
@ -1333,14 +1333,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.12.2:
resolution: {integrity: sha512-gPLpLtrj9aMHOvxJkSbDBmbRuYdtiEbnvO25bCMza3DhMjTQw0u7Y1M+YR5JPbMsXXnSPuCf5hfq0nEkQDL/JQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1373,11 +1365,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.12.2:
resolution: {integrity: sha512-VwDwMF1SZ7wPBUZwmMdnDJ6sIFk4K4s+ALKLP6aIQsISkPv8jhiw65sAK6SuWODN/ix+m+HgbYDkH+zLjrzvOA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1404,28 +1391,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.3.0(typescript@5.6.3)
typescript: 5.6.3
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/typescript-estree@8.12.2(typescript@5.6.3):
resolution: {integrity: sha512-mME5MDwGe30Pq9zKPvyduyU86PH7aixwqYR2grTglAdB+AN8xXQ1vFGpYaUSJ5o5P/5znsSBeNcs5g5/2aQwow==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1468,22 +1433,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.12.2(eslint@8.57.0)(typescript@5.6.3):
resolution: {integrity: sha512-UTTuDIX3fkfAz6iSVa5rTuSfWIYZ6ATtEocQ/umkRSyC9O919lbZ8dcH7mysshrCdrAM03skJOEYaBugxN+M6A==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1508,14 +1457,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.12.2:
resolution: {integrity: sha512-PChz8UaKQAVNHghsHcPyx1OMHoFRUEA7rJSK/mDhdq85bk+PLsUHUBqTQTFt18VJZbmxBovM65fezlheQRsSDA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@ -1554,6 +1495,25 @@ packages:
- supports-color
dev: true
/@vitest/eslint-plugin@1.1.7(@typescript-eslint/utils@8.12.2)(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.12.2(eslint@8.57.0)(typescript@5.6.3)
eslint: 8.57.0
typescript: 5.6.3
vitest: 2.1.4(@types/node@22.8.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:
@ -2474,28 +2434,6 @@ packages:
- typescript
dev: true
/eslint-plugin-vitest@0.5.4(@typescript-eslint/eslint-plugin@8.12.2)(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.12.2(@typescript-eslint/parser@8.12.2)(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(@types/node@22.8.4)(@vitest/ui@2.1.4)(jsdom@25.0.1)
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/eslint-scope@5.1.1:
resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==}
engines: {node: '>=8.0.0'}

View File

@ -341,7 +341,7 @@ describe('when it receives a message of type...', () => {
})
describe('ROLLBACK...', () => {
it('it updates state without recording and inits with `message.state`', async () => {
it('updates state without recording and inits with `message.state`', async () => {
const initialState = { count: 0, increment: () => {} }
const api = createStore(devtools(() => initialState, { enabled: true }))
const newState = { foo: 'bar' }
@ -400,7 +400,7 @@ describe('when it receives a message of type...', () => {
describe('JUMP_TO_STATE...', () => {
const increment = () => {}
it('it updates state without recording with `message.state`', async () => {
it('updates state without recording with `message.state`', async () => {
const initialState = { count: 0, increment }
const api = createStore(devtools(() => initialState, { enabled: true }))
const newState = { foo: 'bar' }
@ -450,7 +450,7 @@ describe('when it receives a message of type...', () => {
})
describe('JUMP_TO_ACTION...', () => {
it('it updates state without recording with `message.state`', async () => {
it('updates state without recording with `message.state`', async () => {
const initialState = { count: 0, increment: () => {} }
const api = createStore(devtools(() => initialState, { enabled: true }))
const newState = { foo: 'bar' }
@ -1496,7 +1496,7 @@ describe('when create devtools was called multiple times with `name` option unde
})
describe('ROLLBACK...', () => {
it('it updates state without recording and inits with `message.state, connections are isolated from each other`', async () => {
it('updates state without recording and inits with `message.state, connections are isolated from each other`', async () => {
const options1 = { testConnectionId: 'asdf' }
const options2 = { testConnectionId: '2f' }
const options3 = { testConnectionId: 'd2e' }
@ -1676,7 +1676,7 @@ describe('when create devtools was called multiple times with `name` option unde
const increment2 = () => {}
const increment3 = () => {}
it('it updates state without recording with `message.state`, connections are isolated from each other', async () => {
it('updates state without recording with `message.state`, connections are isolated from each other', async () => {
const options1 = { testConnectionId: 'asdf' }
const options2 = { testConnectionId: '2f' }
const options3 = { testConnectionId: 'd2e' }
@ -1837,7 +1837,7 @@ describe('when create devtools was called multiple times with `name` option unde
const increment2 = () => {}
const increment3 = () => {}
it('it updates state without recording with `message.state`, connections are isolated from each other', async () => {
it('updates state without recording with `message.state`, connections are isolated from each other', async () => {
const options1 = { testConnectionId: 'asdf' }
const options2 = { testConnectionId: '2f' }
const options3 = { testConnectionId: 'd2e' }