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

feat(typescript-estree): add opt-in inference for single runs and create programs for projects up front #3512

Merged
merged 8 commits into from Jun 11, 2021

Conversation

JamesHenry
Copy link
Member

@JamesHenry JamesHenry commented Jun 9, 2021

~10% speed increase when opted into

Screenshot of running yarn lint (49.67s) and TSESTREE_SINGLE_RUN yarn lint (54.61s) in the typescript-eslint repo

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JamesHenry!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@nx-cloud
Copy link

nx-cloud bot commented Jun 9, 2021

Nx Cloud Report

CI ran the following commands for commit 8c7d459. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=build --all --parallel
#000000 nx run-many --target=typecheck --all --parallel

Sent with 💌 from NxCloud.

@bradzacher bradzacher added the enhancement New feature or request label Jun 9, 2021
packages/typescript-estree/src/index.ts Outdated Show resolved Hide resolved
packages/parser/src/index.ts Outdated Show resolved Hide resolved
packages/typescript-estree/src/parser.ts Outdated Show resolved Hide resolved
packages/typescript-estree/src/parser.ts Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 11, 2021

Codecov Report

Merging #3512 (8c7d459) into master (79b510c) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3512   +/-   ##
=======================================
  Coverage   92.63%   92.63%           
=======================================
  Files         325      325           
  Lines       11230    11230           
  Branches     3165     3165           
=======================================
  Hits        10403    10403           
  Misses        367      367           
  Partials      460      460           
Flag Coverage Δ
unittest 92.63% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...t-estree/src/create-program/useProvidedPrograms.ts 84.84% <ø> (ø)
...pt-estree/src/create-program/createWatchProgram.ts 77.04% <100.00%> (ø)

bradzacher
bradzacher previously approved these changes Jun 11, 2021
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

Code LGTM.
One thought though:

I'm surprised that the type-aware lint rule tests don't break on the CI.
process.env.CI === 'true', meaning the tests should parse with this new logic.

useProvidedPrograms doesn't pass the code from ESLint into the program... so the program is using the code it read from disk.. right?
I don't understand why the tests work!

does jest automatically clear the CI flag...?

…ams.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
@JamesHenry
Copy link
Member Author

@bradzacher per our slack discussion those existing tests don't have the flag enabled, so there is no change to their behaviour right now

@JamesHenry JamesHenry changed the title feat(typescript-estree): detect single run and create programs for projects up front feat(typescript-estree): add opt-in inference for single runs and create programs for projects up front Jun 11, 2021
@JamesHenry JamesHenry merged commit 06c2d9b into master Jun 11, 2021
@JamesHenry JamesHenry deleted the skip-watch-programs branch June 11, 2021 19:44
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants