GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: add -F flag for fixing lint issues · nodejs/node@08e0884

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tools
    • jslint.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tools/jslint.js‎

Copy file name to clipboardExpand all lines: tools/jslint.js
+13-2Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ const CLIEngine = require('./eslint').CLIEngine;
1313
const glob = require('./eslint/node_modules/glob');
1414

1515
const cwd = process.cwd();
16-
const cli = new CLIEngine({
16+
const cliOptions = {
1717
rulePaths: rulesDirs
18-
});
18+
};
19+
20+
// Check if we should fix errors that are fixable
21+
if (process.argv.indexOf('-F') !== -1)
22+
cliOptions.fix = true;
23+
24+
const cli = new CLIEngine(cliOptions);
1925

2026
if (cluster.isMaster) {
2127
var numCPUs = 1;
@@ -240,6 +246,11 @@ if (cluster.isMaster) {
240246
if (files instanceof Array) {
241247
// Lint some files
242248
const report = cli.executeOnFiles(files);
249+
250+
// If we were asked to fix the fixable issues, do so.
251+
if (cliOptions.fix)
252+
CLIEngine.outputFixes(report);
253+
243254
if (config.sendAll) {
244255
// Return both success and error results
245256

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.