Skip to content

Comments

chore(frontend): enable additional oxlint rules for better code hygiene#38145

Merged
hainenber merged 5 commits intomasterfrom
chore/enable-additional-oxlint-rules
Feb 23, 2026
Merged

chore(frontend): enable additional oxlint rules for better code hygiene#38145
hainenber merged 5 commits intomasterfrom
chore/enable-additional-oxlint-rules

Conversation

@rusackas
Copy link
Member

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 `

Also adds the oxc plugin to enable additional rule coverage (179 → 205 rules).

Test plan

  • npm run lint passes with 0 errors
  • Pre-commit hooks pass
  • CI passes

🤖 Generated with Claude Code

@dosubot
Copy link

dosubot bot commented Feb 21, 2026

Related Documentation

Checked 0 published document(s) in 2 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 21, 2026

Code Review Agent Run #5f36b8

Actionable Suggestions - 0
Review Details
  • Files reviewed - 26 · Commit Range: c9929fc..c9929fc
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx
    • superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts
    • superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx
    • superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx
    • superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
    • superset-frontend/scripts/check-custom-rules.js
    • superset-frontend/src/SqlLab/reducers/getInitialState.ts
    • superset-frontend/src/components/DatabaseSelector/index.tsx
    • superset-frontend/src/components/GridTable/Header.tsx
    • superset-frontend/src/components/ListView/utils.ts
    • superset-frontend/src/components/MessageToasts/reducers.ts
    • superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/state.ts
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
    • superset-frontend/src/dashboard/util/getOverwriteItems.ts
    • superset-frontend/src/dashboard/util/isValidChild.test.ts
    • superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx
    • superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
    • superset-frontend/src/explore/components/controls/SelectControl.tsx
    • superset-frontend/src/views/CRUD/utils.tsx
  • Files skipped - 1
    • superset-frontend/oxlint.json - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot bot added the change:frontend Requires changing the frontend label Feb 21, 2026
@netlify
Copy link

netlify bot commented Feb 21, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 56e8e63
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/699b7faed1df450008b2f12b
😎 Deploy Preview https://deploy-preview-38145--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@rusackas rusackas requested a review from hainenber February 21, 2026 01:27
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 21, 2026

Code Review Agent Run #aa31d5

Actionable Suggestions - 0
Review Details
  • Files reviewed - 26 · Commit Range: c9929fc..5f2c356
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx
    • superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts
    • superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx
    • superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx
    • superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
    • superset-frontend/scripts/check-custom-rules.js
    • superset-frontend/src/SqlLab/reducers/getInitialState.ts
    • superset-frontend/src/components/DatabaseSelector/index.tsx
    • superset-frontend/src/components/GridTable/Header.tsx
    • superset-frontend/src/components/ListView/utils.ts
    • superset-frontend/src/components/MessageToasts/reducers.ts
    • superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/state.ts
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
    • superset-frontend/src/dashboard/util/getOverwriteItems.ts
    • superset-frontend/src/dashboard/util/isValidChild.test.ts
    • superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx
    • superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
    • superset-frontend/src/explore/components/controls/SelectControl.tsx
    • superset-frontend/src/views/CRUD/utils.tsx
  • Files skipped - 1
    • superset-frontend/oxlint.json - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

rusackas and others added 4 commits February 22, 2026 14:13
Enable 17 new oxlint rules that enforce best practices:

**Zero-violation rules (enabled as errors):**
- eslint/no-useless-constructor - Remove empty constructors
- 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
- 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

**Small fix rules (auto-fixed violations):**
- unicorn/prefer-array-flat-map - Use .flatMap() instead of .map().flat()
- unicorn/prefer-array-some - Use .some() instead of .findIndex() !== -1
- unicorn/throw-new-error - Use throw new Error() not throw Error()
- unicorn/prefer-negative-index - Use .at(-1) for negative indices
- unicorn/prefer-math-trunc - Use Math.trunc() instead of | 0

Also adds the oxc plugin to enable additional rule coverage (193 -> 205 rules).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The column key was using t('Main') (translated) while the data records
used a hard-coded "Main " prefix. In non-English locales this caused
empty cells because the table looked for translated keys that didn't
exist in the data.

Keep label translated for UI display, but use stable "Main " for the
key to match processComparisonDataRecords and processComparisonTotals.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…alStorage migration

Removes the reassignment that overwrote the backend-sourced
lastUpdatedActiveTab with the last entry from merged tabHistory.
This was breaking EditorAutoSync and persistSqlLabStateEnhancer
which rely on detecting when the active tab differs from
lastUpdatedActiveTab to push state to the backend.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ssigned

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rusackas rusackas force-pushed the chore/enable-additional-oxlint-rules branch from 5f2c356 to 56e8e63 Compare February 22, 2026 22:14
originalLabel,
label: t('Main'),
key: `Main ${col.key}`,
config: getComparisonColConfig('Main', col.key, columnConfig),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The comparison column config lookup for the "Main" column uses the hard-coded string 'Main' instead of the localized label used when generating column names in the control panel (t('Main')), so in non-English locales any custom column configuration (formatting, currency, etc.) for these "Main" comparison columns will never be matched or applied. [logic error]

Severity Level: Major ⚠️
- ⚠️ Main comparison columns ignore custom formatting in localized UIs.
- ⚠️ Main comparison columns cannot be hidden via column_config settings.
Suggested change
config: getComparisonColConfig('Main', col.key, columnConfig),
config: getComparisonColConfig(t('Main'), col.key, columnConfig),
Steps of Reproduction ✅
1. In Explore, create or edit a Table chart using the legacy table plugin
(`plugins/plugin-chart-table`) with time comparison enabled so `comparison_type ===
ComparisonType.Values` and `time_compare` is non-empty (checked in
`transformProps.ts:535-538`).

2. With the UI language set to a non-English locale, open the chart's Customize columns
control (`column_config` control defined in
`plugins/plugin-chart-table/src/controlPanel.tsx:556-649`).

3. For a metric like `metric_1`, configure formatting/visibility on its "Main" comparison
column; the control panel generates column_config keys using the localized label, e.g.
`${t('Main')} metric_1` in `generateComparisonColumns` at `controlPanel.tsx:158-166`, and
uses those names when building `column_config`.

4. Run the chart; `transformProps` (`transformProps.ts:490-795`) calls
`processComparisonColumns` (`transformProps.ts:382-467`), which creates a Main column with
`label: t('Main')` but looks up config via `getComparisonColConfig('Main', col.key,
columnConfig)` at `transformProps.ts:406`; `getComparisonColConfig`
(`transformProps.ts:340-347`) builds the key `${label} ${parentColKey}` which becomes
`'Main metric_1'` instead of the localized `${t('Main')} metric_1`, so it returns `{}` and
the custom column_config for the Main comparison column is never applied in non-English
locales.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
**Line:** 406:406
**Comment:**
	*Logic Error: The comparison column config lookup for the "Main" column uses the hard-coded string 'Main' instead of the localized label used when generating column names in the control panel (`t('Main')`), so in non-English locales any custom column configuration (formatting, currency, etc.) for these "Main" comparison columns will never be matched or applied.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 22, 2026

Code Review Agent Run #53d3d3

Actionable Suggestions - 0
Review Details
  • Files reviewed - 26 · Commit Range: 3b3568a..56e8e63
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx
    • superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts
    • superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx
    • superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx
    • superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
    • superset-frontend/scripts/check-custom-rules.js
    • superset-frontend/src/SqlLab/reducers/getInitialState.ts
    • superset-frontend/src/components/DatabaseSelector/index.tsx
    • superset-frontend/src/components/GridTable/Header.tsx
    • superset-frontend/src/components/ListView/utils.ts
    • superset-frontend/src/components/MessageToasts/reducers.ts
    • superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/state.ts
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
    • superset-frontend/src/dashboard/util/getOverwriteItems.ts
    • superset-frontend/src/dashboard/util/isValidChild.test.ts
    • superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx
    • superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
    • superset-frontend/src/explore/components/controls/SelectControl.tsx
    • superset-frontend/src/views/CRUD/utils.tsx
  • Files skipped - 1
    • superset-frontend/oxlint.json - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Feb 23, 2026

Code Review Agent Run #2a0e3e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 26 · Commit Range: 56e8e63..230f780
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/mixins.tsx
    • superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/ContentConfig.tsx
    • superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.tsx
    • superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts
    • superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx
    • superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx
    • superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-table/src/transformProps.ts
    • superset-frontend/scripts/check-custom-rules.js
    • superset-frontend/src/SqlLab/reducers/getInitialState.ts
    • superset-frontend/src/components/DatabaseSelector/index.tsx
    • superset-frontend/src/components/GridTable/Header.tsx
    • superset-frontend/src/components/ListView/utils.ts
    • superset-frontend/src/components/MessageToasts/reducers.ts
    • superset-frontend/src/dashboard/components/RefreshFrequency/RefreshFrequencySelect.tsx
    • superset-frontend/src/dashboard/components/nativeFilters/FilterBar/state.ts
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx
    • superset-frontend/src/dashboard/util/getOverwriteItems.ts
    • superset-frontend/src/dashboard/util/isValidChild.test.ts
    • superset-frontend/src/explore/components/controls/AnnotationLayerControl/AnnotationLayer.tsx
    • superset-frontend/src/explore/components/controls/SelectAsyncControl/index.tsx
    • superset-frontend/src/explore/components/controls/SelectControl.tsx
    • superset-frontend/src/views/CRUD/utils.tsx
  • Files skipped - 1
    • superset-frontend/oxlint.json - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@hainenber hainenber merged commit 672a380 into master Feb 23, 2026
80 of 81 checks passed
@hainenber hainenber deleted the chore/enable-additional-oxlint-rules branch February 23, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants