Socket
Socket
Sign inDemoInstall

eslint-plugin-no-arrow-labels

Package Overview
Dependencies
88
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

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


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Install size
3.32 kB
Created
Weekly downloads
 

Readme

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

FAQs

Last updated on 12 Sep 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc