bikash-barnwal opened a new pull request, #43198:
URL: https://github.com/apache/superset/pull/43198

   ### SUMMARY
   
   #42981 reports that warn-level rules stopped showing up in the tech-debt 
series, and proposes dropping `--quiet`. Investigating it turned up a different 
cause — the metrics path already runs oxlint **without** `--quiet`:
   
   ```js
   // scripts/oxlint-metrics-uploader.js
   execSync('npx oxlint --config oxlint.json --format json', …)
   ```
   
   The actual defect is one line down. The rule id is extracted with a regex 
that only matches eslint's own namespace:
   
   ```js
   /^(?:eslint(?:-plugin-(\w+))?\()([^)]+)\)$/
   ```
   
   oxlint reports every rule as `<plugin>(<rule>)`. A full run on master 
produces **1477 diagnostics**, of which **1094** carry a code this regex cannot 
match:
   
   | code | count | recorded as | should be |
   |---|---|---|---|
   | `eslint(prefer-destructuring)` | 570 | `prefer-destructuring` ✓ | — |
   | `react-hooks(exhaustive-deps)` | 383 | `react-hooks(exhaustive-deps)` | 
`react-hooks/exhaustive-deps` |
   | `react(no-unstable-nested-components)` | 151 | raw code | 
`react/no-unstable-nested-components` |
   | `eslint(no-console)` | 135 | `no-console` ✓ | — |
   | `react(jsx-key)` | 80 | raw code | `react/jsx-key` |
   | `jest(no-conditional-expect)` | 68 | raw code | 
`jest/no-conditional-expect` |
   | `react-hooks(rules-of-hooks)` | 47 | raw code | 
`react-hooks/rules-of-hooks` |
   
   So those rules **were** being uploaded — under a different key than the one 
the same rules used before the eslint→oxlint migration. That is why the series 
look like they stopped at a value rather than continued: the rows kept arriving 
under a new name.
   
   The fix extracts the parsing into `parseRuleId`, handles any plugin 
namespace, keeps eslint's own rules bare so their history stays continuous, and 
still collapses the legacy `eslint-plugin-x(...)` spelling to `x/...`. The 
script now only lints and uploads when executed rather than imported 
(`require.main === module`), so the behavior is testable without spawning a 
real lint run.
   
   This does not change what `npm run lint` gates on — whether the warn-level 
rules should fail CI is the larger conversation the issue itself flags, and is 
left alone here.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Not applicable — CI metrics script.
   
   ### TESTING INSTRUCTIONS
   
   ```bash
   cd superset-frontend
   npm run test -- spec/scripts/oxlint-metrics-uploader.test.js
   ```
   
   4 tests covering eslint rules staying bare, plugin rules mapping to 
`plugin/rule`, the legacy `eslint-plugin-` prefix, and unparseable/missing 
codes passing through instead of being dropped. All 4 fail against the old 
regex.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: Addresses #42981
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 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