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

Should the useEslintrc option be documented? #338

Closed
tony-kerz opened this issue Jul 15, 2018 · 6 comments · Fixed by #565
Closed

Should the useEslintrc option be documented? #338

tony-kerz opened this issue Jul 15, 2018 · 6 comments · Fixed by #565
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt

Comments

@tony-kerz
Copy link

tony-kerz commented Jul 15, 2018

Issuehunt badges

i have been using this for a while as i find it a convenient way to tweak eslint settings via eslint conventions, and i just noticed that it wasn't mentioned in the documentation.

should this be documented or is its longevity suspect?

thx!


IssueHunt Summary

richienb richienb has been rewarded.

Backers (Total: $40.00)

Submitted pull Requests


Tips

@sindresorhus
Copy link
Member

If that works it’s a bug. We don’t intend to support that option and it might cause other unforeseen issues. We should prevent its usage.

@tony-kerz
Copy link
Author

tony-kerz commented Jul 26, 2018

from my perspective, reasons i like this option:

  1. i can use a dot-js file for (i.e. .eslintrc.js) which i find cleaner to work with than json (i.e. package.json), in terms of less double-quotes, commentability, etc.
  2. a .eslintrc file positions for portability (historically, i have had to temporarily eject from xo because of transient issues)
  3. it aligns with the prettier strategy which honors .prettierrc config and then falls back to settings in package.json

but, just so i understand your position, you were thinking that xo would ignore any kind of .eslintrc config, and xo users would be required to disperse config that could otherwise go there into an eslintConfig section or in an xo[.rules] section in package.json...?

@sindresorhus sindresorhus changed the title should the "useEslintrc" option be documented? Should the useEslintrc option be documented? Jul 28, 2018
@sindresorhus
Copy link
Member

i can use a dot-js file for (i.e. .eslintrc.js) which i find cleaner to work with than json (i.e. package.json), in terms of less double-quotes, commentability, etc.

We plan to support that by using cosmiconfig. See: #279 (comment)

but, just so i understand your position, you were thinking that xo would ignore any kind of .eslintrc config, and xo users would be required to disperse config that could otherwise go there into an eslintConfig section or in an xo[.rules] section in package.json...?

Yes. XO needs full control of how you define rules as we do a lot extra stuff with them. We could support .eslintrc (we won't though), but that would need to be an actual XO option and not something that is just accidentally passed through to ESLint.

@tony-kerz
Copy link
Author

thanks sindre,

i think i'm with ya, so:

  • this proposal would allow, for instance, a .xo.js file to be found at the root of the project with stuff like?:
{
  parser: 'babel-eslint',
  env: ['browser'],
  rules: {
    'capitalized-comments': 0,
    'react/prop-types': 0,
    'no-unused-expressions': 0,
    'prefer-rest-params': 0
  }
}
  • is there a pass-thru for parserOptions like these, or are they supposed to be derived?:
{
  parserOptions: {
    sourceType: 'module',
    ecmaFeatures: {
      jsx: true,
      experimentalObjectRestSpread: true
    }
  }
}

best,
tony.

@IssueHuntBot
Copy link

@IssueHunt has funded $40.00 to this issue.


@issuehunt-oss
Copy link

issuehunt-oss bot commented Jun 27, 2021

@sindresorhus has rewarded $36.00 to @richienb. See it on IssueHunt

  • 💰 Total deposit: $40.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $4.00

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants