eslint-plugin-no-explicit-type-exports
eslint-plugin-no-explicit-type-exports copied to clipboard
Refactor and add full import export support
What changed
- Added support for detecting imports that use
asTypesyntaximport {example as Example}->import type { example as Example }- included two tests
- Added support for detecting locally declared types/interfaces:
type example = string; export type exampletype example = string; export example->type example = string; export type example- included two tests
- Added more explicit type annotations (including
LintContexttype and return types that were missing) - Added a
getTypeDeclarations.tsto support linting for locally declared types/interfaces - Added a helper function to avoid DRY badness when searching for aliased imports/exports in arrays/sets
- Interfaces used in tests are now properly Pascal-cased
- Some minor cleanups of files here and there
Why
- The lint plugin had no support for types that are aliased using
asTypesyntax - The plugin didn't support types that were locally declared and then not explicitly exported as types
- There were multiple usages of
anytype annotations which is discouraged - Interfaces should be Pascal-cased
Todo:
- [ ] Add Semantic Version Label
- [x] Add tests
- [ ] Add docs
One more minor regression to fix before I can mark this as ready.
Running through our codebase I missed another scenario. Marking as draft.