Settings

Theme

ESLint: Flat Config Rollout Plan

eslint.org

17 points by _samjarman 2 years ago · 8 comments

Reader

whinvik 2 years ago

As a newcomer to Javascript and its tooling, I would like to know how people use ESLint. So please share your config.

  • joshstrange 2 years ago

    I don’t have my config readily available but just pick a default that’s close to what you want then make tweaks based on your preferences. It’s an incredibly useful tool for even a solo dev to keep your code looking consistent.

  • taskylizard 2 years ago

    Usually you would pick a config you like and set it up for your project, notable ones are already mentioned but I'll mention xo[1] and @antfu/eslint-config[2].

    [1] https://github.com/xojs/xo [2] https://github.com/antfu/eslint-config for Vue, Typescript, etc

  • ayuhito 2 years ago

    Having too many options leads to a lot of bikeshedding as the whole ecosystem ends up fragmenting and disagreeing with each other. It’s one of things I really dislike about JS compared to something like Go.

    Personally, I stick to opinionated rulesets such as Standard[1], AirBnb[2] and Unicorn[3] since you won’t spend hours tweaking and selecting new rules.

    [1] https://standardjs.com/

    [2] https://github.com/airbnb/javascript

    [3] https://github.com/sindresorhus/eslint-plugin-unicorn

    • andyfleming 2 years ago

      I use prettier for this reason. There’s very few config options on purpose. If I use eslint it’s for additional issue detection, not formatting.

      • bavell 2 years ago

        +1 for prettier, I plop the same minimal config in every project and off I go.

  • mock-possum 2 years ago

    Integrate it into your IDE, so you get yellow and red squigglies to attract your attention to potential issues - and set it up to fix any automatically solvable issues on save. And if you’re feeling ambitious, set it up to prevent git commit until ESLint detects no errors - and set up your pull requests to likewise reject merges until issues are fixed.

  • sorahn 2 years ago

    There is an “eslint-recommended” rule set. (And a matching one for typescript-eslint).

    I recommend those as they seem to be the least intrusive while giving a lot of sane defaults.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection