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

fix(ts-estree): make sure that every node can be converted to tsNode #287

Merged
merged 10 commits into from
Feb 19, 2019
Merged

Conversation

armano2
Copy link
Member

@armano2 armano2 commented Feb 15, 2019

This PR makes sure that all nodes can be converted into ts.Node and fixes crash in promise-function-async rule

fixes: #227

@codecov
Copy link

codecov bot commented Feb 15, 2019

Codecov Report

Merging #287 into master will decrease coverage by 0.07%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #287      +/-   ##
==========================================
- Coverage   95.03%   94.96%   -0.08%     
==========================================
  Files          67       67              
  Lines        2801     2801              
  Branches      724      724              
==========================================
- Hits         2662     2660       -2     
  Misses         53       53              
- Partials       86       88       +2
Impacted Files Coverage Δ
packages/typescript-estree/src/node-utils.ts 96.62% <ø> (-0.23%) ⬇️
packages/typescript-estree/src/convert.ts 98.23% <100%> (+0.02%) ⬆️
.../eslint-plugin/src/rules/promise-function-async.ts 100% <100%> (ø) ⬆️
...slint-plugin/src/rules/no-unnecessary-qualifier.ts 90.9% <0%> (-3.64%) ⬇️

@armano2 armano2 marked this pull request as ready for review February 15, 2019 01:00
@armano2
Copy link
Member Author

armano2 commented Feb 15, 2019

no-unnecessary-qualifier can be now simplified

      'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]': enterDeclaration,
      'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]': enterDeclaration,
      'ExportNamedDeclaration[declaration.type="TSModuleDeclaration"]:exit': exitDeclaration,
      'ExportNamedDeclaration[declaration.type="TSEnumDeclaration"]:exit': exitDeclaration,

is no longer needed

and ifs

if (esTreeNodeToTSNodeMap.has(node)) {
if (tsDeclaration) {

can be removed

@armano2 armano2 added bug Something isn't working and removed bug Something isn't working labels Feb 15, 2019
sindresorhus referenced this pull request in refined-github/refined-github Feb 18, 2019
@armano2 armano2 merged commit 9f1d314 into typescript-eslint:master Feb 19, 2019
@armano2 armano2 deleted the fix-export branch February 19, 2019 01:08
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[promise-function-async] problem with exported functions
2 participants