Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: chrome/browser/resources/gulpfile.js

Issue 2589333004: WebUI: Experimenting with ESLint, WIP. (Closed)
Patch Set: More relaxing Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/.eslintrc.js ('k') | chrome/browser/resources/package.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+});
« no previous file with comments | « chrome/browser/resources/.eslintrc.js ('k') | chrome/browser/resources/package.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698