1.3.5 • Published 3 years ago

@putout/operator-add-argument v1.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@putout/operator-add-argument NPM version

putout operator adds ability to add-argument variable that was not defined before. Renamed to @putout/operator-add-args.

Install

npm i putout @putout/operator-add-argument

API

If you want to create putout plugin that will add-argument variables according to your needs just:

const {operator} = require('putout');

const {addArgument} = operator;

module.exports = addArgument({
    comparePlaces: ['{comparePlaces}', 'test("__a", (__args) => __body)'],
});

If you have a file index.spec.js:

-test('', () => {
+test('', ({comparePlaces}) => {
    comparePlaces();
});

Plugin supports options, so you can pass it in .putout.json:

{
    "rules": {
        "tape/declare-t": ["on", {
            "declarations": {
                "comparePlaces": ["{comparePlaces}", "test('__a', (__args) => __body)"]
            }
        }]
    }
}

License

MIT

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago