UNPKG

@funish/basis

Version:

A unified development toolkit with CLI for package management, versioning, publishing, linting, and git hooks management for JavaScript/TypeScript projects.

2 lines (1 loc) 1.56 kB
import{defineCommand as a}from"citty";import{consola as n}from"consola";import{l as r,b as l,c,d as p,e as d,f as u}from"../shared/basis.BMtlh4_u.mjs";import"node:child_process";import"node:fs/promises";import"fast-glob";import"micromatch";import"nypm";import"pathe";import"pkg-types";import"../shared/basis.BrlVPuDi.mjs";import"c12";import"../config.mjs";const f=a({meta:{name:"lint",description:"Run comprehensive project linting and quality checks"},args:{staged:{type:"boolean",description:"Lint only staged files using configured commands",default:!1},project:{type:"boolean",description:"Run project-wide lint commands",default:!1},deps:{type:"boolean",description:"Check dependencies (outdated, security, blocked packages)",default:!1},structure:{type:"boolean",description:"Check project structure (required files/dirs, naming conventions)",default:!1},docs:{type:"boolean",description:"Check documentation (README, CHANGELOG)",default:!1},all:{type:"boolean",description:"Run all lint checks",default:!1},fix:{type:"boolean",description:"Automatically fix issues where possible",default:!1}},async run({args:t}){const e=process.cwd();let i=!0;if(!t.staged&&!t.project&&!t.deps&&!t.structure&&!t.docs&&!t.all&&(t.staged=!0),t.all)i=await r(e,t.fix);else{const o=[];t.staged&&o.push(()=>l(e)),t.project&&o.push(()=>c(e)),t.deps&&o.push(()=>p(e,void 0,t.fix)),t.structure&&o.push(()=>d(e,void 0,t.fix)),t.docs&&o.push(()=>u(e,void 0,t.fix));for(const s of o)await s()||(i=!1)}i||(n.error("Some lint checks failed"),process.exit(1))}});export{f as lint};