kentcdodds / kentcdodds/babel-plugin-preval

Writing preval files in TypeScript

Open
#106 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.4k
Forks
48
PR merge metrics
No merged PRs in 30d

Description

When using `// @preval` at the top of the file, it's first evaluated in Node.js. This means that TypeScript has no idea what's going on. If I leave these files as vanilla JS (`.js`) it's okay (the import gets an `any` type in TS), but then we don't get the advantages of TypeScript.

Can I write preval files themselves in TypeScript? Maybe with ts-node?

Contributor guide

Open the contributing guide

Research direction

No files or tests are named. Start by locating the @preval evaluation path and its Node.js execution boundary, then determine how TypeScript-authored preval files would be handled; done means the requested TypeScript workflow works and is covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.