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(experimental-utils): expose ast utility functions #1670

merged 3 commits into from Mar 20, 2020


Copy link

bradzacher commented Mar 4, 2020

I figured that other plugin developers might find some use from having these utility functions exposed.
No sense in hoarding all of these for ourselves, esp the type predicate functions.

There is probably even more functions that we can move over in future, but I figured this was a good start.

This pr does the following:

  • moves eslint-plugin/src/utils/astUtils.ts to the experimental-utils package.
  • converts our local for the eslint-utils package into a form that can be consumed via experimental-utils
    • same as what we did for eslint-scope
    • these defs are just a thin layer which type the package using our TSESTree types.
  • updates eslint-plugin to use these new types, removing the direct dependency on eslint-utils
bradzacher added 2 commits Mar 3, 2020

This comment has been minimized.

Copy link

typescript-eslint bot commented Mar 4, 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 As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.


This comment has been minimized.

Copy link

codecov bot commented Mar 4, 2020

Codecov Report

Merging #1670 into master will decrease coverage by 0.21%.
The diff coverage is 77.98%.

@@            Coverage Diff             @@
##           master    #1670      +/-   ##
- Coverage   95.19%   94.97%   -0.22%     
  Files         148      158      +10     
  Lines        6971     7047      +76     
  Branches     2010     2010              
+ Hits         6636     6693      +57     
- Misses        124      154      +30     
+ Partials      211      200      -11
Flag Coverage Δ
#unittest 94.97% <77.98%> (-0.22%) ⬇️
Impacted Files Coverage Δ
...mental-utils/src/ts-eslint-scope/PatternVisitor.ts 100% <ø> (ø) ⬆️ 100% <ø> (ø) ⬆️
...ges/experimental-utils/src/ts-eslint/SourceCode.ts 100% <ø> (ø) ⬆️
...rimental-utils/src/ts-eslint-scope/ScopeManager.ts 100% <ø> (ø) ⬆️
...ges/experimental-utils/src/ts-eslint/RuleTester.ts 28.57% <ø> (ø) ⬆️
...s/eslint-plugin/src/rules/prefer-optional-chain.ts 95.09% <ø> (-0.05%) ⬇️ 100% <ø> (ø) ⬆️
...perimental-utils/src/ts-eslint-scope/Definition.ts 100% <ø> (ø) ⬆️
...nt-plugin/src/rules/switch-exhaustiveness-check.ts 100% <ø> (ø) ⬆️
...xperimental-utils/src/ts-eslint-scope/Reference.ts 100% <ø> (ø) ⬆️
... and 37 more
@bradzacher bradzacher changed the title feat(experimental-utils): expose our internal ast utility functions feat(experimental-utils): expose ast utility functions Mar 20, 2020
@bradzacher bradzacher merged commit 3eb5d45 into master Mar 20, 2020
6 of 7 checks passed
6 of 7 checks passed
Primary code validation and tests
Run integration tests on primary Node.js version
Run unit tests on other Node.js versions (8.x)
Run unit tests on other Node.js versions (10.x)
codecov/patch 77.98% of diff hit (target 90.00%)
Semantic Pull Request ready to be squashed
codecov/project 94.97% (+-0.22%) compared to c82d121
@bradzacher bradzacher deleted the expose-utils-in-utils-package branch Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant
You can’t perform that action at this time.