rusackas opened a new pull request, #38145:
URL: https://github.com/apache/superset/pull/38145
## Summary
This PR enables 17 new oxlint rules that enforce JavaScript/TypeScript best
practices. These rules were either already satisfied (zero violations) or had
small numbers of auto-fixable violations.
### Zero-violation rules (enabled as errors)
| Rule | Description |
|------|-------------|
| `eslint/no-useless-constructor` | Empty constructors that can be removed |
| `eslint/no-else-return` | Unnecessary else after return |
| `eslint/no-array-constructor` | Use `[]` instead of `new Array()` |
| `eslint/no-new-wrappers` | Don't use `new String/Number/Boolean()` |
| `eslint/no-regex-spaces` | Use `{n}` instead of multiple spaces in regex |
| `eslint/no-object-constructor` | Use `{}` instead of `new Object()` |
| `unicorn/no-length-as-slice-end` | Don't pass `.length` to `.slice()` end |
| `unicorn/no-useless-spread` | Remove unnecessary spreads |
| `unicorn/no-thenable` | Don't export `.then` on non-Promises |
| `unicorn/escape-case` | Consistent escape character casing |
### Auto-fixed rules (small number of violations)
| Rule | Fixes | Description |
|------|-------|-------------|
| `unicorn/prefer-array-flat-map` | 11 | Use `.flatMap()` instead of
`.map().flat()` |
| `unicorn/prefer-array-some` | 13 | Use `.some()` instead of `.findIndex()
!== -1` |
| `unicorn/throw-new-error` | 6 | Use `throw new Error()` not `throw
Error()` |
| `unicorn/prefer-negative-index` | 1 | Use `.at(-1)` for negative indices |
| `unicorn/prefer-math-trunc` | 1 | Use `Math.trunc()` instead of `| 0` |
Also adds the `oxc` plugin to enable additional rule coverage (179 → 205
rules).
## Test plan
- [x] `npm run lint` passes with 0 errors
- [x] Pre-commit hooks pass
- [ ] CI passes
🤖 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]