eslint-config-node
eslint-config-node copied to clipboard
Discussion: remove a lot of opinionated rules
I am proposing that this config is reduced to a more minimal and less opinionated set of rules. A lot of repos have been disabling many of these rules because they can be quite disruptive, and build
has stopped using them entirely. Instead of more repos disabling more of these rules I propose we cut it down to a much more minimal set of rules:
- remove fp, standard, you-dont-need-lodash-underscore and ava plugins. fp is too opinionated. standard doesn't have much point with prettier. We don't need eslint to tell us not to use lodash. Ava is only used on certain repos, which can add it as needed.
- Change most of the other plugins to use their "recommmended" rule sets
- enable a very limited set of unicorn rules. I suggets that these be limited to: ones that catch actual mistakes, and ones that suggest easier ways to do things that people might not know about.
For the Unicorn rules, if we go ahead I will do a list and we can discuss the choices.
I really wouldn't mind this at all. If we do go ahead and do this, having a good migration guide so it'll be easy for people to add to their repo's what they may have lost in this update would be essential for me. Otherwise it could take a lot of time, and the chances of people actually updating will be lower.
I am totally for this.
I'm fully in with this! 💯
IMHO if a lint rule does not prevent a bug then it's just bike shedding and we should drop it.
For example in the @netlify/build
monorepo we tried to keep it on minimal set as possible to do not disrupt the developer experience.
Basically:
-
extend
eslint:recommended
,plugin:@typescript-eslint/recommended
andprettier
to avoid conflicts. -
additonally we added some import rules:
'import/extensions': ['error', 'ignorePackages'], // This requires for esm modules .js file extensions on relative paths 'import/no-absolute-path': ['error'], 'import/no-cycle': ['error', { ignoreExternal: true }], 'import/no-duplicates': ['error', { considerQueryString: true }], 'import/no-self-import': ['error'], 'import/no-mutable-exports': ['error'], 'import/no-useless-path-segments': ['error'], 'import/order': [ 'error', { 'newlines-between': 'always', alphabetize: { order: 'asc', caseInsensitive: true, }, }, ],