HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
codemix
babel-plugin-typecheck
JavaScript2015–2016
codemix / babel-plugin-typecheck

babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.

3Distinct people
5Mentions
0Explicit recommenders
879GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Static and runtime type checking for JavaScript in the form of a Babel plugin.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 12:24:10 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month5 dated mentions

Observed mentions: 2015-05-19 21:47:53 UTC to 2016-10-03 16:28:30 UTC.

012015-05-01 00:00:00 UTC to 2015-06-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMay 20152015-06-01 00:00:00 UTC to 2015-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-07-01 00:00:00 UTC to 2015-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-08-01 00:00:00 UTC to 2015-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-09-01 00:00:00 UTC to 2015-10-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-10-01 00:00:00 UTC to 2015-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-11-01 00:00:00 UTC to 2015-12-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2015-12-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2016-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJan 20162016-02-01 00:00:00 UTC to 2016-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-03-01 00:00:00 UTC to 2016-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-04-01 00:00:00 UTC to 2016-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-05-01 00:00:00 UTC to 2016-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-06-01 00:00:00 UTC to 2016-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-07-01 00:00:00 UTC to 2016-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-08-01 00:00:00 UTC to 2016-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-09-01 00:00:00 UTC to 2016-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-10-01 00:00:00 UTC to 2016-11-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsOct 2016

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
May 20152015-05-01 00:00:00 UTC2015-06-01 00:00:00 UTC101
Jun 20152015-06-01 00:00:00 UTC2015-07-01 00:00:00 UTC000
Jul 20152015-07-01 00:00:00 UTC2015-08-01 00:00:00 UTC000
Aug 20152015-08-01 00:00:00 UTC2015-09-01 00:00:00 UTC000
Sep 20152015-09-01 00:00:00 UTC2015-10-01 00:00:00 UTC101
Oct 20152015-10-01 00:00:00 UTC2015-11-01 00:00:00 UTC101
Nov 20152015-11-01 00:00:00 UTC2015-12-01 00:00:00 UTC101
Dec 20152015-12-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
Jan 20162016-01-01 00:00:00 UTC2016-02-01 00:00:00 UTC000
Feb 20162016-02-01 00:00:00 UTC2016-03-01 00:00:00 UTC000
Mar 20162016-03-01 00:00:00 UTC2016-04-01 00:00:00 UTC000
Apr 20162016-04-01 00:00:00 UTC2016-05-01 00:00:00 UTC000
May 20162016-05-01 00:00:00 UTC2016-06-01 00:00:00 UTC000
Jun 20162016-06-01 00:00:00 UTC2016-07-01 00:00:00 UTC000
Jul 20162016-07-01 00:00:00 UTC2016-08-01 00:00:00 UTC000
Aug 20162016-08-01 00:00:00 UTC2016-09-01 00:00:00 UTC000
Sep 20162016-09-01 00:00:00 UTC2016-10-01 00:00:00 UTC000
Oct 20162016-10-01 00:00:00 UTC2016-11-01 00:00:00 UTC101

What Hacker News says

5 sources
Cool article. I'm the author of https://github.com/codemix/babel-plugin-typecheck mentioned and the next version of the plugin (WIP) takes this kind of approach, so that you can reference a type at runtime: type User = {name: string, isAdmin: boolean}; // compiles to const User = t.object( t.property('name', t.string()), t.property('isAdmin', t.boolean()) ); // which you can then use with User.check({name: 'Alice'}); // boolean User.assert({nom: false}); // throws Ultimately it should be possible to use this to implement pattern matching in JS based on flow types, for example: type User = { name: string; roles: Role[]; }; type Role = { id: number; name: string; users: User[] }; const url = match(someInput, (user: User) => `/users/${user.
Read the rest
name}`, (role: Role) => `/roles/${role.id}`, (_) => `/` // default URL ); The really hard thing is to do this whilst maintaining perfect compatibility with flow.
In Runtime Introspection of Flow Types in JS
No love for react-devtools [0]? I'm amazed it wasn't even an honorable mention, considering he mentioned react and redux (which is probably generally used with react). I'm also surprised he didn't mention flowtype [1], which is by Facebook and is supported by Babel! If you're writing React, you're probably already using Babel, so using flow is very low friction. Furthermore, if you're interested in runtime assertions, you can use babel-plugin-typecheck [2], which will convert your flowtype annotations into assertions. If we're looking to be pragmatic, IMO, this is the optimal path to take. The library that Elliot is working on looks interesting, but even he recognizes in its page that it's still a work-in-progress. If you're writing a modern JS app and you wanna take advantage of all the ES6 goodies, you'll pick up babel. And if you're us
Read the rest
ing babel, you can get jsx and flowtype for free. It's ridiculous to try and build a JS app without some sort of bundler, whether it's browserify or webpack. And if you're gonna use a bundler, pulling in a transpiler like babel is really easy and it lets you write much saner code. Oh, and if you're already drinking the Facebook kool-aid with react, jsx, and flowtype, you'll wanna give nuclide a shot. As I understand it, it has nice flow support, with stuff like "click-to-define" and inline linting [3]. I'm using flowtype annotations with the babel plugin I mentioned above, but due to my usage of non-standard features, I can't successfully run flow itself over my codebase. I'll also note that my experience with nuclide when I last tried it was underwhelming. [0] https://github.com/facebook/react-devtools/ [1] http://flowtype.org/ [2] https://github.com/codemix/babel-plugin-typecheck [3] http://nuclide.io/docs/flow/
In Must-See JavaScript Dev Tools
I feel like I can somewhat relate, I've been adding flowtype [0] annotations to my JS code, which is transpiled with babel. However, since I'm using unsupported ES2015 features and experimental ES2016+ features, it fails to run over my code (which is completely understandable). The workaround I've found is to use a plugin [1], which converts the type annotations into runtime checks. It's not perfect, but I've found it helps catch some bugs quickly. It's also really helpful for documentation purposes: you know that this function param takes a number param, if you're not passing in a number you've made a mistake. Also, having the inline type is nicer than having it in a jsdoc-style comment above. I think there's diminishing returns as you add more annotations to your code and you make them stricter, but having basic sanity checks has been h
Read the rest
elpful in catching stupid mistakes quickly. [0] http://flowtype.org/ [1] https://github.com/codemix/babel-plugin-typecheck
In Why we’re no longer using Core.typed

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.