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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/.eslintrc.js ('k') | chrome/browser/resources/package.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 const eslint = require('eslint');
2 const gulp = require('gulp');
3 const nopt = require('nopt');
4
5 gulp.task('lint', () => {
6 const options = nopt({
7 'filter': [String, null],
8 'fix': [Boolean, null],
9 });
10 const srcPattern = options.filter ? `${options.filter}/**/*.js` : '**/*.js';
11
12 const CLIEngine = eslint.CLIEngine;
13 const cli = new CLIEngine({
14 fix: options.fix || false,
15 });
16 const report = cli.executeOnFiles([srcPattern]);
17 const formatter = cli.getFormatter();
18 console.log(formatter(report.results));
19
20 if (options.fix)
21 CLIEngine.outputFixes(report);
22 });
OLDNEW
« 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