#72
Make type and interface declaration/export predicates consistent
declareTypes, declareInterfaces, exportTypes, and exportInterfaces do not apply the type-versus-interface distinction consistently: declareTypes accepts aliases and interfaces, declareInterfaces is strict, exportTypes accepts type-only exports, and exportInterfaces may accept any type-only export or re-export without proving that it is an interface.
Relevant files:
packages/konsistent/src/typescript/predicates/declare-types.tspackages/konsistent/src/typescript/predicates/declare-interfaces.tspackages/konsistent/src/typescript/predicates/export-types.tspackages/konsistent/src/typescript/predicates/export-interfaces.tspackages/konsistent/src/typescript/parser.ts
Possible solutions:
- Strictly distinguish type aliases from interfaces for both declaration and export predicates.
- Treat “type” as an umbrella covering aliases and interfaces everywhere, then remove or deprecate the interface-specific predicates.
Backward compatibility: internal names and documentation can be renamed or removed without compatibility shims. For any konsistent.json predicate changes, keep the old predicate names and behaviors available as deprecated and emit a non-failing CLI warning whenever they are used.
Activity
0No activity yet.