Skip to content

chore: fix issues introduced by updated nx configuration #11230

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 0 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,5 @@ CHANGELOG.md
packages/website/.docusaurus
packages/website/build

# see the file header in eslint-base.test.js for more info
packages/rule-tester/tests/eslint-base

/.nx/cache
/.nx/workspace-data
2 changes: 0 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ export default tseslint.config(
'packages/types/src/generated/**/*.ts',
// Playground types downloaded from the web
'packages/website/src/vendor/',
// see the file header in eslint-base.test.js for more info
'packages/rule-tester/tests/eslint-base/',
],
name: 'global-ignores',
},
Expand Down
42 changes: 28 additions & 14 deletions knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,40 @@ export default {
],
},
},

'packages/eslint-plugin': {
entry: ['tools/**'],
ignore: [
'tests/fixtures/**',
'typings/eslint-rules.d.ts',
'typings/typescript.d.ts',
],
ignoreDependencies: ['tsx'], // used in nx target definitions
ignore: ['typings/eslint-rules.d.ts', 'typings/typescript.d.ts'],

project: ['src/**/*.ts!', 'tools/**/*.mts'],

vitest: {
config: ['vitest.config.mts'],
entry: ['tests/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
project: ['tests/**', '!tests/fixtures/**'],
},
},

'packages/eslint-plugin-internal': {
ignore: ['tests/fixtures/**'],
},
'packages/integration-tests': {
ignore: ['fixtures/**'],
},
'packages/parser': {
ignore: ['tests/fixtures/**'],

'packages/parser': {
vitest: {
config: ['vitest.config.mts'],
entry: ['tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
entry: [
'tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)',
'tests/test-utils/test-utils.ts',
'tests/test-utils/ts-error-serializer.ts',
],
project: ['tests/**', '!tests/fixtures/**'],
},
},

'packages/rule-tester': {
ignore: ['typings/eslint.d.ts'],

mocha: {
entry: ['tests/eslint-base/eslint-base.test.js'],
},
},
'packages/scope-manager': {
ignore: ['tests/fixtures/**'],
Expand All @@ -109,6 +114,15 @@ export default {
],
},
},

'packages/types': {
project: [
'src/**/*.ts!',
'!src/generated/**/*.ts',
'tools/copy-ast-spec.mts',
],
},

'packages/typescript-estree': {
entry: ['src/use-at-your-own-risk.ts'],
ignore: ['tests/fixtures/**', 'typings/typescript.d.ts'],
Expand Down
23 changes: 15 additions & 8 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@
"plugin": "@nx/vite/plugin",
"exclude": ["*"],
"options": {
"testTargetName": "test"
}
},
{
"plugin": "@nx/eslint/plugin",
"include": ["packages/*"],
"options": {
"targetName": "lint"
"testTargetName": "test",
"typecheckTargetName": "vite:typecheck"
}
}
],
Expand All @@ -51,7 +45,20 @@
}
},
"targetDefaults": {
"lint": {
"cache": false,
"dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"],
"options": {
"cwd": "{workspaceRoot}",
"config": "{workspaceRoot}/eslint.config.mjs",
"args": ["{projectRoot}"]
}
},
"test": {
"dependsOn": ["^build"],
"options": {
"config": "vitest.config.mts"
},
"outputs": ["{projectRoot}/coverage"]
}
},
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.26.0",
"@nx/devkit": "21.0.3",
"@nx/eslint": "21.0.3",
"@nx/js": "21.0.3",
"@nx/vite": "21.0.3",
"@nx/workspace": "21.0.3",
Expand Down Expand Up @@ -153,11 +152,11 @@
"cache": true
},
"lint": {
"command": "eslint . --ignore-pattern=packages --cache",
"dependsOn": [
"typescript-eslint:build",
"eslint-plugin-internal:build"
],
"command": "eslint",
"options": {
"cache": true,
"ignore-pattern": "packages"
},
"cache": false
},
"clean": {
Expand Down
8 changes: 7 additions & 1 deletion packages/ast-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"",
Expand Down Expand Up @@ -81,7 +80,14 @@
],
"cache": true
},
"lint": {
"command": "eslint"
},
"typecheck": {
"outputs": [
"{workspaceRoot}/dist",
"{projectRoot}/dist"
],
"dependsOn": [
"typescript-estree:build"
]
Expand Down
5 changes: 5 additions & 0 deletions packages/ast-spec/vitest.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const vitestConfig = mergeConfig(
'./tests/util/setupVitest.mts',
'./tests/util/custom-matchers/custom-matchers.ts',
],

typecheck: {
enabled: true,
tsconfig: path.join(import.meta.dirname, 'tsconfig.spec.json'),
},
},
}),
);
Expand Down
9 changes: 7 additions & 2 deletions packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"format": "yarn run -T format",
Expand All @@ -32,13 +31,19 @@
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
"eslint": "*",
"rimraf": "*",
"vitest": "^3.1.3"
},
"nx": {
"name": "eslint-plugin-internal",
"includedScripts": [
"clean"
]
],
"targets": {
"lint": {
"command": "eslint"
}
}
}
}
6 changes: 4 additions & 2 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@
"typescript"
],
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"format": "yarn run -T format",
"generate-breaking-changes": "yarn run -BT nx generate-breaking-changes",
"generate-configs": "yarn run -T generate-configs",
"generate-configs": "yarn run -BT nx generate-configs repo",
"lint": "yarn run -BT nx lint",
"test": "yarn run -BT nx test",
"typecheck": "yarn run -BT nx typecheck"
Expand Down Expand Up @@ -115,6 +114,9 @@
"dependsOn": [
"type-utils:build"
]
},
"lint": {
"command": "eslint"
}
}
}
Expand Down
19 changes: 17 additions & 2 deletions packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,33 @@
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"format": "yarn run -T format",
"lint": "yarn run -BT nx lint",
"test": "yarn run -BT nx test",
"typecheck": "yarn run -BT nx typecheck"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
"eslint": "*",
"vitest": "^3.1.3"
},
"nx": {
"name": "integration-tests",
"includedScripts": []
"includedScripts": [],
"targets": {
"test": {
"dependsOn": [
{
"projects": [
"tag:npm:public"
],
"target": "build"
}
]
},
"lint": {
"command": "eslint"
}
}
}
}
9 changes: 7 additions & 2 deletions packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"eslint"
],
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"format": "yarn run -T format",
Expand All @@ -60,6 +59,7 @@
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
"eslint": "*",
"glob": "*",
"rimraf": "*",
"typescript": "*",
Expand All @@ -73,6 +73,11 @@
"name": "parser",
"includedScripts": [
"clean"
]
],
"targets": {
"lint": {
"command": "eslint"
}
}
}
}
9 changes: 7 additions & 2 deletions packages/rule-schema-to-typescript-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"format": "yarn run -T format",
Expand All @@ -40,6 +39,7 @@
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
"eslint": "*",
"rimraf": "*",
"typescript": "*",
"vitest": "^3.1.3"
Expand All @@ -52,6 +52,11 @@
"name": "rule-schema-to-typescript-types",
"includedScripts": [
"clean"
]
],
"targets": {
"lint": {
"command": "eslint"
}
}
}
}
8 changes: 6 additions & 2 deletions packages/rule-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"estree"
],
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"format": "yarn run -T format",
Expand Down Expand Up @@ -76,6 +75,11 @@
"name": "rule-tester",
"includedScripts": [
"clean"
]
],
"targets": {
"lint": {
"command": "eslint"
}
}
}
}
3 changes: 1 addition & 2 deletions packages/rule-tester/vitest.config.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from 'node:path';
import { defaultExclude, defineProject, mergeConfig } from 'vitest/config';
import { defineProject, mergeConfig } from 'vitest/config';

import { vitestBaseConfig } from '../../vitest.config.base.mjs';
import packageJson from './package.json' with { type: 'json' };
Expand Down Expand Up @@ -61,7 +61,6 @@ const vitestConfig = mergeConfig(

test: {
dir: path.join(import.meta.dirname, 'tests'),
exclude: [...defaultExclude, 'eslint-base/eslint-base.test.js'],
name: packageJson.name.replace('@typescript-eslint/', ''),
root: import.meta.dirname,
},
Expand Down
9 changes: 7 additions & 2 deletions packages/scope-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"estree"
],
"scripts": {
"//": "These package scripts are mostly here for convenience. Task running is handled by Nx at the root level.",
"build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"",
Expand All @@ -55,6 +54,7 @@
"@typescript-eslint/typescript-estree": "8.33.1",
"@vitest/coverage-v8": "^3.1.3",
"@vitest/pretty-format": "^3.1.3",
"eslint": "*",
"glob": "*",
"rimraf": "*",
"typescript": "*",
Expand All @@ -69,6 +69,11 @@
"includedScripts": [
"clean",
"clean-fixtures"
]
],
"targets": {
"lint": {
"command": "eslint"
}
}
}
}
Loading
Loading