quick-lint-js
quick-lint-js copied to clipboard
10$: Suggest computed property on template literal as object key
The following is invalid:
let bar = 'bar';
let baz = 'baz';
let o = {
`foo`: true,
`x${bar}`: true,
`${baz}`: true,
};
We should diagnose the template keys and suggest using a computed property instead:
let bar = 'bar';
let o = {
[`foo`]: true,
[`x${bar}`]: true,
[baz]: true,
};
Extra credit:
i would like to work on it , @strager can you please assign it to me ?
can you please assign it to me ?
Sure!
If you want payment, make sure you follow the instructions on https://quick-lint-js.com/hiring/.