(argv: ArgumentsResolver<CommandParameters>)
| 18 | } |
| 19 | |
| 20 | async function lintCheck(argv: ArgumentsResolver<CommandParameters>) { |
| 21 | const configPath = await maybeSetupPrettier(); |
| 22 | const prettierConfig = await getPrettierConfig(configPath); |
| 23 | await maybeSetupEslint(); |
| 24 | |
| 25 | console.log(`Using config at: ${wrapInColor(configPath, ANSI_COLORS.GREEN_COLOR)}\n`); |
| 26 | |
| 27 | const filePaths = argv.getArgument('files'); |
| 28 | |
| 29 | if (filePaths === undefined || prettierConfig === null) { |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | const results: FileLintStatus[] = await checkAndFormatFiles(filePaths, prettierConfig); |
| 34 | |
| 35 | // Output list of files and their status |
| 36 | printStatus(results, argv.getArgument('showSkipped')); |
| 37 | |
| 38 | // TODO (yhuang6): Implement the following |
| 39 | // Default checks changed files based on git |
| 40 | // Default checks the current directory otherwise |
| 41 | } |
| 42 | |
| 43 | export const command = 'check [files..]'; |
| 44 | export const describe = 'Checks the file formatting and lint rules'; |
nothing calls this directly
no test coverage detected