eslint-disable
v1.0.2
Published
Disables ESLint plugins.
Downloads
382
Readme
eslint-disable
Disables ESLint plugins.
Motivation
Sometimes you may need to disable an entire ESLint plugin, e.g. for performance reasons.
API
import {
extractConfig,
disablePlugins,
} from 'eslint-disable';
/**
* @param eslintConfig ESLint base configuration. This configuration may extend from other configurations.
* @returns ESLint configuration with resolved extends directives.
*/
extractConfig(
eslintConfig,
);
/**
* @param Object eslintConfig ESLint base configuration.
* @param string[] Plugin names.
* @returns Object ESLint configuration with matching plugins and rules disabled.
*/
disablePlugins(
eslintConfig,
pluginNames,
);
Usage
In your .eslintrc.js
:
const {
extractConfig,
disablePlugins,
} = require('eslint-disable');
const baseConfig = {
'extends': [
'canonical'
],
'root': true,
};
// This will disable "import" plugin and all rules matching "import/*" pattern.
module.exports = disablePlugins(
extractConfig(
baseConfig,
),
[
'import',
]
);
ESLint Issue
Native ESLint support has been proposed on several occasions. However, thus far it has been ignored.
- https://github.com/eslint/eslint/issues/14026