-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(linter): create-package-json should omit non-npm and ignored packages #17883
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -45,7 +45,7 @@ export default createESLintRule<Options, MessageIds>({ | |||
type: 'object', | |||
properties: { | |||
buildTargets: [{ type: 'string' }], | |||
ignoreDependencies: [{ type: 'string' }], | |||
ignoredDependencies: [{ type: 'string' }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optionally, instead of adding another param, we can expose peer dependencies as a nested structure under parent dependency, so that source function (e.g. linter rule) can easily discard all peer dependencies of the ignored packages.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 05740d1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
@@ -181,6 +181,7 @@ export function findProjectsNpmDependencies( | |||
target: string, | |||
options: { | |||
helperDependencies?: string[]; | |||
ignoredDependencies?: string[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to delete this after the fact...
I also do not like the fact that helperDependencies
is here.
const ignoredDependencies = ['react'];
const packageJson = createPackageJson(...);
for (const ignoredDep of ignoredDependencies) {
delete packageJson.dependencies[ignoredDep];
delete packageJson.devDependencies[ignoredDep];
delete packageJson.peerDependencies[ignoredDep];
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, it wouldn't work for transitive dependencies. I guess this is fine.
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
This PR fixes several issues that are blocking adoption of the
dependency-checks
rule:ignoredDependencies
createPackageJson
if project contains also non-JS code likenx
package does)Related Issue(s)
Fixes #