Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-shadow-exception

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-shadow-exception

Allows to set a whitelist of variable names that you can shadow for ESLint "no-shadow"

  • 1.1.3
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ESLint-plugin-shadow-exception

Description

This plugin allows you to have the ESLint rule no-shadow with a whitelist of variable names. While it is highly encouraged to not shadow any variables, I believe it is better to allow some exception than to force developpers to plainly disable the rule if they have some cases where they don't care.

You can see an interesting discussion about this on ESLint #1613

Installation

Install ESLint either locally or globally

$ npm install eslint

The plugin must be installed globally if ESLint is installed globally too.

$ npm install eslint-plugin-shadow-exception

Configuration

Add plugins sections and specify ESLint-plugin-shadow-exception as a plugin.

{
  "plugins": [
    "shadow-exception"
  ]
}

Then configure the rule. Note you must disable ESLint "no-shadow" rule.

{
  "rules": {
    "shadow-exception/no-shadow": [2, {
      //default values
      "exceptions": {
        "err": true
      }
    }],
    "no-shadow": 0
  }
}

"err": false will forbid shadowing of variables named err.

The options is structured this way so you can overwrite/add variable names depending on the location of your .eslintrc

Keywords

FAQs

Package last updated on 30 Oct 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc