prefer-ternary
currently only supports
'simple' if-else statements, where 'simple' means the consequent and alternate are each one line and have the same basic type and form.
Would it be possible to also detect the following example?:
const data = getData();
const defaultData = getDefaultData();
let items = defaultData;
if (data.length) {
items = data;
}
const data = getData();
const defaultData = getDefaultData();
const items = data.length ? data : defaultData;
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