#20062·eslint

Change Request: ability to have `--fix` respect suppressions

Author: G-RathCreated Aug 31, 2025Updated Sep 26, 2026
Labelsenhancementcoreaccepted

ESLint version

v9.34.0

What problem do you want to solve?

Currently --fix ignores suppressions which I understand because in theory autofixes should be safe to apply but in practice the definition of "safe" is in the eye of the rule maintainer, and especially when dealing with very large codebases applying all autofixes all at once is both noisy and risky

What do you think is the correct solution?

It would be great if we could have ESLint respect suppressions when applying autofixes, ideally via a config option or otherwise a flag.

Participation

  • I am willing to submit a pull request for this change.

Additional comments

It looks like I can achieve this in userland with:

/** @type {import('eslint').Linter.FlatConfig[]} */
const overrides = process.argv.includes('--fix')
  ? Object.entries(suppressions).map(([file, rules]) => {
      return {
        files: [file],
        rules: Object.fromEntries(Object.keys(rules).map(rule => [rule, 'off']))
      };
    })
  : [];

but that is dependent on assumptions about how ESLint is invoked and means ESLint believes suppressions can be pruned (which it will do if you run both --fix and --prune-suppressions); it also does not work for language services meaning applying fixes in IDEs will fix suppressed errors.