fix(linter/plugins): include hashbang in comments#17231
fix(linter/plugins): include hashbang in comments#17231graphite-app[bot] merged 1 commit intomainfrom
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Performance ReportMerging #17231 will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR enhances ESLint compatibility by representing hashbangs as comments in the AST. When a file contains a hashbang, it is now added to the start of the comments array with type Shebang, matching ESLint's behavior.
- Adds hashbang as a
Shebangcomment type in the comments array - Updates TypeScript types to include
"Shebang"as a valid comment type - Fixes conformance tests for
lines-around-comment,lines-around-directive, andno-trailing-spacesrules
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
crates/oxc_ast/src/serialize/mod.rs |
Template code to prepend hashbang as Shebang comment when deserializing comments |
apps/oxlint/src-js/generated/deserialize.js |
Generated JavaScript deserializer with hashbang-to-comment logic |
apps/oxlint/src-js/plugins/types.ts |
TypeScript type update to include "Shebang" as valid Comment type |
apps/oxlint/test/fixtures/comments/files/hashbang.js |
New test file with hashbang to verify comment handling |
apps/oxlint/test/fixtures/comments/output.snap.md |
Updated test snapshots showing hashbang correctly appears as Shebang comment |
apps/oxlint/conformance/snapshot.md |
Conformance test results showing 3 rules now fully passing and 10 more tests passing overall |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d760626 to
be97ee1
Compare
4cb8cfe to
cf3f489
Compare
Merge activity
|
ESLint represents hashbangs as comments. If file has a hashbang, add it to start of comments array with type `Shebang`. This fixes a handful of conformance tests.
be97ee1 to
3d264cb
Compare
cf3f489 to
e08fdf1
Compare

ESLint represents hashbangs as comments. If file has a hashbang, add it to start of comments array with type
Shebang.This fixes a handful of conformance tests.