@putout/plugin-apply-shorthand-properties

5.1.1 • Public • Published

@putout/plugin-apply-shorthand-properties NPM version

🐊Putout plugin adds ability to apply shorthand properties.

Install

npm i @putout/plugin-apply-shorthand-properties -D

Config

{
    "rules": {
        "apply-shorthand-properties": ["on", {
            "ignore": []
        }]
    },
    "plugins": [
        "apply-shorthand-properties"
    ]
}

❌ Example of incorrect code

const AUTH_SESSION = 'xx';

export const setSession = (session) => ({
    type: AUTH_SESSION,
    payload: session,
});

✅ Example of correct code

const type = 'xx';

export const setSession = (payload) => ({
    type,
    payload,
});

License

MIT

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i @putout/plugin-apply-shorthand-properties

    Weekly Downloads

    15,052

    Version

    5.1.1

    License

    MIT

    Unpacked Size

    5.27 kB

    Total Files

    4

    Last publish

    Collaborators

    • coderaiser