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
After migrating to oxlint in #1746, the correctness category is set to "off" with rules enabled explicitly. There are 7 default correctness rules that have violations and could not be enabled without code changes.
Goal
Fix the 39 lint violations and flip "correctness": "off" to "correctness": "error" in .oxlintrc.json, then remove the individual rule entries that are redundant with the category default.
Rules to enable (39 violations across ~10 files)
Rule
Violations
Description
no-unused-expressions
13
Ternaries and && used as statements instead of if
no-useless-fallback-in-spread
13
Unnecessary || {} in spread expressions
no-misused-spread
6
Spreading class instances or iterables in objects
no-meaningless-void-operator
4
void on already-void-returning calls
no-useless-length-check
2
Redundant .length > 0 before .some()
no-useless-default-assignment
1
Default value on non-nullish property
prefer-string-starts-ends-with
1
Use String#endsWith instead of substring comparison
After migrating to oxlint in #1746, the
correctnesscategory is set to"off"with rules enabled explicitly. There are 7 default correctness rules that have violations and could not be enabled without code changes.Goal
Fix the 39 lint violations and flip
"correctness": "off"to"correctness": "error"in.oxlintrc.json, then remove the individual rule entries that are redundant with the category default.Rules to enable (39 violations across ~10 files)
no-unused-expressions&&used as statements instead ofifno-useless-fallback-in-spread|| {}in spread expressionsno-misused-spreadno-meaningless-void-operatorvoidon already-void-returning callsno-useless-length-check.length > 0before.some()no-useless-default-assignmentprefer-string-starts-ends-withString#endsWithinstead of substring comparisonApproach
Most fixes are mechanical:
cond ? doA() : doB()→if (cond) { doA() } else { doB() }x && doSomething()→if (x) { doSomething() }...(value || {})→...value(spreading falsy is safe)void fn()→fn()(when fn already returns void).length > 0 && .some(...)→.some(...)Important
If you are interested in working on this issue, please leave a comment.
Tip
Please use a 👍 reaction to provide a +1/vote. This helps the community and maintainers prioritize this request.