|
1 | 1 | import { eslintFix } from "./command/eslint-fix";
|
2 | 2 | import type { CAC } from "cac";
|
3 | 3 |
|
4 |
| -import { cleanUpDirs, cwd, esLintOptions, gitCommitScopes, gitCommitTypes } from "./shared/config"; |
| 4 | +import { |
| 5 | + cleanUpDirs, |
| 6 | + cwd, |
| 7 | + esLintOptions, |
| 8 | + gitCommitScopes, |
| 9 | + gitCommitTypes, |
| 10 | +} from "./shared/config"; |
5 | 11 | import { SetupSet } from "./shared/types";
|
6 | 12 |
|
7 | 13 | import { gitCommitVerify } from "./command/git-commit-verify";
|
@@ -62,16 +68,19 @@ export const setupSet: SetupSet = {
|
62 | 68 | },
|
63 | 69 | eslintFix: (cli: CAC) => {
|
64 | 70 | cli
|
65 |
| - .command("lint", "Inspected the code and try to fix it.") |
| 71 | + .command("lint", "Inspecte the code and try to fix it.") |
66 | 72 | .option("--eslintrc <file>", "eslintrc file", {
|
67 | 73 | default: esLintOptions.eslintrc,
|
68 | 74 | })
|
69 |
| - .option("--path <path>", "inspected path", { |
| 75 | + .option("--path <path>", "Inspecte path", { |
70 | 76 | default: esLintOptions.paths,
|
71 | 77 | })
|
| 78 | + .option("--staged", "Inspecte staged files", { |
| 79 | + default: false, |
| 80 | + }) |
72 | 81 | .action(async (options) => {
|
73 |
| - const { eslintrc, path } = options; |
74 |
| - await eslintFix(cwd, { eslintrc, paths: path }); |
| 82 | + const { eslintrc, staged, path } = options; |
| 83 | + await eslintFix(cwd, { eslintrc, staged, paths: path }); |
75 | 84 | });
|
76 | 85 | },
|
77 | 86 | };
|
0 commit comments