Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(lint): update ESLint configuration to use Vitest and remove Jest…
… plugin (conventional-changelog#4542)

Co-authored-by: Mohammad Alsmadi <[email protected]>
  • Loading branch information
alsmadi99 and Mohammad Alsmadi authored Oct 3, 2025
commit 63e7ad4e47d36ce7c58e793e7c587378f3d01082
22 changes: 7 additions & 15 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';
import jest from 'eslint-plugin-jest';
import vitest from '@vitest/eslint-plugin';
import { importX } from 'eslint-plugin-import-x';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
Expand All @@ -26,18 +26,15 @@ export default [
{
plugins: {
'@typescript-eslint': typescriptEslint,
jest,
},

settings: {
'import-x/resolver-next': createTypeScriptImportResolver(),
},

languageOptions: {
globals: {
...globals.node,
...vitest.environments.env.globals
},

ecmaVersion: 11,
sourceType: 'module',

Expand All @@ -47,15 +44,13 @@ export default [
},
},
},

rules: {
'import-x/first': 'error',
'import-x/no-absolute-path': 'error',
'import-x/no-amd': 'error',
'import-x/no-mutable-exports': 'error',
'import-x/no-named-default': 'error',
'import-x/no-self-import': 'error',

'import-x/no-extraneous-dependencies': [
'error',
{
Expand All @@ -76,11 +71,9 @@ export default [
})),
{
files: ['**/*.cts', '**/*.ts'],

languageOptions: {
parser: tsParser,
},

rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-use-before-define': 'off',
Expand All @@ -94,19 +87,18 @@ export default [
'no-var': 'off',
},
},
...compat.extends('plugin:jest/recommended').map((config) => ({
...config,
files: ['**/*.test.ts', '**/*.test.js'],
})),
{
files: ['**/*.test.ts', '**/*.test.js'],

plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
'vitest/max-nested-describe': ['error', { max: 3 }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'import-x/first': 'off',
'import-x/no-extraneous-dependencies': 'off',
'jest/no-deprecated-functions': 'off',
},
},
];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"@vitest/coverage-istanbul": "^3.0.0",
"@vitest/eslint-plugin": "^1.3.4",
"cross-env": "^7.0.3",
"eslint": "^9.16.0",
"eslint-config-prettier": "^10.0.0",
"eslint-import-resolver-typescript": "^4.4.3",
"eslint-plugin-import-x": "^4.15.2",
"eslint-plugin-jest": "^29.0.0",
"globals": "^16.0.0",
"husky": "^9.1.5",
"lerna": "^8.2.0",
Expand Down
124 changes: 62 additions & 62 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2026,15 +2026,6 @@
"@typescript-eslint/visitor-keys" "8.38.0"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
version "8.34.1"
resolved "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.34.1.tgz#20501f8b87202c45f5e70a5b24dcdcb8fe12d460"
integrity sha512-nuHlOmFZfuRwLJKDGQOVc0xnQrAmuq1Mj/ISou5044y1ajGNp2BNliIqp7F2LPQ5sForz8lempMFCovfeS1XoA==
dependencies:
"@typescript-eslint/tsconfig-utils" "^8.34.1"
"@typescript-eslint/types" "^8.34.1"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
version "8.38.0"
resolved "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz#4900771f943163027fd7d2020a062892056b5e2f"
Expand All @@ -2044,13 +2035,14 @@
"@typescript-eslint/types" "^8.38.0"
debug "^4.3.4"

"@typescript-eslint/scope-manager@8.34.1":
version "8.34.1"
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.34.1.tgz#727ea43441f4d23d5c73d34195427d85042e5117"
integrity sha512-beu6o6QY4hJAgL1E8RaXNC071G4Kso2MGmJskCFQhRhg8VOH/FDbC8soP8NHN7e/Hdphwp8G8cE6OBzC8o41ZA==
"@typescript-eslint/project-service@8.41.0":
version "8.41.0"
resolved "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.41.0.tgz#08ebf882d413a038926e73fda36e00c3dba84882"
integrity sha512-b8V9SdGBQzQdjJ/IO3eDifGpDBJfvrNTp2QD9P2BeqWTGrRibgfgIlBSw6z3b6R7dPzg752tOs4u/7yCLxksSQ==
dependencies:
"@typescript-eslint/types" "8.34.1"
"@typescript-eslint/visitor-keys" "8.34.1"
"@typescript-eslint/tsconfig-utils" "^8.41.0"
"@typescript-eslint/types" "^8.41.0"
debug "^4.3.4"

"@typescript-eslint/[email protected]":
version "8.38.0"
Expand All @@ -2060,16 +2052,24 @@
"@typescript-eslint/types" "8.38.0"
"@typescript-eslint/visitor-keys" "8.38.0"

"@typescript-eslint/[email protected]", "@typescript-eslint/tsconfig-utils@^8.34.1":
version "8.34.1"
resolved "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.34.1.tgz#d6abb1b1e9f1f1c83ac92051c8fbf2dbc4dc9f5e"
integrity sha512-K4Sjdo4/xF9NEeA2khOb7Y5nY6NSXBnod87uniVYW9kHP+hNlDV8trUSFeynA2uxWam4gIWgWoygPrv9VMWrYg==
"@typescript-eslint/[email protected]":
version "8.41.0"
resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.41.0.tgz#c8aba12129cb9cead1f1727f58e6a0fcebeecdb5"
integrity sha512-n6m05bXn/Cd6DZDGyrpXrELCPVaTnLdPToyhBoFkLIMznRUQUEQdSp96s/pcWSQdqOhrgR1mzJ+yItK7T+WPMQ==
dependencies:
"@typescript-eslint/types" "8.41.0"
"@typescript-eslint/visitor-keys" "8.41.0"

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

"@typescript-eslint/[email protected]", "@typescript-eslint/tsconfig-utils@^8.41.0":
version "8.41.0"
resolved "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.41.0.tgz#134dee36eb16cdd78095a20bca0516d10b5dda75"
integrity sha512-TDhxYFPUYRFxFhuU5hTIJk+auzM/wKvWgoNYOPcOf6i4ReYlOoYN8q1dV5kOTjNQNJgzWN3TUUQMtlLOcUgdUw==

"@typescript-eslint/[email protected]":
version "8.38.0"
resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz#a56cd84765fa6ec135fe252b5db61e304403a85b"
Expand All @@ -2081,37 +2081,21 @@
debug "^4.3.4"
ts-api-utils "^2.1.0"

"@typescript-eslint/[email protected]", "@typescript-eslint/types@^8.34.1":
version "8.34.1"
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.34.1.tgz#565a46a251580dae674dac5aafa8eb14b8322a35"
integrity sha512-rjLVbmE7HR18kDsjNIZQHxmv9RZwlgzavryL5Lnj2ujIRTeXlKtILHgRNmQ3j4daw7zd+mQgy+uyt6Zo6I0IGA==

"@typescript-eslint/[email protected]", "@typescript-eslint/types@^8.38.0":
version "8.38.0"
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz#297351c994976b93c82ac0f0e206c8143aa82529"
integrity sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==

"@typescript-eslint/[email protected]", "@typescript-eslint/types@^8.41.0":
version "8.41.0"
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz#9935afeaae65e535abcbcee95383fa649c64d16d"
integrity sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==

"@typescript-eslint/types@^8.35.0":
version "8.35.0"
resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.35.0.tgz#e60d062907930e30008d796de5c4170f02618a93"
integrity sha512-0mYH3emanku0vHw2aRLNGqe7EXh9WHEhi7kZzscrMDf6IIRUQ5Jk4wp1QrledE/36KtdZrVfKnE32eZCf/vaVQ==

"@typescript-eslint/[email protected]":
version "8.34.1"
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.34.1.tgz#befdb042a6bc44fdad27429b2d3b679c80daad71"
integrity sha512-rjCNqqYPuMUF5ODD+hWBNmOitjBWghkGKJg6hiCHzUvXRy6rK22Jd3rwbP2Xi+R7oYVvIKhokHVhH41BxPV5mA==
dependencies:
"@typescript-eslint/project-service" "8.34.1"
"@typescript-eslint/tsconfig-utils" "8.34.1"
"@typescript-eslint/types" "8.34.1"
"@typescript-eslint/visitor-keys" "8.34.1"
debug "^4.3.4"
fast-glob "^3.3.2"
is-glob "^4.0.3"
minimatch "^9.0.4"
semver "^7.6.0"
ts-api-utils "^2.1.0"

"@typescript-eslint/[email protected]":
version "8.38.0"
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz#82262199eb6778bba28a319e25ad05b1158957df"
Expand All @@ -2128,6 +2112,22 @@
semver "^7.6.0"
ts-api-utils "^2.1.0"

"@typescript-eslint/[email protected]":
version "8.41.0"
resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.41.0.tgz#7c9cff8b4334ce96f14e9689692e8cf426ce4d59"
integrity sha512-D43UwUYJmGhuwHfY7MtNKRZMmfd8+p/eNSfFe6tH5mbVDto+VQCayeAt35rOx3Cs6wxD16DQtIKw/YXxt5E0UQ==
dependencies:
"@typescript-eslint/project-service" "8.41.0"
"@typescript-eslint/tsconfig-utils" "8.41.0"
"@typescript-eslint/types" "8.41.0"
"@typescript-eslint/visitor-keys" "8.41.0"
debug "^4.3.4"
fast-glob "^3.3.2"
is-glob "^4.0.3"
minimatch "^9.0.4"
semver "^7.6.0"
ts-api-utils "^2.1.0"

"@typescript-eslint/[email protected]":
version "8.38.0"
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz#5f10159899d30eb92ba70e642ca6f754bddbf15a"
Expand All @@ -2138,23 +2138,15 @@
"@typescript-eslint/types" "8.38.0"
"@typescript-eslint/typescript-estree" "8.38.0"

"@typescript-eslint/utils@^8.0.0":
version "8.34.1"
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.34.1.tgz#f98c9b0c5cae407e34f5131cac0f3a74347a398e"
integrity sha512-mqOwUdZ3KjtGk7xJJnLbHxTuWVn3GO2WZZuM+Slhkun4+qthLdXx32C8xIXbO1kfCECb3jIs3eoxK3eryk7aoQ==
"@typescript-eslint/utils@^8.24.1":
version "8.41.0"
resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.41.0.tgz#17cb3b766c1626311004ea41ffd8c27eb226b953"
integrity sha512-udbCVstxZ5jiPIXrdH+BZWnPatjlYwJuJkDA4Tbo3WyYLh8NvB+h/bKeSZHDOFKfphsZYJQqaFtLeXEqurQn1A==
dependencies:
"@eslint-community/eslint-utils" "^4.7.0"
"@typescript-eslint/scope-manager" "8.34.1"
"@typescript-eslint/types" "8.34.1"
"@typescript-eslint/typescript-estree" "8.34.1"

"@typescript-eslint/[email protected]":
version "8.34.1"
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.34.1.tgz#28a1987ea3542ccafb92aa792726a304b39531cf"
integrity sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==
dependencies:
"@typescript-eslint/types" "8.34.1"
eslint-visitor-keys "^4.2.1"
"@typescript-eslint/scope-manager" "8.41.0"
"@typescript-eslint/types" "8.41.0"
"@typescript-eslint/typescript-estree" "8.41.0"

"@typescript-eslint/[email protected]":
version "8.38.0"
Expand All @@ -2164,6 +2156,14 @@
"@typescript-eslint/types" "8.38.0"
eslint-visitor-keys "^4.2.1"

"@typescript-eslint/[email protected]":
version "8.41.0"
resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.41.0.tgz#16eb99b55d207f6688002a2cf425e039579aa9a9"
integrity sha512-+GeGMebMCy0elMNg67LRNoVnUFPIm37iu5CmHESVx56/9Jsfdpsvbv605DQ81Pi/x11IdKUsS5nzgTYbCQU9fg==
dependencies:
"@typescript-eslint/types" "8.41.0"
eslint-visitor-keys "^4.2.1"

"@ungap/structured-clone@^1.0.0":
version "1.3.0"
resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.0.tgz#d06bbb384ebcf6c505fde1c3d0ed4ddffe0aaff8"
Expand Down Expand Up @@ -2287,6 +2287,13 @@
test-exclude "^7.0.1"
tinyrainbow "^2.0.0"

"@vitest/eslint-plugin@^1.3.4":
version "1.3.4"
resolved "https://registry.npmjs.org/@vitest/eslint-plugin/-/eslint-plugin-1.3.4.tgz#010f99ecfdcf349eb6d9c1f29c31ebcc8f5e18f8"
integrity sha512-EOg8d0jn3BAiKnR55WkFxmxfWA3nmzrbIIuOXyTe6A72duryNgyU+bdBEauA97Aab3ho9kLmAwgPX63Ckj4QEg==
dependencies:
"@typescript-eslint/utils" "^8.24.1"

"@vitest/[email protected]":
version "3.2.4"
resolved "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz#8362124cd811a5ee11c5768207b9df53d34f2433"
Expand Down Expand Up @@ -3754,13 +3761,6 @@ eslint-plugin-import-x@^4.15.2:
stable-hash-x "^0.2.0"
unrs-resolver "^1.9.2"

eslint-plugin-jest@^29.0.0:
version "29.0.1"
resolved "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.0.1.tgz#0f72a81349409d20742208260c9a6cb9efed4df5"
integrity sha512-EE44T0OSMCeXhDrrdsbKAhprobKkPtJTbQz5yEktysNpHeDZTAL1SfDTNKmcFfJkY6yrQLtTKZALrD3j/Gpmiw==
dependencies:
"@typescript-eslint/utils" "^8.0.0"

eslint-scope@^8.4.0:
version "8.4.0"
resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz#88e646a207fad61436ffa39eb505147200655c82"
Expand Down