MCPcopy Index your code
hub / github.com/prettydiff/prettydiff / lintit

Function lintit

services.ts:2689–2725  ·  view source on GitHub ↗
(val:string)

Source from the content-addressed store, hash-verified

2687 first:boolean = false;
2688 const len = list.length,
2689 lintit = function node_apps_build_lint_lintrun_lintit(val:string):void {
2690 console.log(`${apps.humantime(false)}Starting lint: ${val}`);
2691 filesRead = filesRead + 1;
2692 node.child(`eslint ${val}`, {
2693 cwd: projectPath
2694 }, function node_apps_build_lint_lintrun_lintit_eslint(err:Error, stdout:string, stderr:string) {
2695 if (stdout === "" || stdout.indexOf("0:0 warning File ignored because of a matching ignore pattern.") > -1) {
2696 if (err !== null) {
2697 apps.errout([err.toString()]);
2698 return;
2699 }
2700 if (stderr !== null && stderr !== "") {
2701 apps.errout([stderr]);
2702 return;
2703 }
2704 filesLinted = filesLinted + 1;
2705 if (first === false) {
2706 first = true;
2707 console.log("");
2708 }
2709 console.log(`${apps.humantime(false) + text.green}Lint ${filesLinted} passed:${text.none} ${val}`);
2710 if (filesRead === filesLinted) {
2711 console.log("");
2712 if (callback !== undefined) {
2713 callback(`${text.green}Lint complete for ${filesLinted} files!${text.none}`);
2714 } else {
2715 console.log(`${text.green}Lint complete for ${filesLinted} files!${text.none}`);
2716 }
2717 return;
2718 }
2719 } else {
2720 console.log(stdout);
2721 apps.errout(["Lint failure."]);
2722 return;
2723 }
2724 })
2725 };
2726 console.log(`${apps.humantime(false)}Linting files...`);
2727 console.log("");
2728 do {

Callers 1

lintrunFunction · 0.85

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected