@mattlewis92/eslint-plugin-disable-autofix

3.0.0 • Public • Published

eslint-plugin-disable-autofix

Disable ESLint autofix (--fix) for specified rules and prevent them from being formatted without turning them off

Useful when two different rules have the same solution resulting in duplicate formatting

Usage

Install

npm i -D eslint-plugin-disable-autofix

Configure

Add prefix disable-autofix/ to the rule name in eslintrc and disable the original

module.exports = {
  plugins: ['disable-autofix'],
  rules: {
    'prefer-const': 'off',
    'disable-autofix/prefer-const': 'error',
  },
};

Use 3rd-party plugins

module.exports = {
  plugins: ['disable-autofix', 'react'],
  rules: {
    'react/jsx-indent': 'off',
    'disable-autofix/react/jsx-indent': 'error',
  },
};

Use scoped plugins

module.exports = {
  plugins: ['disable-autofix', '@html-eslint'],
  rules: {
    '@html-eslint/require-closing-tags': 'off',
    'disable-autofix/@html-eslint/require-closing-tags': [
      'error',
      { selfClosing: 'always' },
    ],
  },
};

Resources

Package Sidebar

Install

npm i @mattlewis92/eslint-plugin-disable-autofix

Weekly Downloads

7

Version

3.0.0

License

MIT

Unpacked Size

7.61 kB

Total Files

6

Last publish

Collaborators

  • mattlewis92