Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

ESLint plugin+rule to suggest arrow functions over function expressions as array elements.

License

Notifications You must be signed in to change notification settings

miangraham/eslint-plugin-prefer-arrow-in-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-prefer-arrow-in-array

An ESLint plugin+rule to suggest arrow functions over function expressions as array elements.

Made for a project that's still using async.waterfall. (Don't do this. Use async/await instead.)

Quick hacky fork of prefer-arrow-callback from the ESLint core rules.

Original author: Toru Nagashima. Original LICENSE (MIT) preserved.

Configuration

.eslintrc additions:

---
plugins:
    - prefer-arrow-in-array
rules:
    - prefer-arrow-in-array/prefer-arrow-in-array: error

Disallowed

async.waterfall([
  function (next) {
    const foo = 'bar';
    return next(null, foo);
  },
  // ...
],
  // ...
);

Allowed (autofixed)

async.waterfall([
  next => {
    const foo = 'bar';
    return next(null, foo);
  },
  // ...
],
  // ...
);

About

ESLint plugin+rule to suggest arrow functions over function expressions as array elements.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published