🐊Putout plugin adds ability to apply shorthand properties
npm install @putout/plugin-apply-shorthand-properties[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-shorthand-properties.svg?style=flat&longCache=true
[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-shorthand-properties "npm"
🐊Putout plugin adds ability to apply shorthand properties.
```
npm i @putout/plugin-apply-shorthand-properties -D
`json`
{
"rules": {
"apply-shorthand-properties": ["on", {
"ignore": [],
"rename": false
}]
},
"plugins": [
"apply-shorthand-properties"
]
}
`js
import {'b' as b} from 'b';
const {a: a} = b;
`
`js
import {b} from 'b';
const {a} = b;
`
enabled`js
const AUTH_SESSION = 'xx';
export const setSession = (session) => ({
type: AUTH_SESSION,
payload: session,
});
`
`js
const type = 'xx';
export const setSession = (payload) => ({
type,
payload,
});
`
Linter | Rule | Fix
--------|-------|------------|
🐊 Putout | apply-shorthand-properties | ✅
⏣ ESLint | no-useless-rename` | ❌
MIT