()
| 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 |
no test coverage detected