$ npm install @putout/plugin-remove-useless-computed
The object initializer syntax also supports computed property names. That allows you to put an expression in square brackets
[], that will be computed and used as the property name.(c) MDN
πPutout plugin adds ability to remove useless computed.
Checkout in πPutout Editor.
npm i @putout/plugin-remove-useless-computed
{
"rules": {
"remove-useless-computed": "on"
}
}
export const replace = {
['section("@select", select(__args))']: ({__args}, path) => {
__args.unshift(identifier('id'));
return path;
},
};
export const replace = {
'section("@select", select(__args))': ({__args}, path) => {
__args.unshift(identifier('id'));
return path;
},
};
| Linter | Rule | Fix |
|---|---|---|
| π Putout | remove-useless-computed |
β |
| β£ ESLint | no-useless-computed-key |
β |
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE