44 Commits

Author SHA1 Message Date
Miroslav Jonaš
7f8bb4ba1f
fix(linter): dependency checks should respect pnpm workspace versions (#26709)
<!-- 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
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #26707
2024-06-27 17:19:35 +02:00
Leosvel Pérez Espinosa
ffea1d5c6d
fix(linter): handle paths correctly in enforce-module-boundaries eslint rule (#26373)
<!-- 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` -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #21889
2024-06-05 12:38:21 +02:00
James Henry
ef0dc01ffa
fix(core): multi module handling and fall back matching for external nodes (#26277)
<!-- 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` -->

## Current Behavior
<!-- This is the behavior we have today -->

- Packages such as `minimatch` which block access to their
`package.json` AND have multi module format outputs are missed by the
target project locator
- There is no fall back matching of external nodes from the graph by
name

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

- The target project locator appropriately finds modules such as
`minimatch`
- There is fall back matching of external nodes from the graph by name

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2024-05-31 01:06:58 +04:00
James Henry
7001e350af
fix(core): prefer project specific external deps (#23307)
<!-- 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` -->

## Current Behavior
<!-- This is the behavior we have today -->

We only ever discover one version of an external dependency for the
file-map.json. This means the `@nx/dependency-checks` lint rule can
produce incorrect failures when multiple copies of a dependency exist
within a workspace.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

In the file-map.json the project specific version of a package (if
multiple exist) is preferred and therefore the lint rule produces
accurate results.

---

For example, in a repo where the root package.json has lodash@4.0.0
(which becomes `npm:lodash` on graph) and the foo project has
lodash@3.0.0:

**Before**


![image](https://github.com/nrwl/nx/assets/900523/fa0b3711-5004-4abc-9904-0433a37bc3cf)

**After**


![image](https://github.com/nrwl/nx/assets/900523/d0527368-44b4-486f-aa7a-79d996a20ef4)

## Performance

`NX_ISOLATE_PLUGINS=true NX_PERF_LOGGING=true NX_DAEMON=false nx show
project nx --json false`


** Before **

Time for 'build typescript dependencies' 505.52144700009376

** After **

Time for 'build typescript dependencies' 701.247584999539
2024-05-30 10:23:47 -04:00
James Henry
8cfc0a0c08
fix(linter): support eslint v9 (#24632) 2024-05-22 19:27:06 +04:00
Jack Hsu
bc43243498
chore(repo): add eslint and jest plugins to use inferred targets (#22946) 2024-04-23 21:52:13 -04:00
Leosvel Pérez Espinosa
4850bdb6aa fix(nx-plugin): support root tsconfig.json in nx-plugin-checks eslint rule 2024-03-11 16:43:02 +01:00
Miroslav Jonaš
ce933132d0
cleanup(linter): refactor code for dynamic/static imports check (#20897) 2024-02-25 20:59:51 +04:00
Jack Hsu
f6d2dccd62
feat(linter): add option for @nx/dependency-checks to update workspace dependencies using local file paths (#20157)
Co-authored-by: Miroslav Jonaš <missing.manual@gmail.com>
2024-02-02 14:51:49 +02:00
Miroslav Jonaš
c452a1f7c5
fix(linter): add links to docs to rules (#21199) 2024-01-18 14:47:10 +01:00
Miroslav Jonaš
3981c90fe8
fix(linter): ensure angular entry point checks are correct (#20859) 2023-12-20 18:16:58 +01:00
Miroslav Jonaš
7e5c4598a3
fix(linter): do not allow relative import of non-project files (#20563) 2023-12-05 16:33:14 +01:00
Miroslav Jonaš
98883bba7a
fix(linter): fix missing dependencies fixer reducer (#20410) 2023-11-25 23:45:46 +01:00
Miroslav Jonaš
630e750c06
cleanup(linter): remove unused imports (#20053) 2023-11-08 16:15:41 +04:00
Miroslav Jonaš
79c9233553
feat(linter): update typescript-eslint to v6 (#19548)
Co-authored-by: FrozenPandaz <jasonjean1993@gmail.com>
Co-authored-by: Jack Hsu <jack.hsu@gmail.com>
2023-11-02 10:09:40 +01:00
Miroslav Jonaš
e49ce56977
fix(linter): fix validateDependenciesSectionExistance fixer (#19512) 2023-10-09 23:04:53 +02:00
Craigory Coppola
6946f65059
fix(misc): pass full path to tsconfig when registering transpiler (#19451) 2023-10-06 14:40:15 -04:00
Craigory Coppola
6c37113fc4
fix(linter): add schema for nx plugin checks rule (#19447) 2023-10-04 13:59:13 -04:00
Miroslav Jonaš
bf7e663168
feat(linter): add app import exception for remotes (#19301) 2023-09-28 00:25:11 +00:00
Miroslav Jonaš
e650ccff68
fix(linter): fix rule typings (#19294) 2023-09-27 15:06:15 -04:00
Craigory Coppola
f213976281
feat(core): include non-project files on fileMap and filesToProcess (#19217) 2023-09-19 21:46:01 -04:00
Miroslav Jonaš
d87826eea2
docs(linter): add missing properties to the dep-checks docs (#19125) 2023-09-15 11:53:31 +03:00
Craigory Coppola
de2824a450
feat(devkit): add method for tree-aware glob search (#19128) 2023-09-13 17:39:45 -04:00
Miroslav Jonaš
2bc7031017
fix(linter): fix dep-checks projPackageJsonDeps caching for IDE (#18935) 2023-09-06 10:19:50 +02:00
Jack Hsu
90ca436d81
feat(linter): add option to ignore files based on pattern (#18863) 2023-08-28 16:27:14 -04:00
Jack Hsu
9ffea2bb1b
fix(linter): error on dependencies that are only in devDependencies instead of production dependencies (#18780) 2023-08-22 23:05:53 +02:00
Miroslav Jonaš
35656432e6
fix(linter): fix messages on deps checks (#18484) 2023-08-04 10:08:41 -04:00
Igor Loskutov
9c7ded0b1a
feat(linter): support path wildcards in enforce-module-boundaries autofix (#18316) 2023-07-31 16:18:00 +02:00
Jack Hsu
eb392109f7
fix(linter): do not report obsolete devDependencies since they are not used in production files (#18353) 2023-07-28 09:05:39 +02:00
Colum Ferry
b5b75332e4
fix(core): eslint dep check rule should check prereleases correctly (#18317) 2023-07-27 12:15:26 +00:00
Jack Hsu
ae773d547e
fix(linter): skip verifying deps of deps by default in package.json (#18058) 2023-07-12 20:59:36 -04:00
Miroslav Jonaš
28a071f243
fix(js): ignore dependencies from non-index root files for create-package-json (#17930) 2023-07-05 17:47:49 +02:00
Miroslav Jonaš
55c0a168cf
fix(linter): apply missing deps fix in a single patch for deps check (#17924) 2023-07-03 16:29:15 +02:00
Miroslav Jonaš
a70e1a8bc0
fix(linter): ensure no trailing commas on deps-check obsolete package fix (#17915) 2023-07-03 14:42:02 +02:00
Miroslav Jonaš
6b82a2ff59
feat(linter): allow banning of deep/secondary paths (#17755) 2023-07-03 14:41:45 +02:00
Miroslav Jonaš
3d77b4d40e
fix(linter): create-package-json should omit non-npm and ignored packages (#17883) 2023-06-30 16:00:45 -04:00
Eric Yancey Dauenhauer
576262bb03
feat(linter): allow globs in onlyDependOnLibsWithTags eslint-plugin configuration option (#17530)
Co-authored-by: Miroslav Jonas <missing.manual@gmail.com>
2023-06-30 21:17:12 +02:00
Miroslav Jonaš
ef8c4ed095
feat(linter): add rule for dependency checking (#17581) 2023-06-23 10:26:44 -04:00
Miloš Lajtman
ef5813a7b7
fix(linter): improve error message for forbidden imports of lazy-loaded libs (#17635)
Co-authored-by: Miroslav Jonas <missing.manual@gmail.com>
2023-06-19 17:33:15 +02:00
Victor Savkin
0848031dd9 feat(core): move task hashing into daemon 2023-05-17 11:37:57 -04:00
Isaac Mann
881067bbd2
fix(linter): import from .tsx file lint fix now works correctly (#16995) 2023-05-13 15:53:44 -04:00
Miroslav Jonaš
e328bfa90a
feat(linter): support custom build targets for buildability check (#16743) 2023-05-04 13:13:38 +02:00
Miroslav Jonaš
d47df3d676
fix(linter): ensure target project locator is using stale graph in IDE (#16534) 2023-04-25 23:50:12 +02:00
Jason Jean
739b4c2924
feat(linter): rename @nx/eslint-plugin-nx to @nx/eslint-plugin (#16420) 2023-04-20 13:25:56 -04:00