feat(flow): flow type definition for 'stderr'
This commit is contained in:
parent
35bebfa849
commit
48d8210536
2 changed files with 10 additions and 0 deletions
5
stderr.js.flow
Normal file
5
stderr.js.flow
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// @flow strict
|
||||
|
||||
import { Chalk } from './index';
|
||||
|
||||
declare module.exports: Chalk;
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
// @flow
|
||||
import chalk from '..';
|
||||
import cherr from '../stderr';
|
||||
|
||||
// $ExpectError (Can't have typo in option name)
|
||||
chalk.constructor({levl: 1});
|
||||
|
|
@ -13,6 +14,10 @@ new chalk.constructor({enabled: true});
|
|||
chalk.underline(null);
|
||||
chalk.underline('foo');
|
||||
|
||||
// $ExpectError (Can't pass in null)
|
||||
cherr.underline(null);
|
||||
cherr.underline('foo');
|
||||
|
||||
// $ExpectError (Can't have typo in chalk method)
|
||||
chalk.rd('foo');
|
||||
chalk.red('foo');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue