Jest: Add flow types for libraries

Created on 5 May 2017  路  5Comments  路  Source: facebook/jest

Get the flow coverage up by adding types for chalk and friends.

good first issue

Most helpful comment

@thymikee I would like to take up this one!

All 5 comments

@thymikee I would like to take up this one!

I hacked out a little script this afternoon to try and detect untyped node modules in a project (unless I've missed it, I can't see a similar feature on the flow-cli?). It's far from perfect and still needs work, so it has probably missed some modules / maybe has some false positives, but as a starting point here's a list of potentially untyped node modules in the Jest repo (some of these most likely don't need typing, like the babel / eslint packages).

ansi-regex

ansi-styles

babel-core

babel-eslint

babel-plugin-istanbul

babel-plugin-jest-hoist

babel-preset-jest

babylon

browser-resolve

callsites

chalk

diff

eslint-config-fbjs

eslint-plugin-babel

eslint-plugin-jest

fb-watchman

glob

halk

is-builtin-module

is-ci

istanbul-api

istanbul-lib-coverage

istanbul-lib-instrument

istanbul-lib-source-maps

jsdom

micromatch

node-notifier

once

p-map

pify

pretty-format

repl

sane

slash

string-length

throat

which

worker-farm

yargs

@scottrangerio I am working on chalk I will raise a PR soon!

Awesome, I've done ones for is-ci, slashand micromatch. Pretty new to writing lib defs so I wanted to start with a few easy/small ones before potentially moving on to bigger ones ^.^. My micromatchone still needs a little work, it covers all usage in the jestcodebase but the options parameter the various functions take are just typed as Objects currently, so I still need to type them when I get a chance.

looks like chalk types are in flow-typed directory already

Was this page helpful?
0 / 5 - 0 ratings