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

Function lintrun

services.ts:2683–2734  ·  view source on GitHub ↗
(list:directoryList)

Source from the content-addressed store, hash-verified

2681 }
2682 (function node_apps_build_lint_getFiles():void {
2683 const lintrun = function node_apps_build_lint_lintrun(list:directoryList) {
2684 let filesRead:number = 0,
2685 filesLinted:number = 0,
2686 a:number = 0,
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 {
2729 if (list[a][1] === "file" && (/\.js$/).test(list[a][0]) === true) {
2730 lintit(list[a][0]);
2731 }
2732 a = a + 1;
2733 } while (a < len);
2734 };
2735 console.log(`${apps.humantime(false)}Gathering JavaScript files from directory: ${text.green + lintpath + text.none}`);
2736 apps.directory({
2737 callback: lintrun,

Callers

nothing calls this directly

Calls 1

lintitFunction · 0.85

Tested by

no test coverage detected