@putout/plugin-apply-shorthand-properties
v7.4.0
Published
🐊Putout plugin adds ability to apply shorthand properties
Maintainers
Readme
@putout/plugin-apply-shorthand-properties 
🐊Putout plugin adds ability to apply shorthand properties.
Install
npm i @putout/plugin-apply-shorthand-properties -DConfig
{
"rules": {
"apply-shorthand-properties": ["on", {
"ignore": [],
"rename": false
}]
},
"plugins": [
"apply-shorthand-properties"
]
}With default options
❌ Example of incorrect code
import {'b' as b} from 'b';
const {a: a} = b;✅ Example of correct code
import {b} from 'b';
const {a} = b;When rename enabled
❌ 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,
});Comparison
Linter | Rule | Fix
--------|-------|------------|
🐊 Putout | apply-shorthand-properties | ✅
⏣ ESLint | no-useless-rename | ❌
License
MIT
