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

chore(gatsby): Add TS support to eslint and improve speed #20246

Merged
merged 14 commits into from
Jan 7, 2020

Conversation

blainekasten
Copy link
Contributor

Description

  • Add TS support to eslint so our ts files get linted.
  • Improve speed of eslint by doing a few things
    1. use the --cache flag
    2. Make sure we are ignoring node_modules inside of packages.

Previously we were telling eslint to ignore files from our .gitignore and .prettierignore. This was pragmatic and clever but did not work quite as well as it should have.

For 1, it was ignoring some files that should not have been ignored, and 2 eslint was parsing node_modules in the packages. This was leading to really slow lint times.

Having a dedicated .eslintignore file is, unfortunately, another file to maintain, however it is explicitly declarative and allows us more granular control.

@blainekasten blainekasten requested a review from a team as a code owner December 20, 2019 16:23
@blainekasten blainekasten added the type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change label Dec 20, 2019
"no-console": "off",
"no-inner-declarations": "off",
"prettier/prettier": "error",
quotes: ["error", "backtick"],
Copy link
Contributor

Choose a reason for hiding this comment

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

We might wanna change this line to something I use in my TS repo with backticks:

https://github.com/LekoArts/gatsby-themes/blob/master/.eslintrc.js#L47-L54

Reasoning: typescript-eslint/typescript-eslint#762

So ESLint otherwise wants to convert double quotes on types to backticks and the TS compiler doesn't like that at all!

@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Jan 7, 2020
@blainekasten blainekasten dismissed LekoArts’s stale review January 7, 2020 19:52

we'll follow this up!

@sidharthachatterjee sidharthachatterjee self-requested a review January 7, 2020 19:52
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

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

Great work! Thank you so much 🤗

@gatsbybot gatsbybot merged commit 7e8aebd into master Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants