Skip to content

Commit

Permalink
warning: Add types checking for warning package
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Jan 14, 2020
1 parent 25dfd7f commit 44cdafe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/warning/babel-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
*/
const pkg = require( './package.json' );

/**
* Babel plugin which transforms `warning` function calls to wrap within a
* condition that checks if `process.env.NODE_ENV !== 'production'`.
*
* @param {import('@babel/core')} babel Current Babel object.
*
* @return {import('@babel/core').PluginObj} Babel plugin object.
*/
function babelPlugin( { types: t } ) {
const seen = Symbol();

Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"./packages/is-shallow-equal/**/*.js",
"./packages/priority-queue/**/*.js",
"./packages/token-list/**/*.js",
"./packages/url/**/*.js"
"./packages/url/**/*.js",
"./packages/warning/**/*.js",
],
"exclude": [
"./packages/*/benchmark",
Expand Down

0 comments on commit 44cdafe

Please sign in to comment.