@putout/plugin-convert-assignment-to-arrow-function
🐊Putout plugin adds ability convert assignment to arrow function
Last updated a year ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @putout/plugin-convert-assignment-to-arrow-function 
SYNC missed versions from official npm registry.

@putout/plugin-convert-assignment-to-arrow-function NPM version

The assignment operator (=) is used to assign a value to a variable. The assignment operation evaluates to the assigned value. Chaining the assignment operator is possible in order to assign a single value to multiple variables.

Merged to @putout/plugin-assignment.

An arrow function expression is a compact alternative to a function expression.

(c) MDN

????Putout plugin adds ability to convert assignment to arrow function.

Install

npm i @putout/plugin-convert-assignment-to-arrow-function -D

Rule

{
    "rules": {
        "convert-assignment-to-arrow-function": "on"
    }
}

❌ Example of incorrect code

const createRegExp = a = RegExp(a, 'g');

✅ Example of correct code

const createRegExp = (a) => RegExp(a, 'g');

License

MIT

Current Tags

  • 1.2.2                                ...           latest (a year ago)

5 Versions

  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (0)
None
Dev Dependencies (7)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |