-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore: extract AST check from convert.ts to ast-checks.ts #11748
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
base: main
Are you sure you want to change the base?
chore: extract AST check from convert.ts to ast-checks.ts #11748
Conversation
|
Thanks for the PR, @Lonercode! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 001ea12
☁️ Nx Cloud last updated this comment at |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11748 +/- ##
==========================================
- Coverage 90.66% 90.66% -0.01%
==========================================
Files 518 523 +5
Lines 52444 53090 +646
Branches 8690 8861 +171
==========================================
+ Hits 47548 48133 +585
- Misses 4882 4942 +60
- Partials 14 15 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Can we run the AST check from https://github.com/Lonercode/typescript-eslint/blob/65803e4127b9557ec6cf4802df12e588370d9930/packages/typescript-estree/src/convert.ts#L509, and have a big switch-case in the new file to check every ts node? |
AST check |
|
No need change check-modifiers.ts. In the new file export a function to check ts node, it calls |
|
|
||
| case SyntaxKind.ForInStatement: | ||
| this.#checkForStatementDeclaration(node.initializer, node.kind); | ||
| this.#checkTSNode(node, node.initializer, node.kind); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be able to be removed?

PR Checklist
Converter#11695Overview
This PR extracts the AST check (checkForStatementDeclaration) from
convert.tsto a fileast-checks.tsas requested in the issue due to the increasing length of code in the file. Therefore, a new fie has been added (ast-checks.ts), one modified (convert.ts) and tests have been run.