šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

eslint-plugin-no-arrow-labels

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-plugin-no-arrow-labels

ESLint rule to disallow labels in arrow function bodies

0.1.2
latest
Source
npm
Version published
Maintainers
1
Created
Source

eslint-plugin-no-arrow-labels

An ESLint rule to disallow label statements inside arrow function bodies.

Helps avoid the common error of omitting parens when returning object literals from arrow functions using the concise syntax. E.g., params => { object: literal }

See MDN's notes on returning object literals from arrow functions

Note: You should probably just disallow labeled statements everywhere.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-no-arrow-labels:

$ npm install eslint-plugin-no-arrow-labels --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-no-arrow-labels globally.

Usage

Add no-arrow-labels to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "no-arrow-labels"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "no-arrow-labels": 2
    }
}

Keywords

eslint

FAQs

Package last updated on 12 Sep 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