You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/02/11 08:03:27 UTC

[PR] chore(lint): enforce stricter eslint/oxlint rules [superset]

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

   ### SUMMARY
   Upgrade several lint rules from warn to error, reducing tech debt and enforcing better code practices. This PR cleans up the single violation of each rule in the codebase.
   
   ### Rules upgraded from warn → error
   
   | Rule | Fix Applied |
   |------|-------------|
   | `constructor-super` | eslint-disable (intentional pattern in ExtensibleFunction) |
   | `no-alert` | eslint-disable with TODO (SqlEditorTabHeader uses native prompt) |
   | `react/no-danger` | eslint-disable with safety comments (all uses are sanitized) |
   | `react/forbid-foreign-prop-types` | (no violations found) |
   | `unicorn/no-invalid-remove-event-listener` | Fixed by storing bound function reference |
   
   ### New rules added (set to error)
   - `react-you-might-not-need-an-effect/no-empty-effect`
   - `react-you-might-not-need-an-effect/no-pass-live-state-to-parent`  
   - `react-you-might-not-need-an-effect/no-initialize-state`
   
   ### Notable fix
   **SqlLab App component**: The `removeEventListener` was using `.bind(this)` which creates a new function reference each time, meaning the listener was never actually removed. Fixed by storing the bound function in the constructor.
   
   ### 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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(lint): enforce stricter eslint/oxlint rules [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #37883:
URL: https://github.com/apache/superset/pull/37883


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(lint): enforce stricter eslint/oxlint rules [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #37883:
URL: https://github.com/apache/superset/pull/37883#issuecomment-3882910447

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] chore(lint): enforce stricter eslint/oxlint rules [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #37883:
URL: https://github.com/apache/superset/pull/37883#issuecomment-3882914389

   ## **Sequence Diagram**
   
   This PR fixes a bug where window.removeEventListener failed because .bind(this) created new function references. The App now stores a bound handler in the constructor so add/removeEventListener use the same function reference, ensuring the listener is properly removed on unmount.
   
   ```mermaid
   sequenceDiagram
       participant Browser
       participant App
       participant BoundHandler as "App.boundOnHashChanged"
   
       Browser->>App: instantiate App()
       App-->>BoundHandler: store this.onHashChanged.bind(this)
       App->>Browser: window.addEventListener('hashchange', boundOnHashChanged) (componentDidMount)
       Browser->>App: hashchange event
       Browser->>BoundHandler: invoke boundOnHashChanged -> App.onHashChanged()
       App->>Browser: window.removeEventListener('hashchange', boundOnHashChanged) (componentWillUnmount)
   ```
   
   ---
   *Generated by [CodeAnt AI](https://codeant.ai)*
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org