Closed richard-ling closed 6 months ago
Similar use case when lint
targets just need to call eslint
and stylelint
, want to be able to pass the --fix
argument:
lint: {
inputs: [...inputsIgnore],
dependsOn: [
// To pass `--fix`
{ project: 'self', target: 'eslint', params: 'forward' },
{ project: 'self', target: 'stylelint', params: 'forward' }
],
},
eslint: {
executor: 'nx:run-commands',
options: {
command: 'FIX={args.fix}; echo eslint --fix=${FIX:-false}',
},
},
stylelint: {
executor: 'nx:run-commands',
options: {
command: 'FIX={args.fix}; echo stylelint --fix=${FIX:-false}',
},
},
nx run web:eslint --fix
and
nx run web:stylelint --fix
both work
but nx run web:lint --fix
will complain 'fix' is not found in schema
This was fixed with https://github.com/nrwl/nx/commit/8a0707df86217f8ec1aa94b529ac9f2eeb136e15 :tada:
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.
Current Behavior
We sometimes use
nx:noop
executor where a target doesn't make sense for a particular package. For example, in adocs
package which contains no code, thetest
target usesnx:noop
executor. All other packages use@nrwl/jest:jest
.However if we do
nx affected --target=test --base=master --onlyChanged
, anddocs
is affected, it will runnx test docs --onlyChanged
and the noop executor will fail the task with this message:This is because the schema for noop executor doesn't accept any arguments, but it makes the above use case impossible.
Expected Behavior
The
nx:noop
executor should ignore the arguments and the task should succeed.GitHub Repo
https://github.com/nrwl/nx-examples
Steps to Reproduce
Should be self-explanatory.
Nx Report
Failure Logs
No response
Operating System
Additional Information
Are we misusing
nx:noop
here? This seems like a perfect use-case for it - we can't imagine any other use for it.