Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@putout/plugin-reuse-duplicate-init

coderaiser43.3kMIT6.0.0

🐊Putout plugin adds ability to reuse duplicate init

putout, putout-plugin, putout-plugin-reuse, plugin, reuse, init

readme

@putout/plugin-reuse-duplicate-init NPM version

Functions are one of the fundamental building blocks it contains set of statements that performs a calculations, takes some input and returns an output. To use a function, you must define it somewhere in the scope from which you wish to call it.

(c) MDN

🐊Putout plugin adds ability to reuse duplicate init.

Install

npm i @putout/plugin-reuse-duplicate-init -D

Rule

{
    "rules": {
        "reuse-duplicate-init": "on"
    }
}

❌ Example of incorrect code

const putout = require('putout');

const {
    a,
    b,
    operator,
} = require('putout');

const {replaceWith} = operator;

✅ Example of correct code

const putout = require('putout');

const {
    a,
    b,
    operator,
} = putout;

const {replaceWith} = operator;

License

MIT