MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / _runLintFix

Method _runLintFix

packages/cli/lib/base-generator.js:448–465  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

446 }
447
448 async _runLintFix() {
449 if (this.options.format) {
450 const pkg = this.packageJson || {};
451 if (pkg.scripts && pkg.scripts['lint:fix']) {
452 this.log(g.f("Running 'npm run lint:fix' to format the code..."));
453 await this._runNpmScript(this.destinationRoot(), [
454 'run',
455 '-s',
456 'lint:fix',
457 ]);
458 } else {
459 this.log(
460 chalk.red(g.f("No 'lint:fix' script is configured in package.json.")),
461 );
462 }
463 }
464 process.exit(0);
465 }
466
467 /**
468 * Print out the exit reason if this generator is told to exit before it ends

Callers 1

endMethod · 0.95

Calls 3

_runNpmScriptMethod · 0.95
exitMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected