$ npm install @putout/plugin-apply-shorthand-properties
πPutout plugin adds ability to apply shorthand properties.
npm i @putout/plugin-apply-shorthand-properties -D
{
"rules": {
"apply-shorthand-properties": ["on", {
"ignore": [],
"rename": false
}]
},
"plugins": [
"apply-shorthand-properties"
]
}
import {'b' as b} from 'b';
const {a: a} = b;
import {b} from 'b';
const {a} = b;
rename enabledconst AUTH_SESSION = 'xx';
export const setSession = (session) => ({
type: AUTH_SESSION,
payload: session,
});
const type = 'xx';
export const setSession = (payload) => ({
type,
payload,
});
| Linter | Rule | Fix |
|---|---|---|
| π Putout | apply-shorthand-properties |
β |
| β£ ESLint | no-useless-rename |
β |
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE