eslint-formatter-sukka 6.23.0 → 7.0.0-beta.1
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/dist/index.cjs +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";let e;var r=require("node:path"),t=require("node:process"),i=require("picocolors"),n=require("node:os"),l=require("node:tty"),o=require("process"),a=require("ci-info"),u=require("node:url");const s=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,c=e=>8987===e||9001===e||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,f=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,p=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,
|
|
1
|
+
"use strict";let e;var r=require("node:path"),t=require("node:process"),i=require("picocolors"),n=require("node:os"),l=require("node:tty"),o=require("process"),a=require("ci-info"),u=require("node:url");const s=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,c=e=>8987===e||9001===e||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,f=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,p=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,m=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,d=/\t{1,1000}/y,h=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,E=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,g=/\p{M}+/gu,T={limit:1/0,ellipsis:""},y=(e,r={},t={})=>{let i=r.limit??1/0,n=r.ellipsis??"",l=r?.ellipsisWidth??(n?y(n,T,t).width:0),o=t.controlWidth??0,a=t.tabWidth??8,u=t.emojiWidth??2,R=t.regularWidth??1,C=t.wideWidth??2,O=[[E,R],[f,0],[p,o],[d,a],[h,u],[m,C]],I=0,x=0,F=e.length,M=0,b=!1,_=F,v=Math.max(0,i-l),A=0,j=0,w=0,N=0;e:for(;;){if(j>A||x>=F&&x>I){for(let r of(M=0,(e.slice(A,j)||e.slice(I,x)).replaceAll(g,""))){let e=r.codePointAt(0)||0;if(w+(N=s(e)?2:c(e)?C:R)>v&&(_=Math.min(_,Math.max(A,I)+M)),w+N>i){b=!0;break e}M+=r.length,w+=N}A=j=0}if(x>=F)break;for(let r=0,t=O.length;r<t;r++){let[t,n]=O[r];if(t.lastIndex=x,t.test(e)){if(w+(N=(M=t===h?1:t.lastIndex-x)*n)>v&&(_=Math.min(_,x+Math.floor((v-w)/n))),w+N>i){b=!0;break e}w+=N,A=I,j=x,x=I=t.lastIndex;continue e}}x+=1}return{width:b?v:w,index:b?_:F,truncated:b,ellipsed:b&&i>=l}},R={limit:1/0,ellipsis:"",ellipsisWidth:0},C=(e,r={})=>y(e,R,r).width;function O(e,r=globalThis.Deno?globalThis.Deno.args:t.argv){let i=e.startsWith("-")?"":1===e.length?"-":"--",n=r.indexOf(i+e),l=r.indexOf("--");return -1!==n&&(-1===l||n<l)}const{env:I}=t;function x(r,i={}){var l;return 0!==(l=function(r,{streamIsTTY:i,sniffFlags:l=!0}={}){let o=function(){if(!("FORCE_COLOR"in I))return;if("true"===I.FORCE_COLOR)return 1;if("false"===I.FORCE_COLOR)return 0;if(0===I.FORCE_COLOR.length)return 1;let e=Math.min(Number.parseInt(I.FORCE_COLOR,10),3);if([0,1,2,3].includes(e))return e}();void 0!==o&&(e=o);let a=l?e:o;if(0===a)return 0;if(l){if(O("color=16m")||O("color=full")||O("color=truecolor"))return 3;if(O("color=256"))return 2}if("TF_BUILD"in I&&"AGENT_NAME"in I)return 1;if(r&&!i&&void 0===a)return 0;let u=a||0;if("dumb"===I.TERM)return u;if("win32"===t.platform){let e=n.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in I)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in I)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in I)||"codeship"===I.CI_NAME?1:u;if("TEAMCITY_VERSION"in I)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(I.TEAMCITY_VERSION);if("truecolor"===I.COLORTERM||"xterm-kitty"===I.TERM||"xterm-ghostty"===I.TERM||"wezterm"===I.TERM)return 3;if("TERM_PROGRAM"in I){let e=Number.parseInt((I.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(I.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(I.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(I.TERM)||"COLORTERM"in I?1:u}(r,{streamIsTTY:r&&r.isTTY,...i}))&&{level:l,hasBasic:!0,has256:l>=2,has16m:l>=3}}function F(e,r=o.argv){let t=e.startsWith("-")?"":1===e.length?"-":"--",i=r.indexOf(t+e),n=r.indexOf("--");return -1!==i&&(-1===n||i<n)}function M(e=""){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e)??[];return{major:0,minor:Number.parseInt(r[1],10),patch:Number.parseInt(r[2],10)}}let r=(e??"").split(".").map(e=>Number.parseInt(e,10));return{major:r[0],minor:r[1],patch:r[2]}}function b(e){let{CI:r,CURSOR_TRACE_ID:i,FORCE_HYPERLINK:n,NETLIFY:l,TEAMCITY_VERSION:o,TERM_PROGRAM:a,TERM_PROGRAM_VERSION:u,VTE_VERSION:s,TERM:c}=t.env;if(n)return!(n.length>0&&0===Number.parseInt(n,10));if(F("no-hyperlink")||F("no-hyperlinks")||F("hyperlink=false")||F("hyperlink=never"))return!1;if(F("hyperlink=true")||F("hyperlink=always")||l)return!0;if(!x(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in t.env)return!0;if("win32"===t.platform||r||o)return!1;if(a){let e=M(u);switch(a){case"iTerm.app":if(3===e.major)return e.minor>=1;return e.major>3;case"WezTerm":return e.major>=0x1343cac;case"vscode":if(i)return!0;return e.major>1||1===e.major&&e.minor>=72;case"ghostty":return!0}}if(s){if("0.50.0"===s)return!1;let e=M(s);return e.major>0||e.minor>=50}return"alacritty"===c}function _(e,r,t={}){return"\x1b]8;"+Object.keys(t).map(e=>e+"="+t[e]).join(":")+";"+r+"\x07"+e+"\x1b]8;;\x07"}O("no-color")||O("no-colors")||O("color=false")||O("color=never")?e=0:(O("color")||O("colors")||O("color=true")||O("color=always"))&&(e=1),x({isTTY:l.isatty(1)}),x({isTTY:l.isatty(2)}),b(t.stdout),b(t.stderr);const v={type:"separator"};module.exports=(e,l)=>{let o=[],s=0,c=0,f=0,p=0,m=0,d={},h=0,E=0,g=0,T=!1;e.sort((e,r)=>e.errorCount===r.errorCount?r.warningCount-e.warningCount:0===e.errorCount?-1:0===r.errorCount?1:r.errorCount-e.errorCount).forEach(e=>{let{messages:t,filePath:n,usedDeprecatedRules:l}=e;if(0===t.length)return;s+=e.errorCount,c+=e.warningCount,f+=e.fatalErrorCount,p+=e.fixableWarningCount,m+=e.fixableErrorCount,l.forEach(e=>{var r;d[r=e.ruleId]||(d[r]=e.replacedBy)}),0!==o.length&&o.push(v);let a=t.find(({severity:e})=>2===e)||t[0];o.push({type:"header",filePath:n,relativeFilePath:r.relative(".",n),firstLineCol:`${a.line}:${a.column}`}),t.sort((e,r)=>e.fatal===r.fatal&&e.severity===r.severity?e.line===r.line?e.column<r.column?-1:1:e.line<r.line?-1:1:(e.fatal||2===e.severity)&&(!r.fatal||2!==r.severity)?1:-1).forEach(e=>{let r=e.message.replaceAll(/\B`(.*?)`\B|\B'(.*?)'\B/g,(e,r,t)=>i.bold(r||t)),t=String(e.line||0),n=String(e.column||0),l=C(t),a=C(n),u=C(r);l>h&&(h=l),a>E&&(E=a),u>g&&(g=u),T||(T=e.line||e.column),o.push({type:"message",severity:e.fatal?"fatal":2===e.severity||"error"===e.severity?"error":"warning",line:t,lineWidth:l,column:n,columnWidth:a,message:r,messageWidth:u,ruleId:e.ruleId||""})})});let y="\n";t.stdout.isTTY&&!a.isCI&&"iTerm.app"===t.env.TERM_PROGRAM&&(y+=function(e=t.cwd()){return"\x1b]50;CurrentDir="+e+"\x07"}());let R=!a.isCI&&b(t.stdout),O=n.hostname(),I=t.env.GNOME_TERMINAL_SCREEN;y+=`${o.map(e=>{if("header"===e.type){let r=T?i.hidden(i.dim(i.gray(`:${e.firstLineCol}`))):"";if(I){let t=u.pathToFileURL(e.filePath,{});return t.hostname=O,_(e.relativeFilePath,t.href)+r}return i.underline(e.relativeFilePath)+r}if("message"===e.type){let r;try{l&&"rulesMeta"in l&&(r=l.rulesMeta[e.ruleId].docs?.url)}catch{}let t=["","warning"===e.severity?i.yellow("warn "):i.red("error")," ".repeat(h-e.lineWidth)+i.dim(e.line+i.gray(":")+e.column)," ".repeat(E-e.columnWidth)+e.message," ".repeat(g-e.messageWidth)+(r&&R?_(i.dim(e.ruleId),r):i.dim(e.ruleId))];return T||t.splice(2,1),t.join(" ")}return""}).join("\n")}
|
|
2
2
|
|
|
3
|
-
`;let
|
|
4
|
-
`}),
|
|
3
|
+
`;let x=Object.entries(d),F=x.length,M=Object.entries({problem:[!0,s+c+f],warning:[!0,c>0?i.yellow(c):i.green(0)],error:[!0,s>0?i.red(s):i.green(0)],fatal:[f>0,i.red(f)],fixable:[m+p>0,m+p],deprecated:[F>0,i.bold(i.gray(F))]}).filter(([,[e]])=>e),A=Math.max(...M.map(([e])=>e.length));return M.forEach(e=>{let[r,[,t]]=e;y+=`${" ".repeat(A-r.length)}${i.bold(`${r}:`)} ${t}
|
|
4
|
+
`}),F>0&&x.forEach(([e,r])=>{y+="\n",y+=`${i.gray("deprecated:")} ${e}`,y+=r.length>0?i.gray(` (replaced by ${r.map(i.white).join(", ")})`):""}),y+="\n",s+c+f+F>0?y:""};
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
let e;import r from"node:path";import t from"node:process";import i from"picocolors";import n,{hostname as
|
|
1
|
+
let e;import r from"node:path";import t from"node:process";import i from"picocolors";import n,{hostname as o}from"node:os";import l from"node:tty";import a from"process";import{isCI as u}from"ci-info";import{pathToFileURL as s}from"node:url";let f=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,m=e=>8987===e||9001===e||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,p=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,c=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,d=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,h=/\t{1,1000}/y,E=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,g=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,y=/\p{M}+/gu,T={limit:1/0,ellipsis:""},R=(e,r={},t={})=>{let i=r.limit??1/0,n=r.ellipsis??"",o=r?.ellipsisWidth??(n?R(n,T,t).width:0),l=t.controlWidth??0,a=t.tabWidth??8,u=t.emojiWidth??2,s=t.regularWidth??1,O=t.wideWidth??2,C=[[g,s],[p,0],[c,l],[h,a],[E,u],[d,O]],x=0,F=0,I=e.length,M=0,b=!1,_=I,v=Math.max(0,i-o),A=0,j=0,w=0,N=0;e:for(;;){if(j>A||F>=I&&F>x){for(let r of(M=0,(e.slice(A,j)||e.slice(x,F)).replaceAll(y,""))){let e=r.codePointAt(0)||0;if(w+(N=f(e)?2:m(e)?O:s)>v&&(_=Math.min(_,Math.max(A,x)+M)),w+N>i){b=!0;break e}M+=r.length,w+=N}A=j=0}if(F>=I)break;for(let r=0,t=C.length;r<t;r++){let[t,n]=C[r];if(t.lastIndex=F,t.test(e)){if(w+(N=(M=t===E?1:t.lastIndex-F)*n)>v&&(_=Math.min(_,F+Math.floor((v-w)/n))),w+N>i){b=!0;break e}w+=N,A=x,j=F,F=x=t.lastIndex;continue e}}F+=1}return{width:b?v:w,index:b?_:I,truncated:b,ellipsed:b&&i>=o}},O={limit:1/0,ellipsis:"",ellipsisWidth:0},C=(e,r={})=>R(e,O,r).width;function x(e,r=globalThis.Deno?globalThis.Deno.args:t.argv){let i=e.startsWith("-")?"":1===e.length?"-":"--",n=r.indexOf(i+e),o=r.indexOf("--");return -1!==n&&(-1===o||n<o)}let{env:F}=t;function I(r,i={}){var o;return 0!==(o=function(r,{streamIsTTY:i,sniffFlags:o=!0}={}){let l=function(){if(!("FORCE_COLOR"in F))return;if("true"===F.FORCE_COLOR)return 1;if("false"===F.FORCE_COLOR)return 0;if(0===F.FORCE_COLOR.length)return 1;let e=Math.min(Number.parseInt(F.FORCE_COLOR,10),3);if([0,1,2,3].includes(e))return e}();void 0!==l&&(e=l);let a=o?e:l;if(0===a)return 0;if(o){if(x("color=16m")||x("color=full")||x("color=truecolor"))return 3;if(x("color=256"))return 2}if("TF_BUILD"in F&&"AGENT_NAME"in F)return 1;if(r&&!i&&void 0===a)return 0;let u=a||0;if("dumb"===F.TERM)return u;if("win32"===t.platform){let e=n.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in F)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in F)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in F)||"codeship"===F.CI_NAME?1:u;if("TEAMCITY_VERSION"in F)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(F.TEAMCITY_VERSION);if("truecolor"===F.COLORTERM||"xterm-kitty"===F.TERM||"xterm-ghostty"===F.TERM||"wezterm"===F.TERM)return 3;if("TERM_PROGRAM"in F){let e=Number.parseInt((F.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(F.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(F.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(F.TERM)||"COLORTERM"in F?1:u}(r,{streamIsTTY:r&&r.isTTY,...i}))&&{level:o,hasBasic:!0,has256:o>=2,has16m:o>=3}}function M(e,r=a.argv){let t=e.startsWith("-")?"":1===e.length?"-":"--",i=r.indexOf(t+e),n=r.indexOf("--");return -1!==i&&(-1===n||i<n)}function b(e=""){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e)??[];return{major:0,minor:Number.parseInt(r[1],10),patch:Number.parseInt(r[2],10)}}let r=(e??"").split(".").map(e=>Number.parseInt(e,10));return{major:r[0],minor:r[1],patch:r[2]}}function _(e){let{CI:r,CURSOR_TRACE_ID:i,FORCE_HYPERLINK:n,NETLIFY:o,TEAMCITY_VERSION:l,TERM_PROGRAM:a,TERM_PROGRAM_VERSION:u,VTE_VERSION:s,TERM:f}=t.env;if(n)return!(n.length>0&&0===Number.parseInt(n,10));if(M("no-hyperlink")||M("no-hyperlinks")||M("hyperlink=false")||M("hyperlink=never"))return!1;if(M("hyperlink=true")||M("hyperlink=always")||o)return!0;if(!I(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in t.env)return!0;if("win32"===t.platform||r||l)return!1;if(a){let e=b(u);switch(a){case"iTerm.app":if(3===e.major)return e.minor>=1;return e.major>3;case"WezTerm":return e.major>=0x1343cac;case"vscode":if(i)return!0;return e.major>1||1===e.major&&e.minor>=72;case"ghostty":return!0}}if(s){if("0.50.0"===s)return!1;let e=b(s);return e.major>0||e.minor>=50}return"alacritty"===f}function v(e,r,t={}){return"\x1b]8;"+Object.keys(t).map(e=>e+"="+t[e]).join(":")+";"+r+"\x07"+e+"\x1b]8;;\x07"}x("no-color")||x("no-colors")||x("color=false")||x("color=never")?e=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(e=1),I({isTTY:l.isatty(1)}),I({isTTY:l.isatty(2)}),_(t.stdout),_(t.stderr);let A={type:"separator"},j=(e,n)=>{let l=[],a=0,f=0,m=0,p=0,c=0,d={},h=0,E=0,g=0,y=!1;e.sort((e,r)=>e.errorCount===r.errorCount?r.warningCount-e.warningCount:0===e.errorCount?-1:0===r.errorCount?1:r.errorCount-e.errorCount).forEach(e=>{let{messages:t,filePath:n,usedDeprecatedRules:o}=e;if(0===t.length)return;a+=e.errorCount,f+=e.warningCount,m+=e.fatalErrorCount,p+=e.fixableWarningCount,c+=e.fixableErrorCount,o.forEach(e=>{var r;d[r=e.ruleId]||(d[r]=e.replacedBy)}),0!==l.length&&l.push(A);let u=t.find(({severity:e})=>2===e)||t[0];l.push({type:"header",filePath:n,relativeFilePath:r.relative(".",n),firstLineCol:`${u.line}:${u.column}`}),t.sort((e,r)=>e.fatal===r.fatal&&e.severity===r.severity?e.line===r.line?e.column<r.column?-1:1:e.line<r.line?-1:1:(e.fatal||2===e.severity)&&(!r.fatal||2!==r.severity)?1:-1).forEach(e=>{let r=e.message.replaceAll(/\B`(.*?)`\B|\B'(.*?)'\B/g,(e,r,t)=>i.bold(r||t)),t=String(e.line||0),n=String(e.column||0),o=C(t),a=C(n),u=C(r);o>h&&(h=o),a>E&&(E=a),u>g&&(g=u),y||(y=e.line||e.column),l.push({type:"message",severity:e.fatal?"fatal":2===e.severity||"error"===e.severity?"error":"warning",line:t,lineWidth:o,column:n,columnWidth:a,message:r,messageWidth:u,ruleId:e.ruleId||""})})});let T="\n";t.stdout.isTTY&&!u&&"iTerm.app"===t.env.TERM_PROGRAM&&(T+=function(e=t.cwd()){return"\x1b]50;CurrentDir="+e+"\x07"}());let R=!u&&_(t.stdout),O=o(),x=t.env.GNOME_TERMINAL_SCREEN;T+=`${l.map(e=>{if("header"===e.type){let r=y?i.hidden(i.dim(i.gray(`:${e.firstLineCol}`))):"";if(x){let t=s(e.filePath,{});return t.hostname=O,v(e.relativeFilePath,t.href)+r}return i.underline(e.relativeFilePath)+r}if("message"===e.type){let r;try{n&&"rulesMeta"in n&&(r=n.rulesMeta[e.ruleId].docs?.url)}catch{}let t=["","warning"===e.severity?i.yellow("warn "):i.red("error")," ".repeat(h-e.lineWidth)+i.dim(e.line+i.gray(":")+e.column)," ".repeat(E-e.columnWidth)+e.message," ".repeat(g-e.messageWidth)+(r&&R?v(i.dim(e.ruleId),r):i.dim(e.ruleId))];return y||t.splice(2,1),t.join(" ")}return""}).join("\n")}
|
|
2
2
|
|
|
3
3
|
`;let F=Object.entries(d),I=F.length,M=Object.entries({problem:[!0,a+f+m],warning:[!0,f>0?i.yellow(f):i.green(0)],error:[!0,a>0?i.red(a):i.green(0)],fatal:[m>0,i.red(m)],fixable:[c+p>0,c+p],deprecated:[I>0,i.bold(i.gray(I))]}).filter(([,[e]])=>e),b=Math.max(...M.map(([e])=>e.length));return M.forEach(e=>{let[r,[,t]]=e;T+=`${" ".repeat(b-r.length)}${i.bold(`${r}:`)} ${t}
|
|
4
4
|
`}),I>0&&F.forEach(([e,r])=>{T+="\n",T+=`${i.gray("deprecated:")} ${e}`,T+=r.length>0?i.gray(` (replaced by ${r.map(i.white).join(", ")})`):""}),T+="\n",a+f+m+I>0?T:""};export{j as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-formatter-sukka",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.1",
|
|
4
4
|
"description": "Sukka's ESLint config",
|
|
5
5
|
"homepage": "https://github.com/SukkaW/eslint-config-sukka",
|
|
6
6
|
"repository": {
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"picocolors": "^1.1.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"fast-string-width": "^
|
|
36
|
-
"supports-hyperlinks": "^4.1.
|
|
37
|
-
"@eslint-sukka/rollup-config": "
|
|
35
|
+
"fast-string-width": "^3.0.1",
|
|
36
|
+
"supports-hyperlinks": "^4.1.2",
|
|
37
|
+
"@eslint-sukka/rollup-config": "7.0.0-beta.1"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "rollup -c rollup.config.ts --configPlugin swc3"
|