-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to customize certain rules via shareable config #71
Comments
Hmm. We just set the default value there. It's later extended by your custom config. |
Seems like it does not for some reason. Needs investigation. |
Those rules gets set in the |
@kevva is right. Why does xo forces these default rules here (https://github.com/sindresorhus/xo/blob/2d26d79ea81f893fc7b1ff9e586c1e74ad28c830/options-manager.js#L98) ? |
What would be the consequence of moving those defaults into another base config that we conditionally add to |
I don't think there are any consequences other than creating a config for it may seem unnecessary but in this case it might be needed. |
Why are those rules not in the default xo (or xo-react) config in the first place? |
The Babel parser and plugin have some incompatible rules. So we first need to reset the original rules, then set the Babel ones. That line just sets it to the same value as in
That would be the way to go. Anyone wanna do a PR?
They are, but here we do something different as we're using the |
This should be fixed in cece3dd, but with ESLint changes and this, it would be nice if you all could take a look at the changes. @vdemedes Can you try it out in practice? |
Tried it out in a real app and now shareable configs don't work at all:
package.json: "xo": {
"extends": ["vdemedes"]
} output when running latest xo:
Might be related: eslint/eslint#5411. |
Added a PR to demonstrate this issue - #83. |
I ended up reverting to the previous workaround. Don't have time to fix this properly right now. New version is out btw. I still would like to see this fixed at some point. |
Are you saying that there is another way to have different configs for subfolders? |
@bfred-it I'm not sure what you're asking? Doesn't seem relevant to this thread. |
Sorry, I was referring to the I thought you were referring to |
@bfred-it I don't remember, but it ended up landing regardless: https://github.com/sindresorhus/xo#config-overrides |
@IssueHunt has funded $60.00 to this issue.
|
This will be fixed with #702 |
The bounty has been moved to #702 |
Using latest xo (master branch), I'm unable to customize
babel/object-curly-spacing
rule via shareable config.package.json:
my-config:
file.js:
Given these files, xo throws error:
If I override
babel/object-curly-spacing
in package.json, it works as expected and I no longer get errors:Related: https://github.com/sindresorhus/xo/blob/master/options-manager.js#L98
The text was updated successfully, but these errors were encountered: