Skip to content

Less finnicky magic comments — allow extra comment lines + consider respecting eslint-disable if rule has same name #1448

@lionel-rowe

Description

@lionel-rowe

Currently, if I want to suppress the no-unused-vars lint rule in both my text editor (with deno-lint) and ScriptCat's built-in editor (with eslint), I have to write the following:

// eslint-disable-next-line no-unused-vars
// deno-lint-ignore no-unused-vars
const exports = { isInteresting }

If I write it like this, deno-lint doesn't respect it:

// deno-lint-ignore no-unused-vars
// eslint-disable-next-line no-unused-vars
const exports = { isInteresting }

Anything that would make this situation less finnicky (Was it ignore or disable? For a single line, was it disable or disable-line or disable-next-line? If I want to ignore the whole file, was it ignore-file or just ignore? Does it matter if I use // or /**/? Does the order of the magic comments matter? I know, I'll rely on Copilot to pick the right option. Great, it hallucinated the wrong answer) would be a bonus.

Ideally, deno-lint would allow other comments in between its own magic comment and the relevant line. Better yet, maybe deno-lint could respect the eslint-disable magic comments where the rule has the same name? Similar to how Deno respects nodejs.util.inspect.custom as an alternative to Deno.customInspect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions