Skip to content

Commit 63e7ad4

Browse files
alsmadi99Mohammad Alsmadi
andauthored
feat(lint): update ESLint configuration to use Vitest and remove Jest plugin (#4542)
Co-authored-by: Mohammad Alsmadi <[email protected]>
1 parent a8e86d2 commit 63e7ad4

File tree

3 files changed

+70
-78
lines changed

3 files changed

+70
-78
lines changed

eslint.config.mjs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import typescriptEslint from '@typescript-eslint/eslint-plugin';
22
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
3-
import jest from 'eslint-plugin-jest';
3+
import vitest from '@vitest/eslint-plugin';
44
import { importX } from 'eslint-plugin-import-x';
55
import globals from 'globals';
66
import tsParser from '@typescript-eslint/parser';
@@ -26,18 +26,15 @@ export default [
2626
{
2727
plugins: {
2828
'@typescript-eslint': typescriptEslint,
29-
jest,
3029
},
31-
3230
settings: {
3331
'import-x/resolver-next': createTypeScriptImportResolver(),
3432
},
35-
3633
languageOptions: {
3734
globals: {
3835
...globals.node,
36+
...vitest.environments.env.globals
3937
},
40-
4138
ecmaVersion: 11,
4239
sourceType: 'module',
4340

@@ -47,15 +44,13 @@ export default [
4744
},
4845
},
4946
},
50-
5147
rules: {
5248
'import-x/first': 'error',
5349
'import-x/no-absolute-path': 'error',
5450
'import-x/no-amd': 'error',
5551
'import-x/no-mutable-exports': 'error',
5652
'import-x/no-named-default': 'error',
5753
'import-x/no-self-import': 'error',
58-
5954
'import-x/no-extraneous-dependencies': [
6055
'error',
6156
{
@@ -76,11 +71,9 @@ export default [
7671
})),
7772
{
7873
files: ['**/*.cts', '**/*.ts'],
79-
8074
languageOptions: {
8175
parser: tsParser,
8276
},
83-
8477
rules: {
8578
'@typescript-eslint/no-unused-vars': 'off',
8679
'@typescript-eslint/no-use-before-define': 'off',
@@ -94,19 +87,18 @@ export default [
9487
'no-var': 'off',
9588
},
9689
},
97-
...compat.extends('plugin:jest/recommended').map((config) => ({
98-
...config,
99-
files: ['**/*.test.ts', '**/*.test.js'],
100-
})),
10190
{
10291
files: ['**/*.test.ts', '**/*.test.js'],
103-
92+
plugins: {
93+
vitest,
94+
},
10495
rules: {
96+
...vitest.configs.recommended.rules,
97+
'vitest/max-nested-describe': ['error', { max: 3 }],
10598
'@typescript-eslint/no-explicit-any': 'off',
10699
'@typescript-eslint/no-var-requires': 'off',
107100
'import-x/first': 'off',
108101
'import-x/no-extraneous-dependencies': 'off',
109-
'jest/no-deprecated-functions': 'off',
110102
},
111103
},
112104
];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@
8888
"@typescript-eslint/eslint-plugin": "^8.18.0",
8989
"@typescript-eslint/parser": "^8.18.0",
9090
"@vitest/coverage-istanbul": "^3.0.0",
91+
"@vitest/eslint-plugin": "^1.3.4",
9192
"cross-env": "^7.0.3",
9293
"eslint": "^9.16.0",
9394
"eslint-config-prettier": "^10.0.0",
9495
"eslint-import-resolver-typescript": "^4.4.3",
9596
"eslint-plugin-import-x": "^4.15.2",
96-
"eslint-plugin-jest": "^29.0.0",
9797
"globals": "^16.0.0",
9898
"husky": "^9.1.5",
9999
"lerna": "^8.2.0",

yarn.lock

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,15 +2026,6 @@
20262026
"@typescript-eslint/visitor-keys" "8.38.0"
20272027
debug "^4.3.4"
20282028

2029-
"@typescript-eslint/[email protected]":
2030-
version "8.34.1"
2031-
resolved "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.1.tgz#20501f8b87202c45f5e70a5b24dcdcb8fe12d460"
2032-
integrity sha512-nuHlOmFZfuRwLJKDGQOVc0xnQrAmuq1Mj/ISou5044y1ajGNp2BNliIqp7F2LPQ5sForz8lempMFCovfeS1XoA==
2033-
dependencies:
2034-
"@typescript-eslint/tsconfig-utils" "^8.34.1"
2035-
"@typescript-eslint/types" "^8.34.1"
2036-
debug "^4.3.4"
2037-
20382029
"@typescript-eslint/[email protected]":
20392030
version "8.38.0"
20402031
resolved "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz#4900771f943163027fd7d2020a062892056b5e2f"
@@ -2044,13 +2035,14 @@
20442035
"@typescript-eslint/types" "^8.38.0"
20452036
debug "^4.3.4"
20462037

2047-
"@typescript-eslint/scope-manager@8.34.1":
2048-
version "8.34.1"
2049-
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz#727ea43441f4d23d5c73d34195427d85042e5117"
2050-
integrity sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==
2038+
"@typescript-eslint/project-service@8.41.0":
2039+
version "8.41.0"
2040+
resolved "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.41.0.tgz#08ebf882d413a038926e73fda36e00c3dba84882"
2041+
integrity sha512-b8V9SdGBQzQdjJ/IO3eDifGpDBJfvrNTp2QD9P2BeqWTGrRibgfgIlBSw6z3b6R7dPzg752tOs4u/7yCLxksSQ==
20512042
dependencies:
2052-
"@typescript-eslint/types" "8.34.1"
2053-
"@typescript-eslint/visitor-keys" "8.34.1"
2043+
"@typescript-eslint/tsconfig-utils" "^8.41.0"
2044+
"@typescript-eslint/types" "^8.41.0"
2045+
debug "^4.3.4"
20542046

20552047
"@typescript-eslint/[email protected]":
20562048
version "8.38.0"
@@ -2060,16 +2052,24 @@
20602052
"@typescript-eslint/types" "8.38.0"
20612053
"@typescript-eslint/visitor-keys" "8.38.0"
20622054

2063-
"@typescript-eslint/[email protected]", "@typescript-eslint/tsconfig-utils@^8.34.1":
2064-
version "8.34.1"
2065-
resolved "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.1.tgz#d6abb1b1e9f1f1c83ac92051c8fbf2dbc4dc9f5e"
2066-
integrity sha512-K4Sjdo4/xF9NEeA2khOb7Y5nY6NSXBnod87uniVYW9kHP+hNlDV8trUSFeynA2uxWam4gIWgWoygPrv9VMWrYg==
2055+
"@typescript-eslint/[email protected]":
2056+
version "8.41.0"
2057+
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.41.0.tgz#c8aba12129cb9cead1f1727f58e6a0fcebeecdb5"
2058+
integrity sha512-n6m05bXn/Cd6DZDGyrpXrELCPVaTnLdPToyhBoFkLIMznRUQUEQdSp96s/pcWSQdqOhrgR1mzJ+yItK7T+WPMQ==
2059+
dependencies:
2060+
"@typescript-eslint/types" "8.41.0"
2061+
"@typescript-eslint/visitor-keys" "8.41.0"
20672062

20682063
"@typescript-eslint/[email protected]", "@typescript-eslint/tsconfig-utils@^8.38.0":
20692064
version "8.38.0"
20702065
resolved "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.38.0.tgz#6de4ce224a779601a8df667db56527255c42c4d0"
20712066
integrity sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==
20722067

2068+
"@typescript-eslint/[email protected]", "@typescript-eslint/tsconfig-utils@^8.41.0":
2069+
version "8.41.0"
2070+
resolved "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.41.0.tgz#134dee36eb16cdd78095a20bca0516d10b5dda75"
2071+
integrity sha512-TDhxYFPUYRFxFhuU5hTIJk+auzM/wKvWgoNYOPcOf6i4ReYlOoYN8q1dV5kOTjNQNJgzWN3TUUQMtlLOcUgdUw==
2072+
20732073
"@typescript-eslint/[email protected]":
20742074
version "8.38.0"
20752075
resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz#a56cd84765fa6ec135fe252b5db61e304403a85b"
@@ -2081,37 +2081,21 @@
20812081
debug "^4.3.4"
20822082
ts-api-utils "^2.1.0"
20832083

2084-
"@typescript-eslint/[email protected]", "@typescript-eslint/types@^8.34.1":
2085-
version "8.34.1"
2086-
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz#565a46a251580dae674dac5aafa8eb14b8322a35"
2087-
integrity sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==
2088-
20892084
"@typescript-eslint/[email protected]", "@typescript-eslint/types@^8.38.0":
20902085
version "8.38.0"
20912086
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz#297351c994976b93c82ac0f0e206c8143aa82529"
20922087
integrity sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==
20932088

2089+
"@typescript-eslint/[email protected]", "@typescript-eslint/types@^8.41.0":
2090+
version "8.41.0"
2091+
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz#9935afeaae65e535abcbcee95383fa649c64d16d"
2092+
integrity sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==
2093+
20942094
"@typescript-eslint/types@^8.35.0":
20952095
version "8.35.0"
20962096
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.35.0.tgz#e60d062907930e30008d796de5c4170f02618a93"
20972097
integrity sha512-0mYH3emanku0vHw2aRLNGqe7EXh9WHEhi7kZzscrMDf6IIRUQ5Jk4wp1QrledE/36KtdZrVfKnE32eZCf/vaVQ==
20982098

2099-
"@typescript-eslint/[email protected]":
2100-
version "8.34.1"
2101-
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz#befdb042a6bc44fdad27429b2d3b679c80daad71"
2102-
integrity sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==
2103-
dependencies:
2104-
"@typescript-eslint/project-service" "8.34.1"
2105-
"@typescript-eslint/tsconfig-utils" "8.34.1"
2106-
"@typescript-eslint/types" "8.34.1"
2107-
"@typescript-eslint/visitor-keys" "8.34.1"
2108-
debug "^4.3.4"
2109-
fast-glob "^3.3.2"
2110-
is-glob "^4.0.3"
2111-
minimatch "^9.0.4"
2112-
semver "^7.6.0"
2113-
ts-api-utils "^2.1.0"
2114-
21152099
"@typescript-eslint/[email protected]":
21162100
version "8.38.0"
21172101
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz#82262199eb6778bba28a319e25ad05b1158957df"
@@ -2128,6 +2112,22 @@
21282112
semver "^7.6.0"
21292113
ts-api-utils "^2.1.0"
21302114

2115+
"@typescript-eslint/[email protected]":
2116+
version "8.41.0"
2117+
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.41.0.tgz#7c9cff8b4334ce96f14e9689692e8cf426ce4d59"
2118+
integrity sha512-D43UwUYJmGhuwHfY7MtNKRZMmfd8+p/eNSfFe6tH5mbVDto+VQCayeAt35rOx3Cs6wxD16DQtIKw/YXxt5E0UQ==
2119+
dependencies:
2120+
"@typescript-eslint/project-service" "8.41.0"
2121+
"@typescript-eslint/tsconfig-utils" "8.41.0"
2122+
"@typescript-eslint/types" "8.41.0"
2123+
"@typescript-eslint/visitor-keys" "8.41.0"
2124+
debug "^4.3.4"
2125+
fast-glob "^3.3.2"
2126+
is-glob "^4.0.3"
2127+
minimatch "^9.0.4"
2128+
semver "^7.6.0"
2129+
ts-api-utils "^2.1.0"
2130+
21312131
"@typescript-eslint/[email protected]":
21322132
version "8.38.0"
21332133
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz#5f10159899d30eb92ba70e642ca6f754bddbf15a"
@@ -2138,23 +2138,15 @@
21382138
"@typescript-eslint/types" "8.38.0"
21392139
"@typescript-eslint/typescript-estree" "8.38.0"
21402140

2141-
"@typescript-eslint/utils@^8.0.0":
2142-
version "8.34.1"
2143-
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.1.tgz#f98c9b0c5cae407e34f5131cac0f3a74347a398e"
2144-
integrity sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ==
2141+
"@typescript-eslint/utils@^8.24.1":
2142+
version "8.41.0"
2143+
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.41.0.tgz#17cb3b766c1626311004ea41ffd8c27eb226b953"
2144+
integrity sha512-udbCVstxZ5jiPIXrdH+BZWnPatjlYwJuJkDA4Tbo3WyYLh8NvB+h/bKeSZHDOFKfphsZYJQqaFtLeXEqurQn1A==
21452145
dependencies:
21462146
"@eslint-community/eslint-utils" "^4.7.0"
2147-
"@typescript-eslint/scope-manager" "8.34.1"
2148-
"@typescript-eslint/types" "8.34.1"
2149-
"@typescript-eslint/typescript-estree" "8.34.1"
2150-
2151-
"@typescript-eslint/[email protected]":
2152-
version "8.34.1"
2153-
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz#28a1987ea3542ccafb92aa792726a304b39531cf"
2154-
integrity sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==
2155-
dependencies:
2156-
"@typescript-eslint/types" "8.34.1"
2157-
eslint-visitor-keys "^4.2.1"
2147+
"@typescript-eslint/scope-manager" "8.41.0"
2148+
"@typescript-eslint/types" "8.41.0"
2149+
"@typescript-eslint/typescript-estree" "8.41.0"
21582150

21592151
"@typescript-eslint/[email protected]":
21602152
version "8.38.0"
@@ -2164,6 +2156,14 @@
21642156
"@typescript-eslint/types" "8.38.0"
21652157
eslint-visitor-keys "^4.2.1"
21662158

2159+
"@typescript-eslint/[email protected]":
2160+
version "8.41.0"
2161+
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.41.0.tgz#16eb99b55d207f6688002a2cf425e039579aa9a9"
2162+
integrity sha512-+GeGMebMCy0elMNg67LRNoVnUFPIm37iu5CmHESVx56/9Jsfdpsvbv605DQ81Pi/x11IdKUsS5nzgTYbCQU9fg==
2163+
dependencies:
2164+
"@typescript-eslint/types" "8.41.0"
2165+
eslint-visitor-keys "^4.2.1"
2166+
21672167
"@ungap/structured-clone@^1.0.0":
21682168
version "1.3.0"
21692169
resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8"
@@ -2287,6 +2287,13 @@
22872287
test-exclude "^7.0.1"
22882288
tinyrainbow "^2.0.0"
22892289

2290+
"@vitest/eslint-plugin@^1.3.4":
2291+
version "1.3.4"
2292+
resolved "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.3.4.tgz#010f99ecfdcf349eb6d9c1f29c31ebcc8f5e18f8"
2293+
integrity sha512-EOg8d0jn3BAiKnR55WkFxmxfWA3nmzrbIIuOXyTe6A72duryNgyU+bdBEauA97Aab3ho9kLmAwgPX63Ckj4QEg==
2294+
dependencies:
2295+
"@typescript-eslint/utils" "^8.24.1"
2296+
22902297
22912298
version "3.2.4"
22922299
resolved "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz#8362124cd811a5ee11c5768207b9df53d34f2433"
@@ -3754,13 +3761,6 @@ eslint-plugin-import-x@^4.15.2:
37543761
stable-hash-x "^0.2.0"
37553762
unrs-resolver "^1.9.2"
37563763

3757-
eslint-plugin-jest@^29.0.0:
3758-
version "29.0.1"
3759-
resolved "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.0.1.tgz#0f72a81349409d20742208260c9a6cb9efed4df5"
3760-
integrity sha512-EE44T0OSMCeXhDrrdsbKAhprobKkPtJTbQz5yEktysNpHeDZTAL1SfDTNKmcFfJkY6yrQLtTKZALrD3j/Gpmiw==
3761-
dependencies:
3762-
"@typescript-eslint/utils" "^8.0.0"
3763-
37643764
eslint-scope@^8.4.0:
37653765
version "8.4.0"
37663766
resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82"

0 commit comments

Comments
 (0)