-
-
Notifications
You must be signed in to change notification settings - Fork 214
Description
Which packages are affected?
-
espree
-
eslint-scope
-
eslint-visitor-keys
Environment
Node version: 24.1.0
npm version: 11.3.0
ESLint version: 9.28.0
Operating System: Mac OS 15.4.1
What did you do?
As far as I can see, it's not documented anywhere that visitor keys are always in source code order. However, in my opinion it's what a user would naturally expect, and this expectation seems to be confirmed because it's true for every single AST node type... With only one exception: ExportSpecifier
.
export { local as exported };
In this case, exported
is visited before local
:
js/packages/eslint-visitor-keys/lib/visitor-keys.js
Lines 102 to 105 in b847f35
ExportSpecifier: [ | |
"exported", | |
"local" | |
], |
I have opened this issue as a bug report as I assume that this deviation from "visit in source code order" rule is an oversight rather than intentional. But there may be some context I am missing.
What did you expect to happen?
local
to be visited before exported
.
What actually happened?
exported
is visited before local
(more like ImportSpecifier
).
Link to Minimal Reproducible Example
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status