Skip to content

Conversation

@dgreif
Copy link
Member

@dgreif dgreif commented Mar 31, 2021

ESLint was previously set up to do the default file glob, which only finds .js files. With all the awesome TypeScript conversion @colebemis has been doing, lint has been covering less and less files. This PR does the following:

  • adds coverage back to all files (.js, .ts, .tsx)
  • adds the prettier plugin into the eslint config (it was a dependency, but wasn't being used)
  • fixes all the related lint issues
  • adds yarn lint-fix which can be used to run prettier if your IDE isn't already configured to do so
  • updates all the eslint/prettier related dependencies.

Note: I split the base eslint fixes and the prettier fixes into two separate commits. The base fixes probably deserve the closer look of the two.

@dgreif dgreif requested a review from colebemis March 31, 2021 04:22
@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2021

⚠️ No Changeset found

Latest commit: e92353e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 31, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/primer/primer-components/B5HJKtFPNYpd7gKvcytJ3yZQjwDC
✅ Preview: https://primer-components-git-eslint-all-files-primer.vercel.app

Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this, @dgreif! ❤️

These changes look great. However, I tried running yarn lint locally on this branch and my computer fans started running on high and the script never finished. When I change the script to eslint 'src/**/*.{js,ts,tsx}' instead of eslint '**/*.{js,ts,tsx}' the script runs as expected. It seems like the ignorePatterns field might not be working as expect (at least on my machine).

Co-authored-by: Cole Bemis <colebemis@github.com>
@vercel vercel bot temporarily deployed to Preview March 31, 2021 14:34 Inactive
@dgreif
Copy link
Member Author

dgreif commented Mar 31, 2021

Hmm, there must be another build output dir that I missed. @colebemis can you think of another spot that .js files are generated? I'd prefer not to limit it to src/... because there are lots of other one-off js files that wouldn't get picked up.

@vercel vercel bot temporarily deployed to Preview March 31, 2021 14:46 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the initiative to fix this, @dgreif 🚀

@dgreif dgreif merged commit d573dd1 into main Mar 31, 2021
@dgreif dgreif deleted the eslint-all-files branch March 31, 2021 14:50
@dgreif dgreif mentioned this pull request Mar 31, 2021
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 this pull request may close these issues.

3 participants