lint: introduce type import/exports checks
Author: HotellCreated May 13, 2024Updated Sep 29, 2026
LabelsArea: Build SystemFluent UI react-components (v9)Resolution: Soft CloseArea: Linting
1. introduce type import/export lint rules for v9
- https://typescript-eslint.io/rules/consistent-type-imports/
- https://typescript-eslint.io/rules/consistent-type-exports
2. implement custom rule to disallow usage of inline type import/export
After investigation of "consistent-type-exports" rule, it wont prevent usage of inline type exports ecport {type A} from '...' -> ts-eslint team doesn't support old TS versions https://github.com/typescript-eslint/typescript-eslint/issues/7524.
We have 2 options: - bump v9 minbar to 4.5 - write custom rule that will dissallow any inline type imports/exports
❌ incorrect code
import { type A } from './foo';
export { type B} from './moo';✅ correct code
import type { A } from './foo'
export type { B } from './moo';Related issues:
- Originally posted by @Hotell in https://github.com/microsoft/fluentui/pull/31328#discussion_r1596438780
- https://github.com/microsoft/fluentui/issues/32968
Source: microsoft/fluentui