rusackas opened a new pull request, #37884:
URL: https://github.com/apache/superset/pull/37884

   ### SUMMARY
   Second batch of lint rule upgrades from warn to error, continuing to reduce 
tech debt.
   
   ### Rules upgraded from warn → error
   
   | Rule | Fix Applied |
   |------|-------------|
   | `unicorn/no-useless-length-check` | Remove redundant `.length === 0` 
checks before `.every()` |
   | `no-constant-binary-expression` | Fix `Number(x) ?? 0` → `Number(x ?? 0)`, 
extract test booleans to variables |
   | `no-unsafe-optional-chaining` | Remove unnecessary `?.` on always-defined 
properties, use `!` assertion in tests |
   
   ### New rules added (set to error)
   - `storybook/prefer-pascal-case`
   - `react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change`
   - `react-you-might-not-need-an-effect/no-chain-state-updates`
   - `react-you-might-not-need-an-effect/no-event-handler`
   - `react-you-might-not-need-an-effect/no-derived-state`
   
   ### Notable fixes
   
   1. **Useless length check**: `arr.length === 0 || arr.every(...)` is 
redundant since `every()` returns `true` for empty arrays
   
   2. **Constant binary expression**: `Number(formData?.row_limit) ?? 0` never 
uses the fallback since `Number()` always returns a number (possibly NaN). 
Fixed to `Number(formData?.row_limit ?? 0)`
   
   3. **Unsafe optional chaining**: `window?.document?.documentElement` with 
destructuring is unsafe. In browser context, these are always defined, so 
removed the optional chaining.
   
   ### BEFORE/AFTER SCREENSHOTS OR COVERAGE
   N/A - lint configuration changes only
   
   ### TESTING INSTRUCTIONS
   1. Run `npx oxlint -c oxlint.json` - should have no errors for upgraded rules
   2. Run `npm run lint` - should pass
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to