unicorn/consistent-destructuring seems to trigger in multiple scenarios. We would ideally be able to control which specific cases are active.
For example this seems to always be good
function example(o) {
const { a } = o;
console.log(a);
// Please do complain that I've already got a const for a π
console.log(o.a);
}
This scenario in particular I don't like, and would want to turn off:
class Example {
example() {
const { a } = this; // rule wants me to write const { a, expensive } = this
if (a) {
// this.expensive is not being consistently destructured
// but i don't want to call the expensive getter unnecessarily in the const above
console.log(this.expensive);
}
}
get expensive() {
// Something that requires significant compute
}
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too