UNPKG

@ycmd/commands

Version:

LSK.js CLI Creds is the easiest way to manage GitHub / Gitlab secrets and credentials

9 lines (7 loc) 1.92 kB
import { existsSync } from 'node:fs'; import { join } from 'node:path'; import { isCI, isDev, createCommand, shellParallel, findBin, shell } from 'ycmd'; var a={watch:{alias:"w",describe:"monitor files for changes",type:"boolean",default:!1},prod:{alias:"p",describe:"enable code optimization for production",type:"boolean",default:!1},silent:{alias:["s","q","quiet"],describe:"run in silent mode, show errors only",type:"boolean",default:!1},exec:{alias:"e",describe:"executes after compilation",type:["boolean","string"],default:!1},dry:{alias:["d","dry-run","without-publish"],describe:"run in dry mode, without publishing",type:"boolean",default:!1},dist:{describe:"specify the output directory",type:"string"},force:{alias:["f"],describe:"force to run",type:"boolean",default:!1},dts:{describe:"generate dts files",type:"boolean",default:!0},yes:{alias:["y"],describe:"automatically say yes to all prompts",type:"boolean",default:!1},bail:{alias:"b",describe:"stop running after the first failure",type:"boolean",default:!1},clean:{alias:"c",describe:"clean the output directory before building",type:"boolean",default:!1}};var n={isSilent:!!+process.env.YCMD_SILENT||isCI,isBail:isCI,isProd:!!+process.env.YCMD_PROD||!isDev,isCjs:!0,libDir:"lib",cjsDir:"cjs"};var B=createCommand({command:"test:eslint [--fix] [-s]",describe:"run ESLint on the source files",builder:e=>e.options({silent:a.silent,fix:{describe:"Automatically fix problems.",type:"boolean",default:!1}}),async main({isRoot:e,ctx:t,argv:s,log:f,cwd:d}){if(e){await shellParallel("ycmd test:eslint",{ctx:t,argv:s});return}let{silent:c=n.isSilent,fix:p=!1}=s;if(!existsSync(join(d,"src"))){f.debug("[skip] src folder not found - eslint skiped ");return}let i=`${findBin("eslint")} src`;c&&(i+=" --quiet"),p&&(i+=" --fix"),await shell(i,{ctx:t});}}); export { B as default }; //# sourceMappingURL=out.js.map //# sourceMappingURL=test-eslint.js.map