-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(dlx): don't report UNUSED_PACKAGE_EXTENSION
warnings
#4583
fix(dlx): don't report UNUSED_PACKAGE_EXTENSION
warnings
#4583
Conversation
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.
There is a config created on the following line when there is no .yarnrc.yml
in the Project
which should also be updated.
await xfs.writeFilePromise(targetYarnrc, `enableGlobalCache: ${enableGlobalCache}\nenableTelemetry: false\n`); |
(You can also change that to a
xfs.writeJsonPromise
)
Thanks, completely forgot about that one. I've also taken this opportunity to create a better merge function in |
@@ -207,7 +206,7 @@ export default class InitCommand extends BaseCommand { | |||
}, | |||
}; | |||
|
|||
merge(editorConfigProperties, configuration.get(`initEditorConfig`)); | |||
miscUtils.mergeIntoTarget(editorConfigProperties, configuration.get(`initEditorConfig`)); |
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.
Why do we need these utils? Does the yaml stringifier supports serializing the comments?
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.
lodash
's merge
doesn't merge arrays, it just overwrites them, so when merging the dlxConfiguration
with the project configuration it doesn't merge the logFilters of the two configurations.
Because of this, I needed to implement a util that does merge arrays using lodash
's mergeWith
, but I realized that we already have a function that does the same thing - the one in sdkUtils
that merges our new settings with the .vscode
files and preserves CJSON
comments.
Because I didn't want to duplicate code, I extracted that one to miscUtils
and added more tests and replaced all existing usages of lodash merge
/ mergeWith
for consistency.
Does the yaml stringifier supports serializing the comments?
Nope.
What's the problem this PR addresses?
yarn dlx
reportsUNUSED_PACKAGE_EXTENSION
warnings when an extension is unused in the temporary project created by dlx, even if it is used in the actual project the command is run in.How did you fix it?
Made
dlx
filter out allUNUSED_PACKAGE_EXTENSION
warnings vialogFilters
since they should only be about the main project.Checklist