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

Spruce Up ESLint Config #25

Open
codeincarnate opened this issue Oct 2, 2022 · 4 comments
Open

Spruce Up ESLint Config #25

codeincarnate opened this issue Oct 2, 2022 · 4 comments
Assignees

Comments

@codeincarnate
Copy link

Happened to serendipitously run into @JoshuaKGoldberg at a local coding meetup and he's graciously offered to give our ESLint config a once over. In particular he mentioned there were a number of presets we could use to reduce the number of rules we're currently using. Will defer to his expertise there but will otherwise be following up with this.

@codeincarnate codeincarnate self-assigned this Oct 2, 2022
@JoshuaKGoldberg
Copy link

JoshuaKGoldberg commented Oct 2, 2022

Hello! Looking through https://github.com/grafana/eslint-config-grafana/blob/489cd69/index.js, the biggest note from me is that there are a lot of manually configured rules. TypeScript ESLint has recommended preset configs you can extend from that are improved over time: https://typescript-eslint.io/docs/linting/configs.

I'd suggest trying out the recommended config to start, then if that feels right, trying recommended-requiring-type-checking. One common strategy organizations take is to:

  1. Overhaul your eslint-config-* package by:
    1. Clearing any old rules: ... settings
    2. Extending the new preset config(s)
    3. Re-adding any rules: ... settings you definitely want to override
  2. In any consuming project:
    1. Bump your eslint-config-* package version
    2. For any rule that has a lot of new failures, disable it in the project's ESLint config
    3. File a todo to investigate enabling that rule

I'd be happy to send a PR if you're interested, and/or help enable some of these rules - let me know!

@codeincarnate
Copy link
Author

Hey Josh! Thanks so much for the input 😄 and in terms of strategy that certainly sounds like a good idea. If you'd like to submit a PR it would certainly be welcome. I'm deep in some other things this week and off next week, but I'm happy to track progress and otherwise I should be able to dive in myself once I get back.

@JoshuaKGoldberg
Copy link

Fantastic! I filed a couple of PRs for your viewing pleasure:

@codeincarnate
Copy link
Author

Thanks so much Josh, this is absolutely awesome! I'll take a look at these and start testing, I'm not 100% sure I'll be able to get to it this week but if not I will do so first thing once I'm back after being off.

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

Successfully merging a pull request may close this issue.

2 participants