🐊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;const 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