Last 12 weeks · 2 commits
2 of 6 standards met
This is so that dprint-plugin-typescript can drop its dependency on deno_ast — dprint/dprint-plugin-typescript#810. That plugin only ever used deno_ast for parsing and its parse diagnostics. Everything else it needed — the ast view, , , the comment and token containers — already came from , which deno_ast re-exports. So it now parses with swc directly, which drops 17 crates from its dependency graph (, , the family, , , , , ...). The one thing that had to keep working is a deno_ast user handing the plugin an already parsed AST with its comments, so that doesn't parse the same file twice. That's what this enables. 0.26.1 added a trait (dprint/dprint-swc-ext#78) for exactly this, and since both crates share the same , implementing it here is all that's left: The change already built exactly the the trait returns, so its body moves into and the inherent now delegates to the trait's default method. Callers that don't import the trait are unaffected — the inherent method still wins at the call site — so this is additive. Also bumps to 0.26.1, which is the release that adds the trait. Testing passes (193 tests), including a new one that hands a to a generic function standing in for another crate. and are clean.
Small CI hardening: declares an explicit workflow-level on 2 workflow(s) that currently inherit the default broad read-write GITHUB_TOKEN. I inspected each file before including it; none publish, push, comment on issues/PRs, or otherwise write via the GitHub API, so the read-only default does not change behavior. Workflows that need to write (stale, release, gh-pages-deploy, publish actions, etc.) are intentionally left out of this PR. This is the post-CVE-2025-30066 hardening pattern for default token scope.
Problem When a diagnostic's highlighted span covers many lines, renders every line of the span with a full-width underline. For a rule like on a large executor body this produces snippets that are dozens of lines long, with carets running edge-to-edge under each line (including the leading indentation). Before (a 12-line executor): Change Rework so multi-line highlights render like / Biome: Frame cap + elision — spans longer than (5) source lines show their first two lines, a marker, and their last two lines. Carets on the endpoints only — only the first and last line of a multi-line span are underlined; interior lines are shown for context without carets. Indentation-aware underline — the last line's underline skips leading indentation so the carets sit under the offending code, not the whitespace. Gutter marker — a is drawn next to each line number that is part of a multi-line span so its extent stays visible. The marker column is only reserved when a multi-line highlight is present, so single-line diagnostics are byte-for-byte unchanged. After: Tests Adds unit tests for covering single-line, elided multi-line, short (non-elided) multi-line, and description-on-last-line rendering. Existing tests pass, and Deno's spec suite (82 tests) passes against a local build patched with this change.
ref: https://github.com/denoland/deno_ast/pull/328#discussion_r2849658299 Some of the deno_ast tests failed When I tried to integrate merve locally. Ultimately, I think the key to CommonJS static analysis lies in how much heuristics are allowed. Covering real-world use cases should suffice. Furthermore, the Deno CLI tests did not show any regressions other than the occurrence of linking to . It seems you are currently considering migrating to oxc. However merve is probably the more appropriate dependency in terms of ensuring consistent behavior but regarding CommonJS. https://github.com/denoland/deno_ast/pull/331
Repository: denoland/deno_ast. Description: Source text parsing, lexing, and AST related functionality for Deno Stars: 179, Forks: 51. Primary language: Rust. Languages: Rust (97.6%), TypeScript (2.4%). License: MIT. Homepage: https://crates.io/crates/deno_ast Latest release: 0.53.3 (1mo ago). Open PRs: 3, open issues: 1. Last activity: 1mo ago. Community health: 37%. Top contributors: dsherret, denobot, marvinhagemeister, bartlomieju, lucacasonato, kitsonk, crowlKats, nayeemrmn, Foorack, magurotuna and others.