Running nx lint
results in eslint error due too wrong cli flag format
#22498
Labels
nx lint
results in eslint error due too wrong cli flag format
#22498
Current Behavior
After upgrading from nx@18.0.4 to nx@18.1.2, when running
nx lint
on any project I get this error:Warning: command "eslint . --fix false" exited with non-zero status code
I have located the possible cause, introduced in this PR: feat(core): forward options for run command #22064 which was first released officially in nx@18.1.1.
I think the issue is that:
unknownOptions
are passed with a space between key and valuefalse
cli value as a glob to run the linter on instead of the value for the--fix
flagI verified this by changing the
unknownOptions
mappingFrom using a space
To using an equal sign
Also commenting out the assignment of
unknownOptions
toargs
resolves the issue.Workaround
In my repo i'm using
lint
instead of@nx/eslint:lint
astargetDefaults
and i'm setting"options": { "fix": false },
.When I use
@nx/eslint:lint
it works, when I uselint
it doesn't workExpected Behavior
Forward options for run command using
unknownOptions
does not break eslint (and potentially other cli's)GitHub Repo
https://github.com/nrwl/nx-example
Steps to Reproduce
nx.json
change thetargetDefaults
for@nx/eslint:lint
tolint
"options": { "fix": false },
to thetargetDefaults
forlint
nx lint cart
(or any other project)For some reason using the
@nx/eslint:lint
executor as targetDefault with the custom option does not generate an error, but usinglint
as targetDefault does.Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: