Skip to content

chore(eslint-plugin): migrate from jest to vitest #10764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
f4463b2
Install `vitest`
aryaemami59 Jan 18, 2025
78147bf
Rename `jest.config.js` to `vitest.config.mts`
aryaemami59 Jan 18, 2025
6600c1d
chore(eslint-plugin): migrate to `vitest`
aryaemami59 Jan 18, 2025
65df4c7
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 7, 2025
34efd2c
Update snapshots
aryaemami59 Mar 7, 2025
fcd96bf
Update `vitest` to version 3.0.8
aryaemami59 Mar 7, 2025
47c4b29
Remove `vitest/no-done-callback` as it is deprecated.
aryaemami59 Mar 7, 2025
1de8578
Fix Vitest config
aryaemami59 Mar 7, 2025
5279e30
Include `vitest.config.mts` in `tsconfig.spec.json`
aryaemami59 Mar 8, 2025
5cfac51
Add `vitest.config.mts` files to ESLint configuration
aryaemami59 Mar 8, 2025
21611b0
Use `defineProject` instead of `defineConfig`
aryaemami59 Mar 10, 2025
610bc17
Simplify `workspace` and `coverage.exclude`
aryaemami59 Mar 10, 2025
169183f
Explicitly enable `resolveJsonModule`
aryaemami59 Mar 10, 2025
4000167
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 10, 2025
6c72e55
Use `.replace` instead of `.split`
aryaemami59 Mar 10, 2025
48c0b3b
Type check `vitest.config.mts` files using project references.
aryaemami59 Mar 10, 2025
198057e
Fix `@nx/vite/plugin` usage in `nx.json`
aryaemami59 Mar 10, 2025
d501c0c
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 10, 2025
663bdbc
Update `@vitest/eslint-plugin` to version 1.1.37
aryaemami59 Mar 11, 2025
0977be2
Update `outDir` of `tsconfig.spec.json`
aryaemami59 Mar 11, 2025
b6ae298
Fix Vitest config
aryaemami59 Mar 12, 2025
a5edb9c
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 12, 2025
5c2363d
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 15, 2025
85904c2
Update `vite` to version 6.2.2
aryaemami59 Mar 15, 2025
3a32ec1
Fix `typecheck` task
aryaemami59 Mar 16, 2025
7505d91
chore(tests): import `VitestSnapshotEnvironment` for snapshot handling
aryaemami59 Mar 16, 2025
9d78ce5
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 22, 2025
3850c9d
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 26, 2025
7f2373f
Update `vitest` to version 3.0.9
aryaemami59 Mar 26, 2025
abdf824
Update `@vitest/eslint-plugin` to version 1.1.38
aryaemami59 Mar 26, 2025
5f5103b
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 27, 2025
e618744
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 31, 2025
c15e443
Update `vitest` to version 3.1.1
aryaemami59 Mar 31, 2025
cfb1538
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Mar 31, 2025
a1b50fb
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 2, 2025
93fc2e2
Update `@vitest/eslint-plugin` to version 1.1.39
aryaemami59 Apr 2, 2025
b200e85
Switch to `it.for`
aryaemami59 Apr 2, 2025
f88078a
Fix `knip` config
aryaemami59 Apr 3, 2025
b1c3fa6
Update `vite` to version 6.2.5
aryaemami59 Apr 3, 2025
88d4a1b
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 5, 2025
dda6a09
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 7, 2025
50a6366
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 7, 2025
0c7b0bd
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 10, 2025
3ca6a0c
Update `vite` to version 6.2.6
aryaemami59 Apr 10, 2025
af69dd6
Update `@vitest/eslint-plugin` to version 1.1.40
aryaemami59 Apr 10, 2025
1d5fc7a
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 10, 2025
89d116a
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
f66858c
Fix `eslint-plugin` tests
aryaemami59 Apr 11, 2025
bf6c3f9
Update `@vitest/eslint-plugin` to version 1.1.42
aryaemami59 Apr 11, 2025
51c70bd
Enable the new `vitest/prefer-describe-function-title` rule
aryaemami59 Apr 11, 2025
fb78f70
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
134c851
Use `vitestPlugin.configs.env`
aryaemami59 Apr 11, 2025
930003c
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
402ef55
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
597d2f3
Merge branch 'main' of https://github.com/typescript-eslint/typescrip…
aryaemami59 Apr 11, 2025
2f5ee04
Run `ast-spec:typecheck` during `postinstall`
aryaemami59 Apr 11, 2025
172698b
Fix `ast-spec:test`
aryaemami59 Apr 11, 2025
50c68f8
Try disabling remote cache
aryaemami59 Apr 12, 2025
23291bd
Try disabling remote cache
aryaemami59 Apr 12, 2025
8b29c48
Update `typecheck` output path in `nx.json`
aryaemami59 Apr 12, 2025
d729506
Fix `vitest` coverage output when run with `nx`
aryaemami59 Apr 12, 2025
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
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const vitestFiles = [
'packages/parser/tests/lib/**/*.test.{ts,tsx,cts,mts}',
'packages/parser/tests/test-utils/**/*.{ts,tsx,cts,mts}',
'packages/utils/tests/**/*.test?(-d).{ts,tsx,cts,mts}',
'packages/eslint-plugin/tests/**/*.test.{ts,tsx,cts,mts}',
];

