oxc
oxc copied to clipboard
linter: few incorrect fixes
What version of Oxlint are you using?
0.16.5
What command did you run?
oxlint --fix --fix-suggestions --quiet
What happened?
Here some diffing I've seen erroneous:
no-plus-plus => Issue with nested var
- varA.varB++;
+ varB += 1;
no-else-return => Issue with comment & indent
return something;
- } else {
- // this comment get dropped
- return value;
}
+ return value;
no-else-return => Issue with indent & new line
return something;
- } else if (isSomehtingElse) {
+ } if (isSomehtingElse) {
prefer-array-some && no-extra-boolean-cast => Did not remove the Boolean cast
- return Boolean(items.find((item) => item.isNew));
+ return Boolean(items.some((item) => item.isNew));
unicorn/require-post-message-target-origin => MessagePort has postMessage but should not get location.origin as 2nd arg
export function getPostMessage(port: MessagePort): <T>(message: T) => void {
- return <T>(message: T) => port.postMessage(message);
+ return <T>(message: T) => port.postMessage(message, port.location.origin);
}