fix(visitor-keys): fix visitor keys order#11279
fix(visitor-keys): fix visitor keys order#11279bradzacher merged 1 commit intotypescript-eslint:mainfrom
Conversation
|
Thanks for the PR, @overlookmotel! 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 b5f8186.
☁️ Nx Cloud last updated this comment at |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11279 +/- ##
=======================================
Coverage 90.91% 90.91%
=======================================
Files 501 501
Lines 50869 50869
Branches 8382 8382
=======================================
Hits 46248 46248
Misses 4606 4606
Partials 15 15
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
kirkwaiblinger
left a comment
There was a problem hiding this comment.
Thanks for sending this!
RE the test coverage - I think let's get this merged and I'd invite you to file a followup issue for the test coverage question.
|


PR Checklist
Overview
As discussed in #11276, visitor keys are not in source code order for 5 types:
TSImportTypeTSIndexedAccessTypeTSMethodSignatureTSPropertySignatureTSTypePredicateThis PR fixes that by altering the order of keys in
AdditionalKeys.The changes to test snapshots are incidental details.
It appears that visitation happening in source code order is not covered by tests, but no lint rules are impacted by this change. If required, I would be happy to add tests, if someone can point me to where to put them.
FYI: Oxc's JS-side AST for TS files now aligns exactly with TS-ESLint parser's. The discrepancies in visitation order addressed in this PR were discovered during the work on alignment to get there. Our conformance testing ensures that visitor keys (after the changes in this PR) result in visitation in source code order for all AST types, for all Test262 and TypeScript test cases.
Except...
ExportSpecifierwherelocalandexportedare visited in wrong order. However, TS-ESLint inherits that problem fromeslint-visitor-keys. eslint/js#655 hopes to address that one upstream.Anyway, my point is: I imagine it'd be preferable for TS-ESLint to have your own test coverage for visitation order. However, if you choose to believe me, I can tell you that the types changed in this PR +
ExportSpecifierare the only places where there is a problem.