vercel-labs / vercel-labs/konsistent

Make type and interface declaration/export predicates consistent

Open
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
176
Forks
6
Avg merge
20h 26m
Merged PRs (30d)
11

Description

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.ts
  • packages/konsistent/src/typescript/predicates/declare-interfaces.ts
  • packages/konsistent/src/typescript/predicates/export-types.ts
  • packages/konsistent/src/typescript/predicates/export-interfaces.ts
  • packages/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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the four predicate files and packages/konsistent/src/typescript/parser.ts to compare declaration and export behavior. Resolve whether types include interfaces or whether aliases and interfaces stay distinct, then verify the selected behavior and the stated deprecated-name and CLI-warning requirements.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.