Socket
Book a DemoInstallSign in
Socket

eslint-disable

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-disable

Disables ESLint plugins.

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

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.

Keywords

eslint

FAQs

Package last updated on 22 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts