Fix ignored package.json config when using the CLI #520
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reproduce
https://github.com/dersimn/issue-xo
package.json:{ "devDependencies": { "xo": "^0.36.1" }, "xo": { "space": 4, "globals": [ "myGlobalFunction" ] } }index.js:npx xocat index.js | npx xo --stdin:✖ 2:5 myGlobalFunction is not defined. no-undefspace: 4option is respected.cat index.js | npx xo --globals myGlobalFunction --stdinworksrulesare simply forwarded to eslint and all other options are parsed by XO ?This issue occurred first on update from
v0.34.2tov0.35.0.Fix
The issue seems to be the update from
"meow": "^7.1.1"to"meow": "^8.0.0".To verify place
console.log('foo', options);before line 61 in index.js and callcat index.js | npx xo --stdin:With xo
v0.34.2(using meowv7.1.1) this debug line outputs:With xo
v0.35.0(using meowv8.0.0) this debug line outputs:This is because the behavior of meow's
isMultiple(used for e.g. here) changed when fixing sindresorhus/meow#161, however XO can't deal with this yet when merging CLI options with options frompackage.json.Trace of calls:
package.jsonwith empty array from meow-CLIFixes:
Fixes #509
Fixes xojs/SublimeLinter-contrib-xo#17