Skip to content

Commit

Permalink
[fix] fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed May 18, 2018
1 parent acf96e2 commit 49fcb09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/fileExistsWithCaseSync.js
@@ -1,10 +1,10 @@
var fs = require('fs');
var path = require('path');
const fs = require('fs');
const path = require('path');

// Based on https://stackoverflow.com/questions/27367261/check-if-file-exists-case-sensitive
export default function fileExistsWithCaseSync(filepath) {
var dir = path.dirname(filepath);
if (dir === '/' || dir === '.') return true;
var filenames = fs.readdirSync(dir);
return filenames.indexOf(path.basename(filepath)) !== -1;
}
const dir = path.dirname(filepath);
if (dir === '/' || dir === '.') return true;
const filenames = fs.readdirSync(dir);
return filenames.indexOf(path.basename(filepath)) !== -1;
}
2 changes: 2 additions & 0 deletions src/optimize.js
Expand Up @@ -18,6 +18,7 @@ function validateAndFix(opts) {
typeof opts.plugins === 'undefined' ||
(Array.isArray(opts.plugins) && opts.plugins.length === 0)
) {
/* eslint no-param-reassign: 1 */
opts.plugins = [...essentialPlugins];
return;
}
Expand All @@ -39,6 +40,7 @@ function validateAndFix(opts) {
// make it essential
if (!p[k]) p[k] = true;
// and update state
/* eslint no-param-reassign: 1 */
state[k] = true;
}
});
Expand Down

0 comments on commit 49fcb09

Please sign in to comment.