5.0.1 • Published 1 year ago

eslint-plugin-disable-autofix v5.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

eslint-plugin-disable-autofix

Disable autofix for ESLint rules and prevent them from being formatted without having to turn them off.

Usage

Install

npm i -D eslint-plugin-disable-autofix

Configure

Import and include disable-autofix in the plugins object

Add prefix disable-autofix/ to the rule and disable the original

import disableAutofix from 'eslint-plugin-disable-autofix';

export default [
  {
    plugins: {
      'disable-autofix': disableAutofix,
    },
    rules: {
      'prefer-const': 'off',
      'disable-autofix/prefer-const': 'warn',
    },
  },
];

Using 3rd-party Rules

import disableAutofix from 'eslint-plugin-disable-autofix';
import react from 'eslint-plugin-react';

export default [
  {
    plugins: {
      'disable-autofix': disableAutofix,
      react,
    },
    rules: {
      'react/jsx-indent': 'off',
      'disable-autofix/react/jsx-indent': 'error',
    },
  },
];

Using Scoped Rules

import disableAutofix from 'eslint-plugin-disable-autofix';
import htmlEslint from '@html-eslint/eslint-plugin';

export default [
  {
    plugins: {
      'disable-autofix': disableAutofix,
      '@html-eslint': htmlEslint,
    },
    rules: {
      '@html-eslint/require-closing-tags': 'off',
      'disable-autofix/@html-eslint/require-closing-tags': [
        'error',
        { selfClosing: 'always' },
      ],
    },
  },
];

Configure Legacy

Include disable-autofix in the eslintrc plugins array

Add prefix disable-autofix/ to the rule and disable the original

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

Using 3rd-party Rules

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

Using Scoped Rules

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

1 year ago

5.0.0

1 year ago

4.3.0

1 year ago

4.2.0

1 year ago

4.0.6

2 years ago

4.1.0

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.13.0

3 years ago

2.11.0

3 years ago

2.3.0

3 years ago

2.12.0

3 years ago

2.2.0

3 years ago

2.5.0

3 years ago

2.10.0

3 years ago

2.4.0

3 years ago

2.7.0

3 years ago

2.6.0

3 years ago

2.9.0

3 years ago

2.8.0

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago