deno/cli/tools/lint/ast_buffer
Marvin Hagemeister c015b8affd
feat(unstable): support comments in lint plugin (#29189)
This PR adds support for comments in the AST for lint plugins.

- The `Program` node has a `comments` field pointing to an array of all
comments.
- `SourceCode.getAllComments()`: Returns all comments (same as
`program.comments`)
- `SourceCode.getCommentsBefore(node)`: Get all comments before this
Node
- `SourceCode.getCommentsAfter(node)`: Get all comments after this Node
- `SourceCode.getCommentsInside(node)`: Get all comments inside this
Node

ESLint docs:
-
https://eslint.org/docs/latest/extend/custom-rules#accessing-the-source-code
- https://eslint.org/docs/latest/extend/custom-rules#accessing-comments
2025-05-08 21:59:36 +02:00
..
buffer.rs feat(unstable): support comments in lint plugin (#29189) 2025-05-08 21:59:36 +02:00
mod.rs feat(lint): add JavaScript plugin support (#27203) 2025-02-05 16:59:24 +01:00
swc.rs feat(unstable): support comments in lint plugin (#29189) 2025-05-08 21:59:36 +02:00
ts_estree.rs feat(unstable): support comments in lint plugin (#29189) 2025-05-08 21:59:36 +02:00