Index: chrome/browser/resources/gulpfile.js |
diff --git a/chrome/browser/resources/gulpfile.js b/chrome/browser/resources/gulpfile.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a50c1a4e02ce88c30e22ad24b5f7f80736ca15a0 |
--- /dev/null |
+++ b/chrome/browser/resources/gulpfile.js |
@@ -0,0 +1,22 @@ |
+const eslint = require('eslint'); |
+const gulp = require('gulp'); |
+const nopt = require('nopt'); |
+ |
+gulp.task('lint', () => { |
+ const options = nopt({ |
+ 'filter': [String, null], |
+ 'fix': [Boolean, null], |
+ }); |
+ const srcPattern = options.filter ? `${options.filter}/**/*.js` : '**/*.js'; |
+ |
+ const CLIEngine = eslint.CLIEngine; |
+ const cli = new CLIEngine({ |
+ fix: options.fix || false, |
+ }); |
+ const report = cli.executeOnFiles([srcPattern]); |
+ const formatter = cli.getFormatter(); |
+ console.log(formatter(report.results)); |
+ |
+ if (options.fix) |
+ CLIEngine.outputFixes(report); |
+}); |