Open gperdomor opened 1 year ago
This should not be happening. Can you provide an example repo?
This rule is simply reading from the nx graph and filtering the files based on your build target's inputs, and then collecting those dependencies. It could be that some root files use those imports and are not properly ignored in the nx.json
The same error
> NX Report complete - copy this into the issue template
Node : 20.6.1
OS : win32-x64
yarn : 1.22.19
nx : 16.8.1
@nx/js : 16.8.1
@nx/jest : 16.8.1
@nx/linter : 16.8.1
@nx/workspace : 16.8.1
@nx/angular : 16.8.1
@nx/cypress : 16.8.1
@nx/devkit : 16.8.1
@nx/eslint-plugin : 16.8.1
@nrwl/tao : 16.8.1
@nx/web : 16.8.1
@nx/webpack : 16.8.1
typescript : 5.0.4
I fixed it by changing the rule in the .eslintrc.json file for the library:
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"ignoredDependencies": ["tslib"]
}
]
}
}
this is still an issue on v17
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Let me reopen it then and we'll get to it as soon as possible. If you want to speed it up, can you please create a reproducible mini repo?
Current Behavior
Lint targets with
@nx/dependency-checks
fails with this error:Two different issues:
tslib is not directly imported in the package but tsconfig is setup with
importHelpers: true
so the builded js has things like this:const tslib_1 = require("tslib");
In a oposite way, even when my lib is not using
swc
ornx
, the nx and swc packages are marked as missing by the rule so I need to ignore them in the rule configExpected Behavior
@nx/dependency-checks
should check tsconfig files to determine if tslib should be ignored or not 🤔 ...as a workaround we can manually add ts to the
ignoredDependencies
field in eslint config but we lost the version mismatch validationsGitHub Repo
No response
Steps to Reproduce
1.
Nx Report
Failure Logs
Operating System
Additional Information
No response