@putout/plugin-convert-to-arrow-function

putout plugin adds ability to convert anonymous to arrow function

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@putout/plugin-convert-to-arrow-function
46403.0.02 years ago3 years agoMinified + gzip package size for @putout/plugin-convert-to-arrow-function in KB

Readme

putout plugin convert anonymous to arrow function.

Install

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

Rule

{
    "rules": {
        "convert-to-arrow-function": true
    }
}

❌ Incorrect code example

module.exports = function(a, b) {
}

function x() {
    return function(a) {
        return b;
    }
}

✅ Correct code Example

module.exports = (a, b) => {
}

function x() {
    return (a) => {
        return b;
    }
}

License

MIT