eslint-plugin-no-arrow-labels v0.1.2
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-devNext, install eslint-plugin-no-arrow-labels:
$ npm install eslint-plugin-no-arrow-labels --save-devNote: 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
}
}