Skip to content

chore: remove jest leftovers #11078

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

Merged
merged 3 commits into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
75 changes: 3 additions & 72 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal';
import vitestPlugin from '@vitest/eslint-plugin';
import eslintPluginPlugin from 'eslint-plugin-eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import jestPlugin from 'eslint-plugin-jest';
import jsdocPlugin from 'eslint-plugin-jsdoc';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import perfectionistPlugin from 'eslint-plugin-perfectionist';
Expand All @@ -29,28 +28,6 @@ const restrictNamedDeclarations = {
selector: 'ExportNamedDeclaration[declaration=null][source=null]',
};

const vitestFiles = [
'packages/ast-spec/tests/**/*.test?(-d).{ts,tsx,cts,mts}',
'packages/ast-spec/tests/util/setupVitest.mts',
'packages/eslint-plugin-internal/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/eslint-plugin/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/integration-tests/tests/**/*.test.{ts,tsx,cts,mts},',
'packages/integration-tests/tools/integration-test-base.ts',
'packages/integration-tests/tools/pack-packages.ts',
'packages/parser/tests/lib/**/*.test.{ts,tsx,cts,mts}',
'packages/parser/tests/test-utils/**/*.{ts,tsx,cts,mts}',
'packages/rule-schema-to-typescript-types/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/rule-tester/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/scope-manager/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/scope-manager/tests/test-utils/serializers/index.ts',
'packages/type-utils/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/types/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/typescript-eslint/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/typescript-estree/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/utils/tests/**/*.test?(-d).{ts,tsx,cts,mts}',
'packages/visitor-keys/tests/**/*.test.{ts,tsx,cts,mts}',
];

export default tseslint.config(
// register all of the plugins up-front
{
Expand All @@ -61,7 +38,6 @@ export default tseslint.config(
['@typescript-eslint/internal']: tseslintInternalPlugin,
['eslint-plugin']: eslintPluginPlugin,
['import']: importPlugin,
['jest']: jestPlugin,
['jsdoc']: jsdocPlugin,
// @ts-expect-error -- https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/1038
['jsx-a11y']: jsxA11yPlugin.flatConfigs.recommended.plugins['jsx-a11y'],
Expand Down Expand Up @@ -89,7 +65,6 @@ export default tseslint.config(
ignores: [
'.nx/',
'.yarn/',
'**/jest.config.js',
'**/vitest.config.mts',
'**/node_modules/**',
'**/dist/**',
Expand Down Expand Up @@ -383,57 +358,13 @@ export default tseslint.config(
// test file linting
//

// define the jest globals for all test files
{
files: ['packages/*/tests/**/*.{ts,tsx,cts,mts}'],
ignores: vitestFiles,
languageOptions: {
globals: {
...jestPlugin.environments.globals.globals,
},
},
},
// define the vitest globals for all test files
{
files: vitestFiles,
...vitestPlugin.configs.env,
},
// test file specific configuration
{
files: [
'packages/*/tests/**/*.test.{ts,tsx,cts,mts}',
'packages/*/tests/**/test.{ts,tsx,cts,mts}',
'packages/*/tests/**/*.{ts,tsx,cts,mts}',
'packages/integration-tests/tools/**/*.ts',
],
ignores: vitestFiles,
rules: {
'@typescript-eslint/no-empty-function': [
'error',
{ allow: ['arrowFunctions'] },
],
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'jest/no-alias-methods': 'error',
'jest/no-deprecated-functions': 'error',
'jest/no-disabled-tests': 'error',
'jest/no-done-callback': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/no-jasmine-globals': 'error',
'jest/no-test-prefixes': 'error',
'jest/no-test-return-statement': 'error',
'jest/prefer-spy-on': 'error',
'jest/prefer-to-be': 'error',
'jest/prefer-to-contain': 'error',
'jest/prefer-to-have-length': 'error',
'jest/valid-expect': 'error',
},
},
// test file specific configuration
{
files: vitestFiles,
...vitestPlugin.configs.env,
rules: {
'@typescript-eslint/no-empty-function': [
'error',
Expand Down
44 changes: 0 additions & 44 deletions jest.config.base.js

This file was deleted.

9 changes: 0 additions & 9 deletions jest.config.js

This file was deleted.

7 changes: 1 addition & 6 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ export default {
workspaces: {
'.': {
entry: ['tools/release/changelog-renderer.js', 'tools/scripts/**/*.mts'],
ignore: [
'jest.config.base.js',
'tools/scripts/typings/typescript.d.ts',
'typings/*.d.ts',
],
ignore: ['tools/scripts/typings/typescript.d.ts', 'typings/*.d.ts'],
ignoreDependencies: [
'@babel/code-frame',
'@babel/core',
Expand All @@ -36,7 +32,6 @@ export default {
'@nx/js',
'@nx/workspace',
'glob',
'jest-specific-snapshot',
'make-dir',
// imported for type purposes only
'website',
Expand Down
29 changes: 0 additions & 29 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@
"buildDepsTargetName": "vite:build-deps",
"watchDepsTargetName": "vite:watch-deps"
}
},
{
"plugin": "@nx/jest/plugin",
"include": ["packages/*"],
"options": {
"targetName": "test"
}
}
],
"release": {
Expand Down Expand Up @@ -73,27 +66,6 @@
"outputs": ["{projectRoot}/coverage"],
"cache": true
},
"@nx/jest:jest": {
"dependsOn": ["^build"],
"inputs": [
"default",
"^production",
"{workspaceRoot}/jest.config.js",
"{workspaceRoot}/jest.config.base.js"
],
"outputs": ["{projectRoot}/coverage"],
"cache": true,
"options": {
"jestConfig": "{projectRoot}/jest.config.js",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"@nx/vite:test": {
"dependsOn": ["^build"],
"inputs": [
Expand Down Expand Up @@ -154,7 +126,6 @@
"default",
"!{projectRoot}/**/?(*.)+(test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/vitest.config.m[jt]s",
"!{projectRoot}/src/test-setup.[jt]s"
]
Expand Down
12 changes: 0 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@jest/types": "29.6.3",
"@nx/devkit": "20.7.2",
"@nx/eslint": "20.7.2",
"@nx/jest": "20.7.2",
"@nx/vite": "20.7.2",
"@nx/workspace": "20.7.2",
"@swc/core": "^1.4.12",
Expand All @@ -74,7 +72,6 @@
"@types/debug": "^4.1.12",
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
"@types/is-glob": "^4.0.4",
"@types/jest": "29.5.13",
"@types/natural-compare": "^1.4.3",
"@types/node": "^20.12.5",
"@types/semver": "^7.5.8",
Expand All @@ -93,7 +90,6 @@
"eslint": "^9.15.0",
"eslint-plugin-eslint-plugin": "^6.3.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.9.0",
"eslint-plugin-jsdoc": "^50.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-perfectionist": "^3.9.1",
Expand All @@ -105,8 +101,6 @@
"glob": "^10.3.12",
"globals": "^15.0.0",
"husky": "^9.1.4",
"jest": "29.7.0",
"jest-specific-snapshot": "^8.0.0",
"jiti": "2.4.2",
"knip": "^5.41.1",
"lint-staged": "^15.2.2",
Expand All @@ -125,18 +119,12 @@
"yargs": "17.7.2"
},
"resolutions": {
"@jest/create-cache-key-function": "^29",
"@jest/reporters": "^29",
"@jest/test-result": "^29",
"@types/eslint-scope": "link:./tools/dummypkg",
"@types/eslint": "link:./tools/dummypkg",
"@types/estree": "link:./tools/dummypkg",
"@types/node": "^20.0.0",
"@types/react": "^18.2.14",
"eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch",
"jest-config": "^29",
"jest-resolve": "^29",
"jest-util": "^29",
"prettier": "3.5.0",
"pretty-format": "^29",
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc/packages/eslint-plugin/jest",
"outDir": "../../dist/out-tsc/packages/eslint-plugin",
"module": "NodeNext",
"resolveJsonModule": true,
"types": ["node", "vitest/globals", "vitest/importMeta"]
Expand Down
1 change: 0 additions & 1 deletion packages/scope-manager/tests/test-utils/getSpecificNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ export function getSpecificNode(

// should have found at least one node
expect(node).not.toBeFalsy();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return node!;
}
2 changes: 1 addition & 1 deletion packages/website-eslint/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"checkJs": true
},
"include": ["src/**/*.ts", "src/index.js", "types", "build.mts"],
"exclude": ["jest.config.js", "src/**/*.spec.ts", "src/**/*.test.ts"],
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"],
"references": [
{
"path": "../visitor-keys/tsconfig.build.json"
Expand Down
3 changes: 0 additions & 3 deletions tsconfig.repo-config-files.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"eslint.config.mjs",
"vitest.config.base.mts",
"vitest.config.mts",
"jest.config.base.js",
"jest.config.js",
"jest.preset.js",
"knip.ts",
".github/**/*.js"
],
Expand Down
Loading