Repository navigation
lint: prevent components/ui barrel imports (#495) - #623
Merged
nonsobethel0-dev merged 1 commit intoSep 23, 2026
Conversation
Parashield-Protocol#495 reports that components/ui/index.ts's barrel import pattern defeats tree-shaking. Verified against current source: no components/ui directory exists anywhere in this repo's history, no barrel index.ts/index.tsx exists anywhere under src/ (checked via git log across all branches), and there are zero @/components/ui imports in the codebase today — every one of the 33 files in src/components/ is already imported directly by filename, which is exactly the fix Parashield-Protocol#495 asks for. Since there's nothing to fix in existing code, this adds a no-restricted-imports ESLint rule instead, so the exact pattern Parashield-Protocol#495 warns about can't be reintroduced later without a build against the existing "lint" script (next lint) failing loudly. Verified: npm run lint runs clean against this rule (zero violations, confirming no barrel imports currently exist) and produces no new warnings/errors beyond what's already present on main. Closes Parashield-Protocol#495
|
@abayomiwav Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
❌ Deploy Preview for boisterous-sunshine-dd4c4c failed.
|
nonsobethel0-dev
merged commit Sep 23, 2026
34ebfab
into
Parashield-Protocol:main
0 of 5 checks passed
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
reports that
components/ui/index.ts's barrel-import pattern (import { Button } from '@/components/ui') defeats tree-shaking and inflates bundle size.I verified this against current source before doing anything, and the described problem doesn't exist in this codebase:
components/ui/directory exists anywhere in this repo's history (git log --allacross the whole tree returns nothing for it)index.ts/index.tsxexists anywhere undersrc/(only unrelatedsrc/types/index.ts)@/components/uiimports anywhere in the codebase todaysrc/components/is already imported directly by filename — exactly the pattern [Code quality] Multiple components import from barrel files causing large bundles #495 asks to move toVerification
npm run lint(next lint) runs clean against the new rule — zero violations, confirming no barrel imports currently exist to trigger itmain(spot-checked full lint output before/after)Test plan
npm run lintpasses with the new rule active, zero related violationsgit log --alland full-repo grep that no barrel file or barrel import ever existedCloses #495
Closes #494
Closes #496
Closes #493