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

eslint-plugin-prefer-arrow

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-prefer-arrow

Prefer arrow functions in most cases

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
372K
decreased by-53.66%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-prefer-arrow

ESLint plugin to prefer arrow functions. By default, the plugin allows usage of function as a member of an Object's prototype.

The purpose of this plugin is to encourage cleaner code by using arrow functions, keeping scope and usage of this very clear.

Installation

Install the npm package

# If npm is installed globally
npm install -g eslint-plugin-prefer-arrow

# If npm is installed locally
npm install -D eslint-plugin-prefer-arrow

Add the plugin to the plugins section in your .eslintrc

"plugins": [
  "prefer-arrow"
],
"rules": [
  "prefer-arrow/prefer-arrow-functions": [
     "warn",
     {
       "disallowPrototype": true
     }
   ]
]

Configuration

There is currently only one configuration option, disallowPrototype. If set to true, the plugin will warn if function is used anytime. Otherwise, the plugin allows usage of function if it is a member of an Object's prototype.

Keywords

FAQs

Package last updated on 23 Feb 2017

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