Live data from Hacker News

ESLint: Flat Config Rollout Plan

eslint.org

1–9 of 9 posts

Re: ESLint: Flat Config Rollout Plan

#3
post #2

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

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.

Re: ESLint: Flat Config Rollout Plan

#4
post #2

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

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

Re: ESLint: Flat Config Rollout Plan

#5
post #4
post #2

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

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/jav…

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.

Re: ESLint: Flat Config Rollout Plan

#6
post #4

Earlier quoted context omitted.

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/jav…

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.

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

Re: ESLint: Flat Config Rollout Plan

#7
post #2

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

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.

Re: ESLint: Flat Config Rollout Plan

#8
post #2

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

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

Re: ESLint: Flat Config Rollout Plan

#9
post #2

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

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.