Skip to content

Commit 0452910

Browse files
authored
fix(vite): add tslib as a dep for @nx/vite and remove @swc/helpers (#32341)
When we switched to the TS solution setup with inferred `tsc` builds, we didn't update the dependencies for `@nx/vite` to use `tslib` instead of `@swc/helpers`. It was previously using `@nx/js:swc` executor, but now `build-base` target is inferred as `tsc -b`. It did not cause issues since other packages including `nx` always install tslib, but technically it is incorrect, and we were ignoring the errors by adding `tslib` and `@swc/helpers` to be ignored in `.eslintrc.json`. This PR also cleans up the eslint config for all other packages since we do not need to ignore `tslib` for `@nx/dependency-checks` to pass. <!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior `@nx/vite` is missing `tslib` dependency even though the built JS file uses it. ## Expected Behavior Should have `tslib` as a dependency and not `@swc/helpers`. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
1 parent 48807b6 commit 0452910

File tree

38 files changed

+15
-42
lines changed

38 files changed

+15
-42
lines changed

packages/angular-rspack-compiler/.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@nx/dependency-checks": [
3838
"error",
3939
{
40+
"buildTargets": ["build-base"],
4041
"ignoredFiles": [
4142
"{projectRoot}/.eslintrc.json",
4243
"{projectRoot}/vite.config.{js,ts,mjs,mts}"
@@ -45,8 +46,7 @@
4546
"@angular/core",
4647
"jsonc-eslint-parser",
4748
"vitest",
48-
"memfs",
49-
"tslib"
49+
"memfs"
5050
]
5151
}
5252
]

packages/angular-rspack/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@nx/dependency-checks": [
3838
"error",
3939
{
40+
"buildTargets": ["build-base"],
4041
"ignoredFiles": [
4142
"{projectRoot}/.eslintrc.json",
4243
"{projectRoot}/vite.config.{js,ts,mjs,mts}"
@@ -46,7 +47,6 @@
4647
"jsonc-eslint-parser",
4748
"vitest",
4849
"memfs",
49-
"tslib",
5050
// it's only a type import, so it won't be required at runtime
5151
"sass",
5252
// shown as unused because it's required using `createRequire`

packages/angular/.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
{
5252
"buildTargets": ["build-base"],
5353
"ignoredDependencies": [
54-
"tslib",
5554
"@angular-devkit/architect",
5655
"@angular-devkit/schematics",
5756
"@nx/cypress",

packages/create-nx-plugin/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"error",
4242
{
4343
"buildTargets": ["build-base"],
44-
"ignoredDependencies": ["tslib"]
44+
"ignoredDependencies": []
4545
}
4646
]
4747
}

packages/create-nx-workspace/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"error",
3434
{
3535
"buildTargets": ["build-base"],
36-
"ignoredDependencies": ["tslib"]
36+
"ignoredDependencies": []
3737
}
3838
]
3939
}

packages/cypress/.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
{
3535
"buildTargets": ["build-base"],
3636
"ignoredDependencies": [
37-
"tslib",
3837
"nx",
3938
"typescript",
4039
// Type imports only

packages/detox/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"error",
2424
{
2525
"buildTargets": ["build-base"],
26-
"ignoredDependencies": ["nx", "tslib", "typescript", "detox"]
26+
"ignoredDependencies": ["nx", "typescript", "detox"]
2727
}
2828
]
2929
}

packages/devkit/.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"nx",
7070
"typescript",
7171
"prettier",
72-
"tslib",
7372
// Installed to workspace by plugins
7473
"rxjs",
7574
"@angular-devkit/core",

packages/esbuild/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"error",
4646
{
4747
"buildTargets": ["build-base"],
48-
"ignoredDependencies": ["nx", "tslib", "typescript", "esbuild"]
48+
"ignoredDependencies": ["nx", "typescript", "esbuild"]
4949
}
5050
]
5151
}

packages/eslint-plugin/.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
{
3333
"buildTargets": ["build-base"],
3434
"ignoredDependencies": [
35-
"tslib",
3635
"nx",
3736
"typescript",
3837
// Installed to workspace by plugins

0 commit comments

Comments
 (0)