eslint-disable
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

eslint-disable

Travis build status Coveralls NPM version Canonical Code Style Twitter Follow

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.

Readme

Keywords

Package Sidebar

Install

npm i eslint-disable

Weekly Downloads

121

Version

1.0.2

License

BSD-3-Clause

Unpacked Size

8.71 kB

Total Files

10

Last publish

Collaborators

  • gajus