Skip to content

Expose fix mode to custom rules (params.fixMode) #1979

@chalin

Description

@chalin

Custom rules can emit fixInfo, but they currently can’t reliably detect whether the run is check-only or fix-enabled.

For rules with expensive fix-only logic, this matters:

  • Check runs should stay fast and avoid unnecessary side effects/rate limits
  • Fix runs should do the extra work

Today, a workaround is process.argv.includes('--fix'), which is brittle in non-CLI/programmatic contexts.

Feature request:

  • Add a run-mode signal to custom rule params (for example params.fixMode: boolean)
  • Document it in doc/CustomRules.md

Environment:

  • markdownlint 0.40.0
  • markdownlint-cli2 0.21.0

Thanks for such a great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions