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

@typescript-eslint
Copy link

@typescript-eslint typescript-eslint bot commented May 18, 2020

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 scope-analysis branch from 3c94b99 to 5f11b78 May 23, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 2 times, most recently from 667bdf2 to b3ccb87 May 23, 2020
@bradzacher bradzacher force-pushed the scope-analysis branch from 507ab40 to 883d48e May 24, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from b3ccb87 to 1a7a664 May 24, 2020
@bradzacher bradzacher force-pushed the scope-analysis branch from 883d48e to a810f23 May 24, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from 1a7a664 to 72a8b1a May 24, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from 72a8b1a to 582e7e2 Jun 1, 2020
@bradzacher bradzacher force-pushed the scope-analysis branch from 1be2ab8 to 25e1f68 Jun 19, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from 582e7e2 to 07a426a Jun 19, 2020
@bradzacher bradzacher force-pushed the scope-analysis branch from 25e1f68 to 1577110 Jun 19, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 4 times, most recently from a5c53df to e0b1d0e Jun 19, 2020
@bradzacher bradzacher force-pushed the scope-analysis branch from 6d9a0aa to d66f86d Jun 21, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from e0b1d0e to d656e37 Jun 21, 2020
@bradzacher bradzacher force-pushed the scope-analysis branch from d66f86d to 6949551 Jun 25, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from d656e37 to d7a35dd Jun 25, 2020
@bradzacher bradzacher force-pushed the scope-analysis branch 2 times, most recently from 5c3398f to f0ec7da Jun 25, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 4 times, most recently from 517de6c to fbe16ac Jun 27, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch 5 times, most recently from f475b2b to b7c5f78 Jun 29, 2020
@codecov
Copy link

@codecov 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 Jun 29, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from b7c5f78 to a65330f Jun 29, 2020
@bradzacher bradzacher marked this pull request as ready for review Jul 10, 2020
@bradzacher bradzacher changed the base branch from master to v4 Jul 27, 2020
@bradzacher bradzacher force-pushed the consume-new-scope-analysis branch from a65330f to bb26959 Jul 28, 2020
@bradzacher bradzacher merged commit abb0617 into v4 Jul 28, 2020
11 checks passed
11 checks passed
Typecheck
Details
Unit tests Unit tests
Details
Code style and lint
Details
Run integration tests on primary Node.js version
Details
Run unit tests on other Node.js versions (10.x)
Details
Run unit tests on other Node.js versions (14.x)
Details
Publish the latest code as a canary version
Details
Publish the latest code as a v4 prerelease version
Details
Semantic Pull Request ready to be squashed
Details
codecov/patch 92.30% of diff hit (target 90.00%)
Details
codecov/project 92.97% (+-0.08%) compared to a4bd2a8
Details
@bradzacher bradzacher deleted the consume-new-scope-analysis branch Jul 28, 2020
bradzacher added a commit that referenced this pull request Aug 3, 2020
bradzacher added a commit that referenced this pull request Aug 9, 2020
bradzacher added a commit that referenced this pull request Aug 10, 2020
bradzacher added a commit that referenced this pull request Aug 19, 2020
@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.
Projects
None yet
1 participant
You can’t perform that action at this time.