contentlayerdev / contentlayerdev/contentlayer

TS should not allow adding additional properties to field definitions

Open
#224 0 comments 1 reaction 0 assignees View on GitHub
help wanted meta: never-stale needs-research topic: schema topic: typescript
Dominant language
TypeScript
Stars
3.5k
Forks
192
PR merge metrics
No merged PRs in 30d

Description

When I'm configuring a field definition, I can add any random property without warning or error. Ideally a situation like this would throw a TS error:

![image](https://user-images.githubusercontent.com/5245089/168885495-e4e0ffd1-c5e9-4658-b1ea-6580e9540eee.png)

Contributor guide

Open the contributing guide

Research direction

No file, test, or entry point is named. Locate the TypeScript definitions for field configurations, then add a regression test showing that an unsupported property produces a type error; done means valid field definitions still type-check while random additional properties do not.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.