-
-
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
Use and extend eslint's config files instead of mapping it to XO's own schema #428
Comments
I feel like ESLint has way too many options and CLI flags and I don’t want to overload users with all that. I also see value in being able to add custom behavior to options when we can improve upon ESLint. I’m happy to add support for reading from |
What would be the point of splitting the XO only and the ESLint config? With the example you gave: {
overrides: [
{
files: ["**/*.svelte"],
processor: "svelte3/svelte3"
}
]
} I tested and the The only exceptions are One more thing regarding file extension. XO since |
I already specified
You answered yourself. That’s not documented, why would anyone expect that XO’s options are also silently ESLint options? The schema doesn’t seem to match. Wouldn’t it make more sense to make this more explicit by having the user put ESLint options in ESLint’s config files? XO is meant to provide defaults and make linting easier for the end user, but the “thicker” the layer around ESLint the more documentation you have to write and keep up to date around it, or else you’ll end up like this. The only drawback I see is having 2 config keys inside package.json instead of 1, but if the user trusts XO then probably they don’t need a XO key in there at all. Congrats, you achieved “no config needed” status
You can still suggest a handful of options without making it look like they’re specific to XO. |
With the upcoming Flat Configmageddon I think reducing your XO-specific config would be your first priority. I think your choices are:
Related: |
Closing as non-actionable. Further discussion available in:
This issue can be considered folded into: |
Some options are XO-specific, like
space: true
, but many of them (including rules and such) don't need to be customized to XO's own format.An example of this is #319. This issue wouldn't exist at all if, instead of having a
xo.globals
key in package.json, XO just usedeslintConfig.globals
This is particularly painful when copying configuration from internet and then having to match it to XO.
This is fine, it's the same for both XO and eslint:
But what about this? From: https://github.com/sveltejs/eslint-plugin-svelte3
eslint has that
processor
property, XO doesn't. I still haven't figured this out.It's great that XO offers shortcuts for common configuration, but could it leave eslint's config in eslint's files?
This is an example package.json for a random project (no need to read it):
95% of this isn't XO-specific. I reckon it should be written as:
Being a thinner wrapper around eslint frees XO from having to document overlapping features. Does XO's readme really need to document
envs
,globals
,ignores
,rules
,plugins
,extends
,settings
, andparser
? Yep, that's most of them.The CLI could do a similar job at mapping unrecognized flags back to eslint (risky but better than having no chance at all)
This is a pretty big change at this point, but ideal for a XO 1.0 nonetheless.
The text was updated successfully, but these errors were encountered: