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: consume new scope analysis package #2039

Merged
merged 1 commit into from Jul 28, 2020
Merged

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented May 18, 2020

Fixes #1856

  • switch parser to use scope-manager
    • I was able to delete almost all of the snapshots from parser, because they were (pretty useless and unreviewed) snapshots of the scope tree from every single shared-fixture.
  • Fix up rules:
    • no-unused-vars
      • this exposed so many bugs in the tests themselves - so many unused generic type parameters (function foo<T>() {} and class Foo<T> {}).
    • no-undef
    • no-shadow
      • define an extension rule to handle this arg shadowing, and add an option for ignoring type/value shadowing.
    • no-redeclare
      • define an extension rule to handle function overloads
    • no-use-before-define

BASED ON #1939

BREAKING

This is a big change that will require action from users in the form of:

  • configuring new rules,
  • reconfiguring old rules,
  • handling numerous new reports due to better (correct) coverage,
  • (in some cases) adding the parserOptions.lib to silence some false-positives.

We're going to have to do a 4.0 release v soon due to the optional chain and class property AST changes, so we can hold off on this until then

@bradzacher bradzacher added enhancement New feature or request blocked by another PR PRs which are ready to go but waiting on another PR labels May 18, 2020
@bradzacher bradzacher added this to the scope analysis rewrite milestone May 18, 2020
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

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.

@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 2 times, most recently from 667bdf2 to b3ccb87 Compare May 23, 2020 23:51
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 4 times, most recently from a5c53df to e0b1d0e Compare June 20, 2020 00:51
@bradzacher bradzacher force-pushed the scope-analysis branch 2 times, most recently from 5c3398f to f0ec7da Compare June 27, 2020 22:06
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 4 times, most recently from 517de6c to fbe16ac Compare June 28, 2020 20:31
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 5 times, most recently from f475b2b to b7c5f78 Compare June 29, 2020 08:43
@codecov
Copy link

codecov bot commented Jun 29, 2020

Codecov Report

Merging #2039 into v4 will decrease coverage by 0.07%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##               v4    #2039      +/-   ##
==========================================
- Coverage   93.05%   92.97%   -0.08%     
==========================================
  Files         285      285              
  Lines        9109     9014      -95     
  Branches     2503     2510       +7     
==========================================
- Hits         8476     8381      -95     
- Misses        303      304       +1     
+ Partials      330      329       -1     
Flag Coverage Δ
#unittest 92.97% <92.30%> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
packages/eslint-plugin/src/configs/all.ts 100.00% <ø> (ø)
...ages/eslint-plugin/src/rules/no-empty-interface.ts 95.83% <0.00%> (-0.33%) ⬇️
...nt-plugin/src/rules/no-unused-vars-experimental.ts 91.48% <ø> (ø)
packages/experimental-utils/src/ts-eslint/Scope.ts 100.00% <ø> (ø)
packages/eslint-plugin/src/rules/no-redeclare.ts 87.17% <87.17%> (ø)
...es/eslint-plugin/src/rules/no-use-before-define.ts 94.36% <87.50%> (-2.78%) ⬇️
packages/eslint-plugin/src/rules/no-unused-vars.ts 96.87% <96.00%> (+4.01%) ⬆️
packages/eslint-plugin/src/rules/no-shadow.ts 98.41% <98.41%> (ø)
... and 1 more

Base automatically changed from scope-analysis to master June 29, 2020 08:53
@bradzacher bradzacher added breaking change This change will require a new major version to be released and removed blocked by another PR PRs which are ready to go but waiting on another PR labels Jun 29, 2020
@bradzacher bradzacher marked this pull request as ready for review July 10, 2020 17:37
@bradzacher bradzacher changed the base branch from master to v4 July 27, 2020 14:19
@bradzacher bradzacher merged commit abb0617 into v4 Jul 28, 2020
@bradzacher bradzacher deleted the consume-new-scope-analysis branch July 28, 2020 01:07
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This change will require a new major version to be released enhancement New feature or request
Projects
None yet
1 participant