eslint-config-node icon indicating copy to clipboard operation
eslint-config-node copied to clipboard

Discussion: remove a lot of opinionated rules

Open ascorbic opened this issue 2 years ago • 3 comments

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:

  1. 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.
  2. Change most of the other plugins to use their "recommmended" rule sets
  3. 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.

ascorbic avatar Nov 29 '22 10:11 ascorbic

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.

khendrikse avatar Nov 29 '22 10:11 khendrikse

I am totally for this.

danez avatar Nov 29 '22 11:11 danez

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 and prettier 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,
          },
        },
      ],
    

lukasholzer avatar Dec 05 '22 09:12 lukasholzer