6.1.0 β’ Published 11 months ago
@putout/plugin-apply-shorthand-properties v6.1.0
@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
6.1.0
11 months ago
6.0.1
11 months ago
6.0.0
11 months ago
5.1.1
2 years ago
5.1.0
2 years ago
5.0.0
2 years ago
4.0.0
2 years ago
3.0.2
4 years ago
3.0.1
5 years ago
3.0.0
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.6.0
6 years ago
1.5.0
6 years ago
1.4.0
6 years ago
1.3.0
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago