Repository navigation
fix(lint): enforce import/no-named-as-default as an error - #46317
Merged
Merged
Conversation
Fifty-eight imports bound a module's default export under the same name as one of its named exports (`import Chart from 'src/types/Chart'` while the module also exports `Chart`). Each of those modules ends with `export default <SameName>`, so the default and named bindings are identical; switch the imports to the named form and raise the rule from "warn" to "error" so the pattern cannot accumulate again. The default exports are left in place, so external consumers are unaffected. Fixes #45258 Co-authored-by: Haseeb702 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
9 tasks
Contributor
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Rename redux-mock-store and jquery default imports flagged by import/no-named-as-default, and point the SemanticRequestView spies at the CodeSyntaxHighlighter named export that the component now imports. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #46317 +/- ##
==========================================
+ Coverage 85.44% 85.46% +0.01%
==========================================
Files 3101 3101
Lines 213763 213829 +66
Branches 50459 50493 +34
==========================================
+ Hits 182658 182744 +86
+ Misses 27678 27658 -20
Partials 3427 3427
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ests Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aminghadersohi
self-requested a review
November 21, 2026 16:39
aminghadersohi
approved these changes
Nov 21, 2026
aminghadersohi
left a comment
Contributor
There was a problem hiding this comment.
Each switched import binds the same object as the old default, and the rule lints clean at error.
Nit: The description says only 58 internal hits remain, but base has 100: 42 upstream (redux-mock-store, jquery, geostyler) fixed by renaming.
zsspan
approved these changes
Nov 23, 2026
9 tasks
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
Supersedes #45446.
import/no-named-as-defaultwas downgraded to"warn"insuperset-frontend/oxlint.jsonby #43587, after the oxlint 1.79.0 bump began enforcing the rule and surfaced 94 pre-existing hits (39 of themredux-mock-store, plusjqueryand other upstream default imports). Since then the upstream cases are gone: on master with oxlint 1.92.0 (the locked version) the rule reports 58 hits in 51 files, all on internal modules that export a symbol by name and end withexport default <SameName>;— for examplesrc/types/Chart.ts(export interface Chart/export default Chart),@superset-ui/core/components/Table(export function Table/export default Table) and@superset-ui/core/components/CodeSyntaxHighlighter. Each importer bound the default under the named export's name.This PR switches those 58 imports to the named form (
import Chart from 'src/types/Chart'→import { Chart } from 'src/types/Chart') and raises the rule to"error"so the pattern cannot accumulate again. Because the default and named bindings are the same object in every case, there is no runtime change. The default exports are left in place, so external plugins and consumers that default-import these components keep working.TESTING INSTRUCTIONS
From
superset-frontend/:npm run lint— exits 0 with the rule at"error".oxlint.json) and runnpm run lintagain: it fails with 58import(no-named-as-default)errors.npm run typeandnpm run test— no type or test regressions in the touched files.ADDITIONAL INFORMATION
import/no-named-as-default#45258🤖 Generated with Claude Code