5.1.1 β’ Published 8 months ago
@putout/plugin-apply-shorthand-properties v5.1.1
@putout/plugin-apply-shorthand-properties
π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