@putout/plugin-apply-shorthand-properties

putout plugin adds ability to apply shorthand properties

Usage no npm install needed!

<script type="module">
  import putoutPluginApplyShorthandProperties from 'https://cdn.skypack.dev/@putout/plugin-apply-shorthand-properties';
</script>

README

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

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"
    ]
}

❌ Incorrect code example

const AUTH_SESSION = 'xx';

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

✅ Correct code Example

const type = 'xx';

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

License

MIT