15 Commits

Author SHA1 Message Date
Miroslav Jonaš
cd55dfcb3e
feat(linter): add support for package based secondary entry points (#30809)
This PR adds support for package.json based secondary entry points and
implements fix for situation when package imports base entry point as
dynamic dependency and secondary entry point as static dependency.

## Current Behavior
When the package is imported from itself, check for a secondary entry
point checks only Angular-style secondary entry points.

When package is importing from the same library as dynamic import from
root and static import from secondary entry point we still get linter
errror.

## Expected Behavior
Check for secondary entry points should also support standard
package.json-based entry points.

Importing from the same library as dynamic import from root and static
import from secondary entry point should be allowed.

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

Fixes #18552
2025-04-25 14:31:33 +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
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
Miroslav Jonaš
ce933132d0
cleanup(linter): refactor code for dynamic/static imports check (#20897) 2024-02-25 20:59:51 +04:00
Miroslav Jonaš
f79aabba46
fix(linter): adjust terminal run check for crystal (#21638) 2024-02-06 15:32:54 +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š
bf7e663168
feat(linter): add app import exception for remotes (#19301) 2023-09-28 00:25:11 +00:00
jogelin
1f9b3c4a5c
fix(linter): Normalize paths when in getSourceFilePath (#18601)
Co-authored-by: jgelin <jgelin@seligent.com>
2023-08-17 11:28:52 +02:00
Miroslav Jonaš
6b82a2ff59
feat(linter): allow banning of deep/secondary paths (#17755) 2023-07-03 14:41:45 +02: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š
a21ab98ca8
fix(linter): fix relative path detection (#17592) 2023-06-14 12:18:44 -04:00
Victor Savkin
0848031dd9 feat(core): move task hashing into daemon 2023-05-17 11:37:57 -04:00
Miroslav Jonaš
e328bfa90a
feat(linter): support custom build targets for buildability check (#16743) 2023-05-04 13:13:38 +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