question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

XO Documentation on overrides misleading

See original GitHub issue

The 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pvdlgcommented, May 24, 2018

@simonhaenisch that’s normal, because no-console is a rule, so it should be under rules (whether it’s an override or not). space, semicolon and esnext are XO option. They should go directly under the xo 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).

0reactions
devtanccommented, May 24, 2018

Oh I see. Yeah, the esnext and the space were just what was in the docs. Thanks for the clarification.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found