Skip to content

Add disableFix secondary option to configuration object #5431

@kuangrs

Description

@kuangrs

What is the problem you're trying to solve?

Sometimes we need find error which should not be automatically fixed, or it was automatically fixed by mistake, instead, we want to fix it manually. So if closing autofix by passing property like disableFix in secondaryOptions will be very helpful

What solution would you like to see?

Add support for closing autofix by passing property like disableFix in secondaryOptions

in file lib/lintPostcssResult.js (stylelint version 13.13.1), line 105

fix:
stylelintOptions.fix &&
// Next two conditionals are temporary measures until #2643 is resolved
isFileFixCompatible &&
!postcssResult.stylelint.disabledRanges[ruleName],
change like this

ruleFunction(primaryOption, secondaryOptions, {
  fix:
      // Add support for closing autofix by passing property like `disableFix` in secondaryOptions
      !secondaryOptions.disableFix && 
      stylelintOptions.fix &&
      // Next two conditionals are temporary measures until #2643 is resolved
      isFileFixCompatible &&
      !postcssResult.stylelint.disabledRanges[ruleName],
   newline,
})(postcssRoot, postcssResult),

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions