feat(ignore-directives): support block-scoped deno-lint-ignore - #1518
Open
bartlomieju wants to merge 1 commit into
Open
feat(ignore-directives): support block-scoped deno-lint-ignore#1518bartlomieju wants to merge 1 commit into
bartlomieju wants to merge 1 commit into
Conversation
A `// deno-lint-ignore` directive only suppressed diagnostics on the
single following line, so there was no way to silence a rule across a
multi-line span without repeating the directive or reaching for the
coarse `deno-lint-ignore-file`.
A directive placed directly above a `{ ... }` block now suppresses
diagnostics anywhere inside that block. Coverage is intentionally
limited to bare/explicit blocks: the directive must be a leading comment
of a `BlockStmt`. A directive before a function, class or other
statement attaches to that node rather than to a block, so it keeps the
ordinary next-line behavior and does not silently swallow deeply nested
diagnostics.
Closes #476
Member
Author
|
Verdict: LGTM — correct and well-tested, including the key safety guard. Recommend merge (ignore-directive behavior change → maintainer sign-off; needs green CI / rebase). Correctness — verified the main risk
Performance — minor
Suggestion
Housekeeping: No changes requested. Well-scoped feature with the right guardrails and tests; good to merge once CI is green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
// deno-lint-ignoredirective only suppressed diagnostics on thesingle line that follows it, so silencing a rule across a multi-line
span meant repeating the directive on every line or reaching for the
much coarser
deno-lint-ignore-file.A directive placed directly above a
{ ... }block now suppressesdiagnostics anywhere inside that block. Coverage is intentionally
limited to bare, explicit blocks: the directive has to be a leading
comment of a
BlockStmt. A directive placed before a function, classor other statement attaches to that node rather than to a block, so it
keeps the ordinary next-line behavior and does not silently swallow
deeply nested diagnostics, which was the main concern raised when this
was discussed.
Closes #476