jethac opened a new issue, #42954:
URL: https://github.com/apache/superset/issues/42954

   ### Bug description
   
   `superset-frontend/scripts/oxlint-metrics-uploader.js` runs bare `npx 
oxlint`. The project's
   oxlint config is named `oxlint.json`, which is **not** the `.oxlintrc.json` 
filename oxlint
   auto-discovers, so the run silently falls back to oxlint's default ruleset. 
Every `lint` script in
   `package.json` passes `--config oxlint.json` explicitly; the metrics 
uploader does not.
   
   The numbers `tech-debt.yml` pushes to the tech-debt spreadsheet therefore 
describe a ruleset the
   project does not use.
   
   Measured on `master` @ `3b164e4`, oxlint 1.76.0:
   
   ```bash
   cd superset-frontend
   npx oxlint --format json | jq '.diagnostics | length'                       
%23 92
   npx oxlint --config oxlint.json --format json | jq '.diagnostics | length'  
%23 1470
   ```
   
   The first is what `runOxlintAndProcess()` executes.
   
   | | `npx oxlint` (what the uploader runs) | `npx oxlint --config 
oxlint.json` |
   |---|---|---|
   | total | **92** | **1470** |
   | top rule | `no-unused-vars` — 85 | `prefer-destructuring` — 567 |
   | | `erasing-op` 2, `no-control-regex` 2 | `react-hooks/exhaustive-deps` 381 
|
   | | `no-shadow-restricted-names` 1 | `react/no-unstable-nested-components` 
151 |
   | | `no-extra-boolean-cast` 1 | `no-console` 135 |
   | | `unicorn/no-useless-fallback-in-spread` 1 | `react/jsx-key` 80 |
   
   92% of the reported total is `no-unused-vars`, which `oxlint.json` sets to 
`off` — the tracked
   metric is dominated by a rule the project deliberately disabled. Meanwhile 
381
   `react-hooks/exhaustive-deps` and 47 `react-hooks/rules-of-hooks` never 
appear in the series at
   all. Those are correctness rules, not style: a missing dependency array is a 
stale closure.
   
   Expected: the uploader measures the ruleset the project actually lints with.
   Actual: it measures oxlint's defaults, and ~94% of the tracked total comes 
from a disabled rule.
   
   ### Screenshots/recordings
   
   Not applicable — no UI involved.
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   Not applicable
   
   ### Node version
   
   16 or greater
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   The fix is a single flag on the existing command line. Passing `--config 
oxlint.json` is preferable
   to renaming the file to `.oxlintrc.json`: the rename removes the whole class 
of bug, but churns
   every script and contributor habit, so it belongs in its own change if 
wanted.
   
   Note for whoever merges: the tracked total will step from ~92 to ~1470 on 
the first run afterwards.
   That is a measurement correction, not a regression — no new violations are 
introduced and no CI
   gate changes — and the changeover date is worth annotating in the sheet, 
which has no way to
   express a ruleset change. For the same reason, some earlier drops in that 
series coincide with
   rules leaving the tracker rather than with violations being fixed.
   
   Found with AI assistance (Devin); the counts above were measured locally on 
a checkout, not
   asserted by the model.
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [x] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.
   


-- 
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