eslint-plugin-curry

0.1.0 • Public • Published

eslint-plugin-curry

styled with prettier

Installation

Install ESLint either locally or globally. Install eslint-plugin-curry.

With Yarn:

$ yarn add -D eslint eslint-plugin-curry

Or, if you prefer npm:

$ npm install --save-dev eslint eslint-plugin-curry

Configuration

Add a plugins section and specify eslint-plugin-curry as a plugin.

{
  "plugins": [
    "curry"
  ]
}

Enable the rules.

Rules

arrow-parens

This rule works like vanilla arrow-parens, but provides an additional setting for functions that use currying.

/* eslint curry/arrow-parens: [2, "as-needed", { "requireForBlockBody": true, "curry": "never" }] */
// bad
const fn = (x) => x
const fn = x => {}
const fn = (x) => (y) => (z) => {}
 
// good
const fn = x => x
const fn = (x) => {}
const fn = x => y => z => {}
/* eslint curry/arrow-parens: [2, "as-needed", { "curry": "always" }] */
// bad
const fn = (x) => x
const fn = (x) => {}
const fn = x => y => z => {}
 
// good
const fn = x => x
const fn = x => {}
const fn = (x) => (y) => (z) => {}

Package Sidebar

Install

npm i eslint-plugin-curry

Weekly Downloads

6

Version

0.1.0

License

MIT

Last publish

Collaborators

  • akxcv