Skip to content

Commit

Permalink
fix: make warning optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Koreil authored and koreil committed Jan 9, 2019
1 parent 8c0719f commit e667e72
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

const SHOW_MISSING = process.env.SHOW_MISSING;

const path = require('path'),
bn = require('@bem/naming'),
BemCell = require('@bem/cell'),
Expand Down Expand Up @@ -137,10 +139,10 @@ module.exports = function(source, inputSourceMap) {
(existsEntities[BemEntityName.create({ block, elem }).id] = true);
});

Object.keys(existsEntities).forEach(fileId => {
SHOW_MISSING && Object.keys(existsEntities).forEach(fileId => {
// check if entity has no tech to resolve
existsEntities[fileId] || errEntities[fileId].forEach(file => {
this.emitError(`BEM module not found: ${file.path}`);
this.emitWarning(`BEM module not found: ${file.path}`);
});
});

Expand Down

0 comments on commit e667e72

Please sign in to comment.