Skip to content

Commit

Permalink
fix unexpected eslint error with eol-last rule
Browse files Browse the repository at this point in the history
cherry-pick and squash of es-analysis#200 by @JSlain
- Fix Issue es-analysis#198
- Fix test
  • Loading branch information
JSlain authored and kyungilpark committed Jun 28, 2019
1 parent 7c7a112 commit 2c2e09c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/plato.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ exports.inspect = function(files, outputDir, options, done) {

var fileShort = file.replace(commonBasePath, '');
var fileSafe = fileShort.replace(/[^a-zA-Z0-9]/g,'_');
var source = fs.readFileSync(file).toString().trim();
if (!source) {
var source = fs.readFileSync(file).toString();
if (!source.trim()) {
log.info('Not parsing empty file "%s"', file);
return;
}

// if skip empty line option
if(options.noempty) {
source = source.replace(/^\s*[\r\n]/gm ,"");
source = source.replace(/^\s*[\r\n]/gm ,"").trim();
}

// if begins with shebang
Expand Down

0 comments on commit 2c2e09c

Please sign in to comment.