@moneko/core 3.51.5 → 3.51.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bin/pure-lint.d.mts +1 -1
- package/lib/bin/pure-lint.mjs +1 -1
- package/package.json +1 -1
package/lib/bin/pure-lint.d.mts
CHANGED
|
@@ -20,7 +20,7 @@ declare const cwd: string;
|
|
|
20
20
|
declare const cachePath: string;
|
|
21
21
|
declare const cmd: {
|
|
22
22
|
readonly ci: readonly ['diff', '--name-only', 'HEAD^', 'HEAD'];
|
|
23
|
-
readonly commit: readonly ['diff', '--cached', '--name-only', '--diff-filter=
|
|
23
|
+
readonly commit: readonly ['diff', '--cached', '--name-only', '--diff-filter=ACM'];
|
|
24
24
|
};
|
|
25
25
|
declare const scriptRegExp: RegExp;
|
|
26
26
|
declare const vueRegExp: RegExp;
|
package/lib/bin/pure-lint.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{spawnSync as t}from"node:child_process";import{join as e}from"node:path";import{argv as i,cwd as o,exit as r,stdout as n}from"node:process";import{ESLint as l}from"@moneko/eslint";import{stylelint as a}from"@moneko/stylelint";import{ink as m,loadFile as c,println as s}from"@moneko/utils";import f from"../commom/log.mjs";import d from"../commom/parse-args.mjs";import p from"../commom/timer.mjs";let y=d(i.slice(2)),h=y.fix,u=y.cache||!0,w=e(o(),"node_modules/.cache"),g={ci:["diff","--name-only","HEAD^","HEAD"],commit:["diff","--cached","--name-only","--diff-filter=
|
|
2
|
+
import{spawnSync as t}from"node:child_process";import{join as e}from"node:path";import{argv as i,cwd as o,exit as r,stdout as n}from"node:process";import{ESLint as l}from"@moneko/eslint";import{stylelint as a}from"@moneko/stylelint";import{ink as m,loadFile as c,println as s}from"@moneko/utils";import f from"../commom/log.mjs";import d from"../commom/parse-args.mjs";import p from"../commom/timer.mjs";let y=d(i.slice(2)),h=y.fix,u=y.cache||!0,w=e(o(),"node_modules/.cache"),g={ci:["diff","--name-only","HEAD^","HEAD"],commit:["diff","--cached","--name-only","--diff-filter=ACM"]},S=/.*(?<!\.d)\.(j|t|mj|mt|cj|ct)sx?$/,$=/.*(?<!\.d)\.vue$/,E=/.*(?<!\.d)\.(c|sc|sa|le)ss$/,j=t("git",g[y.mode||"ci"]||g.ci).stdout.toString().trim().split("\n");async function L(){let t=m("ESLint","cyan");s(`${t}: ${m("runing...","yellow")}`,!0);try{p.start("ESLint");let t=j.filter(t=>S.test(t)||$.test(t));if(0===t.length){p.end("ESLint");return}let e=new l({cache:u,cacheLocation:`${w}/.eslintcache`,fix:h}),i=await e.lintFiles(t),o=await e.loadFormatter("stylish"),a=await o.format(i);h&&await l.outputFixes(i),a&&n.write(a);let m=i.some(t=>t.errorCount>0);p.end("ESLint"),m&&r(1)}catch(t){f(t)}}let k=j.filter(t=>E.test(t)||$.test(t));async function x(){let t=m("Stylelint","cyan");if(s(`${t}: ${m("runing...","yellow")}`,!0),p.start("Stylelint"),0===k.length){p.end("Stylelint");return}let e=await Promise.all(k.map(async t=>{let e=await c(t);return await a.lint({codeFilename:t,code:e,cache:u,cacheLocation:`${w}/.stylelintcache`,fix:h,formatter:"string"}).catch(f)})),i=!1;e.forEach(t=>{t&&(t.report&&n.write(t.report),t.errored&&(i=!!t.errored))}),p.end("Stylelint"),i&&r(1)}await Promise.all([L(),x()]);
|