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

Discussion: remove a lot of opinionated rules #608

Open
ascorbic opened this issue Nov 29, 2022 · 3 comments
Open

Discussion: remove a lot of opinionated rules #608

ascorbic opened this issue Nov 29, 2022 · 3 comments

Comments

@ascorbic
Copy link
Member

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.

@khendrikse
Copy link

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.

@danez
Copy link
Contributor

danez commented Nov 29, 2022

I am totally for this.

@lukasholzer
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants