Skip to content
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

XO shareable configs? #352

Open
niftylettuce opened this issue Sep 30, 2018 · 3 comments
Open

XO shareable configs? #352

niftylettuce opened this issue Sep 30, 2018 · 3 comments

Comments

@niftylettuce
Copy link

niftylettuce commented Sep 30, 2018

Should we allow shareable configs to use top level rules such as "prettier" and "space" in shareable XO configs? It would set the option for xo but delete it before passing along to eslint?

Otherwise I have to do this in all my projects:

"xo": {
  "prettier": true,
  "space": true,
  "extends": [ "xo-lass" ]
}
niftylettuce added a commit to lassjs/eslint-config-xo-lass that referenced this issue Sep 30, 2018
@sindresorhus sindresorhus changed the title xo shareable configs? XO shareable configs? Oct 1, 2018
@sindresorhus
Copy link
Member

Yes, I think that makes sense. It should be in a "xo" object though, so it won't conflict with ESLint config.

It should support these options:

  • space
  • semicolon
  • prettier
  • nodeVersion
  • extensions
  • esnext

The rest of the XO options can already be defined as ESLint config.

It can also only be directly in a shareable config and not nested or in an extended config, as ESLint doesn't expose a method to flatten the extend tree.

@tkesgar
Copy link

tkesgar commented Dec 7, 2018

I'd love this feature, and I have attempted to work it out by editing optionsManager.buildConfig (here).

However, I'm unsure on how to handle options.xo.extensions.

(EDIT: Just noticed eslint/eslint#10828 -- if ESLint will supports extensions, then this commit should be enough.)

@bojanmilosavljevic
Copy link

Any info on this? Can one create a config with top level options and use xo directly? I've tried doing so, but ESLint then complains about unexpected top-level properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@sindresorhus @niftylettuce @tkesgar @bojanmilosavljevic and others