You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bunx oxlint@latest -D all -A no-unused-vars -A sort-keys -A no-null -A no-undefined -A explicit-function-return-type -A no-magic-numbers -A no-ternary -A no-explicit-any -A no-const-enum -A prefer-enum-initializers -A no-optional-chaining --ignore-pattern compliance
What does your .oxlint.json config file look like?
N/A
What happened?
While doing some linter testing on the https://github.com/angular/angular repository, I noticed that the no-else-return lint rule was correctly reporting an issue, but was reporting it for a line that is actually an else-if block.
× eslint(no-else-return): Unnecessary 'else' after 'return'.
╭─[devtools/projects/ng-devtools-backend/src/lib/state-serializer/prop-type.ts:48:7]
47 │ if (Array.isArray(prop)) {
48 │ return PropType.Array;
· ───────────┬──────────
· ╰── This consequent block always returns,
49 │ } else if (prop instanceof Set) {
· ───┬──
· ╰── Making this `else` block unnecessary.
50 │ return PropType.Set;
╰────
help: Remove the `else` block, moving its contents outside of the `if` statement.
I believe this is incorrect, because the following else is part of an if statement, so it doesn't matter if the prior if always returns. It should actually be reporting this code as the error, since all previous if statements return:
} else {
return PropType.Object;
}
The text was updated successfully, but these errors were encountered:
Ah actually I didn't read the configuration on this rule closely enough, it looks like it already allows for allowElseIf: true which would fix this. Looks to be working as intended.
What version of Oxlint are you using?
0.9.10
What command did you run?
bunx oxlint@latest -D all -A no-unused-vars -A sort-keys -A no-null -A no-undefined -A explicit-function-return-type -A no-magic-numbers -A no-ternary -A no-explicit-any -A no-const-enum -A prefer-enum-initializers -A no-optional-chaining --ignore-pattern compliance
What does your
.oxlint.json
config file look like?N/A
What happened?
While doing some linter testing on the https://github.com/angular/angular repository, I noticed that the
no-else-return
lint rule was correctly reporting an issue, but was reporting it for a line that is actually anelse-if
block.Specifically, this code:
is reported as:
I believe this is incorrect, because the following else is part of an
if
statement, so it doesn't matter if the priorif
always returns. It should actually be reporting this code as the error, since all previousif
statements return:The text was updated successfully, but these errors were encountered: