MCPcopy Create free account
hub / github.com/Snapchat/Valdi / lintCheck

Function lintCheck

npm_modules/cli/src/commands/lint_commands/lintCheck.ts:20–41  ·  view source on GitHub ↗
(argv: ArgumentsResolver<CommandParameters>)

Source from the content-addressed store, hash-verified

18}
19
20async 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
43export const command = 'check [files..]';
44export const describe = 'Checks the file formatting and lint rules';

Callers

nothing calls this directly

Calls 8

maybeSetupPrettierFunction · 0.90
getPrettierConfigFunction · 0.90
maybeSetupEslintFunction · 0.90
wrapInColorFunction · 0.90
checkAndFormatFilesFunction · 0.90
printStatusFunction · 0.90
logMethod · 0.65
getArgumentMethod · 0.45

Tested by

no test coverage detected