export default tseslint.config(
Expand Down
7 changes: 3 additions & 4 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,11 @@
"{workspaceRoot}/vitest.config.base.mts",
"{projectRoot}/vitest.config.mts"
],
"outputs": ["{options.reportsDirectory}"],
"outputs": ["{projectRoot}/coverage"],
"cache": true,
"options": {
"config": "{projectRoot}/vitest.config.mts",
"watch": false,
"reportsDirectory": "{projectRoot}/coverage"
"watch": false
}
},
"lint": {
Expand All @@ -132,7 +131,7 @@
},
"typecheck": {
"dependsOn": ["types:copy-ast-spec"],
"outputs": ["{workspaceRoot}/dist/out-tsc/{projectRoot}"],
"outputs": ["{workspaceRoot}/dist"],
"cache": true
}
},
Expand Down
3 changes: 3 additions & 0 deletions packages/ast-spec/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"dependsOn": ["typecheck"]
},
"typecheck": {
"dependsOn": ["typescript-estree:build"]
}
Expand Down
14 changes: 0 additions & 14 deletions packages/eslint-plugin/jest.config.js

This file was deleted.

14 changes: 6 additions & 8 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "tsc -b tsconfig.build.json --clean",
"postclean": "rimraf dist && rimraf coverage",
"postclean": "rimraf dist/ coverage/",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"generate:breaking-changes": "tsx tools/generate-breaking-changes.mts",
"generate:configs": "npx nx generate-configs repo",
"lint": "npx nx lint",
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --logHeapUsage",
"test-single": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --no-coverage",
"test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
"test-single": "vitest --run --config=$INIT_CWD/vitest.config.mts --no-coverage",
"check-types": "npx nx typecheck"
},
"dependencies": {
Expand All @@ -72,18 +72,15 @@
"ts-api-utils": "^2.0.1"
},
"devDependencies": {
"@jest/types": "29.6.3",
"@types/marked": "^5.0.2",
"@types/mdast": "^4.0.3",
"@types/natural-compare": "*",
"@typescript-eslint/rule-schema-to-typescript-types": "8.29.1",
"@typescript-eslint/rule-tester": "8.29.1",
"@vitest/coverage-v8": "^3.1.1",
"ajv": "^6.12.6",
"cross-env": "^7.0.3",
"cross-fetch": "*",
"eslint": "*",
"jest": "29.7.0",
"jest-specific-snapshot": "^8.0.0",
"json-schema": "*",
"markdown-table": "^3.0.3",
"marked": "^5.1.2",
Expand All @@ -95,7 +92,8 @@
"title-case": "^3.0.3",
"tsx": "*",
"typescript": "*",
"unist-util-visit": "^5.0.0"
"unist-util-visit": "^5.0.0",
"vitest": "^3.1.1"
},
"peerDependencies": {
"@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/eslint-plugin/project.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
{
"name": "eslint-plugin",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"type": "library",
"implicitDependencies": [],
"projectType": "library",
"root": "packages/eslint-plugin",
"sourceRoot": "packages/eslint-plugin/src",
"targets": {
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"]
},
"test": {
"executor": "@nx/vite:test"
},
"generate-breaking-changes": {
"executor": "nx:run-script",
"options": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading