-
Notifications
You must be signed in to change notification settings - Fork 186
Closed as not planned
Labels
Description
Summary
In PR #2348, we added ESLint rules to prohibit re-exports (both export * and export { ... } from) except in index.ts files. However, two files had existing re-export violations and were temporarily excluded from these rules.
Files with temporary exclusions
Currently excluded from the no-restricted-syntax rule in frontend/internal-packages/configs/eslint/base.js:
**/DropdownMenu/DropdownMenu.tsx- Re-exports Radix UI components**/parser.ts- Re-exports from parser/index.js
Tasks to complete
- Refactor
DropdownMenu.tsx: Move re-exports to an appropriateindex.tsfile or refactor the component to import directly rather than re-export - Refactor
parser.ts: Move re-exports to an appropriateindex.tsfile or refactor to import directly rather than re-export - Remove temporary exclusions: Once the above files are refactored, remove the exclusion rules from
frontend/internal-packages/configs/eslint/base.js - Test: Verify that
pnpm lintpasses without errors after removing the exclusions
Context
The ESLint rules were added to enforce a consistent pattern where:
- Re-exports should only be used in
index.tsfiles (for creating public APIs) - Regular files should import and use modules directly rather than re-exporting them
This helps maintain cleaner module boundaries and makes it easier to understand the codebase's dependency structure.
Acceptance criteria
- All re-export violations in the excluded files are resolved
- The temporary exclusions are removed from the ESLint configuration
- All linting passes without errors
- The refactored code maintains the same public API and functionality
Related
- Original PR: feat: add no-restricted-exports ESLint rule to prohibit re-exports except in index.ts #2348
- ESLint config:
frontend/internal-packages/configs/eslint/base.js