XO Documentation on overrides misleading
See original GitHub issueThe docs show this structure:
{
"xo": {
"semicolon": false,
"space": 2,
"overrides": [
{
"files": "test/*.js",
"esnext": false,
"space": 3
},
{
"files": "test/foo.js",
"esnext": true
}
]
}
}
But no matter how I formatted things, it never worked until I used this structure, with the “rules” property specified:
{
"xo": {
"semicolon": false,
"space": 2,
"overrides": [
{
"files": "test/*.js",
"rules": {
"esnext": false,
"space": 3
}
},
{
"files": "test/foo.js",
"rules": {
"esnext": true
}
}
]
}
}
I think the docs need to be updated to reflect that
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Overrides not working when calling xo with absolute paths #223
I have this in my package.json: "xo": { "extends": "xo-react", "parser": "babel-eslint", "plugins": ["react"], "envs": ["node", "browser"], ...
Read more >eslint-config-xo-overrides - npm
Overrides ; Trailing commas in multiline objects and arrays. This makes diffs simpler. · const f fizz ; Space around object and array...
Read more >XO COMMUNICATIONS SERVICES, LLC PRODUCT DOCUMENT ...
Effective January 31, 2020, the services in this product document are withdrawn for all customers ... The Customer provides false information to the...
Read more >LilyPond snippets: Tweaks and overrides
Positioning text markups inside slurs. Text markups need to have the outside-staff-priority property set to false in order to be printed inside slurs....
Read more >1968404 – [master] Wrong Install-config override documentation
Verified: DOC reads: In order to alter the default install config yaml used when running openshift-install create commands.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@simonhaenisch that’s normal, because
no-console
is a rule, so it should be underrules
(whether it’s an override or not).space
,semicolon
andesnext
are XO option. They should go directly under thexo
config object or under each override.@devtanc I just tried what you reported on a sample project and it works as expected with the configuration from the doc. The overrides are applied in the the order in which they are defined (so if a file is matched by multiple overrides, the config used is a merge of the matches).
Oh I see. Yeah, the esnext and the space were just what was in the docs. Thanks for the clarification.