eslint-formatter-sukka 8.4.0 → 8.6.0
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 +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";let e;var
|
|
2
|
-
`}),
|
|
1
|
+
"use strict";let e,r,t;var i=require("node:process"),n=require("node:path"),l=require("picocolors"),a=require("node:os"),o=require("node:tty"),u=require("process"),s=require("ci-info"),f=require("node:url"),c=require("foxts/fast-string-array-join"),d=require("foxts/append-array-in-place"),p=require("foxts/guard"),m=require("foxts/lazy-value");let h=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,E=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,y=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,g=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,T=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}])/yu,R=/\t{1,1000}/y,x=/[\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,C=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,O=/\p{M}+/gu,F={limit:1/0,ellipsis:""},I=(e,r={},t={})=>{let i=r.limit??1/0,n=r.ellipsis??"",l=r?.ellipsisWidth??(n?I(n,F,t).width:0),a=t.controlWidth??0,o=t.tabWidth??8,u=t.emojiWidth??2,s=t.regularWidth??1,f=t.wideWidth??2,c=[[C,s,!1],[y,0,!1],[g,a,!1],[R,o,!1],[x,u,!0],[T,f,!0]],d=0,p=0,m=e.length,_=0,M=!1,v=m,b=Math.max(0,i-l),A=0,w=0,N=0,j=0;e:for(;;){if(w>A||p>=m&&p>d){for(let r of(_=0,(e.slice(A,w)||e.slice(d,p)).replaceAll(O,""))){let e=r.codePointAt(0)||0;if(N+(j=h(e)?2:E(e)?f:s)>b&&(v=Math.min(v,Math.max(A,d)+_)),N+j>i){M=!0;break e}_+=r.length,N+=j}A=w=0}if(p>=m)break;for(let r=0,t=c.length;r<t;r++){let[t,n,l]=c[r];if(t.lastIndex=p,t.test(e)){if(N+(j=(_=l?1:t.lastIndex-p)*n)>b&&(v=Math.min(v,p+Math.floor((b-N)/n))),N+j>i){M=!0;break e}N+=j,A=d,w=p,p=d=t.lastIndex;continue e}}p+=1}return{width:M?b:N,index:M?v:m,truncated:M,ellipsed:M&&i>=l}},_={limit:1/0,ellipsis:"",ellipsisWidth:0},M=(e,r={})=>I(e,_,r).width;function v(e,r=globalThis.Deno?globalThis.Deno.args:i.argv){let t=e.startsWith("-")?"":1===e.length?"-":"--",n=r.indexOf(t+e),l=r.indexOf("--");return -1!==n&&(-1===l||n<l)}let{env:b}=i;function A(r,t={}){var n;return 0!==(n=function(r,{streamIsTTY:t,sniffFlags:n=!0}={}){let l=function(){if(!("FORCE_COLOR"in b))return;if("true"===b.FORCE_COLOR)return 1;if("false"===b.FORCE_COLOR)return 0;if(0===b.FORCE_COLOR.length)return 1;let e=Math.min(Number.parseInt(b.FORCE_COLOR,10),3);if([0,1,2,3].includes(e))return e}();void 0!==l&&(e=l);let o=n?e:l;if(0===o)return 0;if(n){if(v("color=16m")||v("color=full")||v("color=truecolor"))return 3;if(v("color=256"))return 2}if("TF_BUILD"in b&&"AGENT_NAME"in b)return 1;if(r&&!t&&void 0===o)return 0;let u=o||0;if("dumb"===b.TERM)return u;if("win32"===i.platform){let e=a.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in b)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in b)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in b)||"codeship"===b.CI_NAME?1:u;if("TEAMCITY_VERSION"in b)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(b.TEAMCITY_VERSION);if("truecolor"===b.COLORTERM||"xterm-kitty"===b.TERM||"xterm-ghostty"===b.TERM||"wezterm"===b.TERM)return 3;if("TERM_PROGRAM"in b){let e=Number.parseInt((b.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(b.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(b.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(b.TERM)||"COLORTERM"in b?1:u}(r,{streamIsTTY:r&&r.isTTY,...t}))&&{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function w(e,r=u.argv){let t=e.startsWith("-")?"":1===e.length?"-":"--",i=r.indexOf(t+e),n=r.indexOf("--");return -1!==i&&(-1===n||i<n)}function N(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 j(e){let{CI:r,CURSOR_TRACE_ID:t,FORCE_HYPERLINK:n,NETLIFY:l,TEAMCITY_VERSION:a,TERM_PROGRAM:o,TERM_PROGRAM_VERSION:u,VTE_VERSION:s,TERM:f}=i.env;if(n)return!(n.length>0&&0===Number.parseInt(n,10));if(w("no-hyperlink")||w("no-hyperlinks")||w("hyperlink=false")||w("hyperlink=never"))return!1;if(w("hyperlink=true")||w("hyperlink=always")||l)return!0;if(!A(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in i.env)return!0;if("win32"===i.platform||r||a)return!1;if(o){let e=N(u);switch(o){case"iTerm.app":if(3===e.major)return e.minor>=1;return e.major>3;case"WezTerm":if(/^0-unstable-\d{4}-\d{2}-\d{2}$/.test(u))return u.slice(11)>="2020-06-20";return e.major>=0x1343cac;case"vscode":if(t)return!0;return e.major>1||1===e.major&&e.minor>=72;case"ghostty":case"zed":return!0}}if(s){if("0.50.0"===s)return!1;let e=N(s);return e.major>0||e.minor>=50}switch(f){case"alacritty":case"xterm-kitty":return!0}return!1}v("no-color")||v("no-colors")||v("color=false")||v("color=never")?e=0:(v("color")||v("colors")||v("color=true")||v("color=always"))&&(e=1),A({isTTY:o.isatty(1)}),A({isTTY:o.isatty(2)});let S={stdout:j(i.stdout),stderr:j(i.stderr)};function L(e,r,t={}){return"\x1b]8;"+Object.keys(t).map(e=>e+"="+t[e]).join(":")+";"+r+"\x07"+e+"\x1b]8;;\x07"}let B={type:"separator"},P={1:l.yellow("warn "),2:l.red("error"),3:l.redBright("fatal")},W=/\B`(.+?)`\B|\B'(.+?)'\B|\B"(.+?)"\B/g,k=m.lazyValue(a.hostname);function q(e,r){return e.errorCount===r.errorCount?r.warningCount-e.warningCount:0===e.errorCount?-1:0===r.errorCount?1:r.errorCount-e.errorCount}function $(e,r){return e.fatal===r.fatal&&e.severity===r.severity?e.line===r.line?e.column<r.column?-1:1:e.line-r.line:(e.fatal||2===e.severity)&&(!r.fatal||2!==r.severity)?1:-1}r=i.env.GNOME_TERMINAL_SCREEN?(e,r)=>{let t=f.pathToFileURL(e.filePath,{});return t.hostname=k(),L(e.relativeFilePath,t.href)+r}:(e,r)=>l.underline(e.relativeFilePath)+r,t=!s.isCI&&S.stdout&&S.stderr?(e,r)=>{if("rulesMeta"in r&&e in r.rulesMeta){let t=r.rulesMeta[e].docs?.url;if(t)return L(l.dim(e),t)}return l.dim(e)}:(e,r)=>l.dim(e),module.exports=(e,a)=>{let o,u,f=[],m=0,h=0,E=0,y=0,g={},T=0,R=0,x=0,C=!1;e.sort(q);for(let r=0,t=e.length;r<t;r++){let t,i=e[r],{messages:a,filePath:o,usedDeprecatedRules:u,fixableWarningCount:s,fixableErrorCount:c}=i;if(0===a.length)continue;m+=i.errorCount,h+=i.warningCount,E+=i.fatalErrorCount,y+=s+c,u.forEach(e=>{var r;d.appendArrayInPlace(g[r=e.ruleId]||(g[r]=[]),e.replacedBy)}),f.length>0&&f.push(B);let O={type:"header",filePath:o,relativeFilePath:n.relative(".",o),firstLineCol:"__placeholder__:__placeholder__"};f.push(O),a.sort($);for(let e=0,r=a.length;e<r;e++){let r,i=a[e];(2===i.severity||i.fatal)&&(t||(t=i));let n=i.message.trim().replaceAll(W,(e,r,t,i)=>l.bold(r||t||i)),o=String(i.line||0),u=String(i.column||0),s=M(o),c=M(u),d=0;d=n.includes("\n")?M(n.split("\n").pop()||n):M(n),s>T&&(T=s),c>R&&(R=c),d>x&&(x=d),C||(C=i.line||i.column),i.fatal?r=3:2===i.severity?r=2:1===i.severity?r=1:p.never(i.severity,"x.serverity"),f.push({type:"message",severity:r,line:o,lineWidth:s,column:u,columnWidth:c,message:n,messageWidth:d,ruleId:i.ruleId||""})}t??(t=a[0]),O.firstLineCol=`${t.line}:${t.column}`}let O="\n";i.stdout.isTTY&&"iTerm.app"===i.env.TERM_PROGRAM&&!s.isCI&&(O+=function(e=i.cwd()){return"\x1b]50;CurrentDir="+e+"\x07"}()),o=C?e=>l.hidden(l.dim(l.gray(`:${e.firstLineCol}`))):()=>"",u=C?e=>" ".repeat(T-e.lineWidth)+l.dim(e.line+l.gray(":")+e.column):()=>"",O+=c.fastStringArrayJoin(f.map(e=>{switch(e.type){case"header":return r(e,o(e));case"message":return" "+c.fastStringArrayJoin([P[e.severity],u(e)," ".repeat(R-e.columnWidth)+e.message," ".repeat(x-e.messageWidth),t(e.ruleId,a)]," ");default:return""}}),"\n"),O+="\n\n";let F=Object.entries(g),I=F.length;if(m+h+E+I<=0)return"";let _=[["problem",!0,m+h+E],["warning",!0,h>0?l.yellow(h):l.green(0)],["error",!0,m>0?l.red(m):l.green(0)],["fatal",E>0,l.red(E)],["fixable",y>0,y],["deprecated",I>0,l.bold(l.gray(I))]].filter(([,e])=>e),v=Math.max(..._.map(([e])=>e.length));return _.forEach(e=>{let[r,t,i]=e;O+=`${" ".repeat(v-r.length)}${l.bold(`${r}:`)} ${i}
|
|
2
|
+
`}),I>0&&F.forEach(([e,r])=>{O+="\n",O+=`${l.gray("deprecated:")} ${e}`,O+=r.length>0?l.gray(` (replaced by ${c.fastStringArrayJoin(r.map(l.white),", ")})`):""}),O+="\n"};
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let e;import
|
|
2
|
-
`}),
|
|
1
|
+
let e,r,t;import i from"node:process";import n from"node:path";import l from"picocolors";import o,{hostname as a}from"node:os";import u from"node:tty";import s from"process";import{isCI as f}from"ci-info";import{pathToFileURL as m}from"node:url";import{fastStringArrayJoin as p}from"foxts/fast-string-array-join";import{appendArrayInPlace as c}from"foxts/append-array-in-place";import{never as d}from"foxts/guard";import{lazyValue as h}from"foxts/lazy-value";let E=e=>12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510,y=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,g=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,T=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,x=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}])/yu,R=/\t{1,1000}/y,O=/[\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,C=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,_=/\p{M}+/gu,F={limit:1/0,ellipsis:""},M=(e,r={},t={})=>{let i=r.limit??1/0,n=r.ellipsis??"",l=r?.ellipsisWidth??(n?M(n,F,t).width:0),o=t.controlWidth??0,a=t.tabWidth??8,u=t.emojiWidth??2,s=t.regularWidth??1,f=t.wideWidth??2,m=[[C,s,!1],[g,0,!1],[T,o,!1],[R,a,!1],[O,u,!0],[x,f,!0]],p=0,c=0,d=e.length,h=0,I=!1,b=d,v=Math.max(0,i-l),A=0,w=0,N=0,j=0;e:for(;;){if(w>A||c>=d&&c>p){for(let r of(h=0,(e.slice(A,w)||e.slice(p,c)).replaceAll(_,""))){let e=r.codePointAt(0)||0;if(N+(j=E(e)?2:y(e)?f:s)>v&&(b=Math.min(b,Math.max(A,p)+h)),N+j>i){I=!0;break e}h+=r.length,N+=j}A=w=0}if(c>=d)break;for(let r=0,t=m.length;r<t;r++){let[t,n,l]=m[r];if(t.lastIndex=c,t.test(e)){if(N+(j=(h=l?1:t.lastIndex-c)*n)>v&&(b=Math.min(b,c+Math.floor((v-N)/n))),N+j>i){I=!0;break e}N+=j,A=p,w=c,c=p=t.lastIndex;continue e}}c+=1}return{width:I?v:N,index:I?b:d,truncated:I,ellipsed:I&&i>=l}},I={limit:1/0,ellipsis:"",ellipsisWidth:0},b=(e,r={})=>M(e,I,r).width;function v(e,r=globalThis.Deno?globalThis.Deno.args:i.argv){let t=e.startsWith("-")?"":1===e.length?"-":"--",n=r.indexOf(t+e),l=r.indexOf("--");return -1!==n&&(-1===l||n<l)}let{env:A}=i;function w(r,t={}){var n;return 0!==(n=function(r,{streamIsTTY:t,sniffFlags:n=!0}={}){let l=function(){if(!("FORCE_COLOR"in A))return;if("true"===A.FORCE_COLOR)return 1;if("false"===A.FORCE_COLOR)return 0;if(0===A.FORCE_COLOR.length)return 1;let e=Math.min(Number.parseInt(A.FORCE_COLOR,10),3);if([0,1,2,3].includes(e))return e}();void 0!==l&&(e=l);let a=n?e:l;if(0===a)return 0;if(n){if(v("color=16m")||v("color=full")||v("color=truecolor"))return 3;if(v("color=256"))return 2}if("TF_BUILD"in A&&"AGENT_NAME"in A)return 1;if(r&&!t&&void 0===a)return 0;let u=a||0;if("dumb"===A.TERM)return u;if("win32"===i.platform){let e=o.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in A)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in A)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in A)||"codeship"===A.CI_NAME?1:u;if("TEAMCITY_VERSION"in A)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(A.TEAMCITY_VERSION);if("truecolor"===A.COLORTERM||"xterm-kitty"===A.TERM||"xterm-ghostty"===A.TERM||"wezterm"===A.TERM)return 3;if("TERM_PROGRAM"in A){let e=Number.parseInt((A.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(A.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(A.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(A.TERM)||"COLORTERM"in A?1:u}(r,{streamIsTTY:r&&r.isTTY,...t}))&&{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function N(e,r=s.argv){let t=e.startsWith("-")?"":1===e.length?"-":"--",i=r.indexOf(t+e),n=r.indexOf("--");return -1!==i&&(-1===n||i<n)}function j(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 S(e){let{CI:r,CURSOR_TRACE_ID:t,FORCE_HYPERLINK:n,NETLIFY:l,TEAMCITY_VERSION:o,TERM_PROGRAM:a,TERM_PROGRAM_VERSION:u,VTE_VERSION:s,TERM:f}=i.env;if(n)return!(n.length>0&&0===Number.parseInt(n,10));if(N("no-hyperlink")||N("no-hyperlinks")||N("hyperlink=false")||N("hyperlink=never"))return!1;if(N("hyperlink=true")||N("hyperlink=always")||l)return!0;if(!w(e)||e&&!e.isTTY)return!1;if("WT_SESSION"in i.env)return!0;if("win32"===i.platform||r||o)return!1;if(a){let e=j(u);switch(a){case"iTerm.app":if(3===e.major)return e.minor>=1;return e.major>3;case"WezTerm":if(/^0-unstable-\d{4}-\d{2}-\d{2}$/.test(u))return u.slice(11)>="2020-06-20";return e.major>=0x1343cac;case"vscode":if(t)return!0;return e.major>1||1===e.major&&e.minor>=72;case"ghostty":case"zed":return!0}}if(s){if("0.50.0"===s)return!1;let e=j(s);return e.major>0||e.minor>=50}switch(f){case"alacritty":case"xterm-kitty":return!0}return!1}v("no-color")||v("no-colors")||v("color=false")||v("color=never")?e=0:(v("color")||v("colors")||v("color=true")||v("color=always"))&&(e=1),w({isTTY:u.isatty(1)}),w({isTTY:u.isatty(2)});let B={stdout:S(i.stdout),stderr:S(i.stderr)};function L(e,r,t={}){return"\x1b]8;"+Object.keys(t).map(e=>e+"="+t[e]).join(":")+";"+r+"\x07"+e+"\x1b]8;;\x07"}let W={type:"separator"},k={1:l.yellow("warn "),2:l.red("error"),3:l.redBright("fatal")},P=/\B`(.+?)`\B|\B'(.+?)'\B|\B"(.+?)"\B/g,$=h(a);r=i.env.GNOME_TERMINAL_SCREEN?(e,r)=>{let t=m(e.filePath,{});return t.hostname=$(),L(e.relativeFilePath,t.href)+r}:(e,r)=>l.underline(e.relativeFilePath)+r,t=!f&&B.stdout&&B.stderr?(e,r)=>{if("rulesMeta"in r&&e in r.rulesMeta){let t=r.rulesMeta[e].docs?.url;if(t)return L(l.dim(e),t)}return l.dim(e)}:(e,r)=>l.dim(e);let G=(e,o)=>{let a,u,s=[],m=0,h=0,E=0,y=0,g={},T=0,x=0,R=0,O=!1;e.sort(Y);for(let r=0,t=e.length;r<t;r++){let t,i=e[r],{messages:o,filePath:a,usedDeprecatedRules:u,fixableWarningCount:f,fixableErrorCount:p}=i;if(0===o.length)continue;m+=i.errorCount,h+=i.warningCount,E+=i.fatalErrorCount,y+=f+p,u.forEach(e=>{var r;c(g[r=e.ruleId]||(g[r]=[]),e.replacedBy)}),s.length>0&&s.push(W);let C={type:"header",filePath:a,relativeFilePath:n.relative(".",a),firstLineCol:"__placeholder__:__placeholder__"};s.push(C),o.sort(D);for(let e=0,r=o.length;e<r;e++){let r,i=o[e];(2===i.severity||i.fatal)&&(t||(t=i));let n=i.message.trim().replaceAll(P,(e,r,t,i)=>l.bold(r||t||i)),a=String(i.line||0),u=String(i.column||0),f=b(a),m=b(u),p=0;p=n.includes("\n")?b(n.split("\n").pop()||n):b(n),f>T&&(T=f),m>x&&(x=m),p>R&&(R=p),O||(O=i.line||i.column),i.fatal?r=3:2===i.severity?r=2:1===i.severity?r=1:d(i.severity,"x.serverity"),s.push({type:"message",severity:r,line:a,lineWidth:f,column:u,columnWidth:m,message:n,messageWidth:p,ruleId:i.ruleId||""})}t??(t=o[0]),C.firstLineCol=`${t.line}:${t.column}`}let C="\n";i.stdout.isTTY&&"iTerm.app"===i.env.TERM_PROGRAM&&!f&&(C+=function(e=i.cwd()){return"\x1b]50;CurrentDir="+e+"\x07"}()),a=O?e=>l.hidden(l.dim(l.gray(`:${e.firstLineCol}`))):()=>"",u=O?e=>" ".repeat(T-e.lineWidth)+l.dim(e.line+l.gray(":")+e.column):()=>"",C+=p(s.map(e=>{switch(e.type){case"header":return r(e,a(e));case"message":return" "+p([k[e.severity],u(e)," ".repeat(x-e.columnWidth)+e.message," ".repeat(R-e.messageWidth),t(e.ruleId,o)]," ");default:return""}}),"\n"),C+="\n\n";let _=Object.entries(g),F=_.length;if(m+h+E+F<=0)return"";let M=[["problem",!0,m+h+E],["warning",!0,h>0?l.yellow(h):l.green(0)],["error",!0,m>0?l.red(m):l.green(0)],["fatal",E>0,l.red(E)],["fixable",y>0,y],["deprecated",F>0,l.bold(l.gray(F))]].filter(([,e])=>e),I=Math.max(...M.map(([e])=>e.length));return M.forEach(e=>{let[r,t,i]=e;C+=`${" ".repeat(I-r.length)}${l.bold(`${r}:`)} ${i}
|
|
2
|
+
`}),F>0&&_.forEach(([e,r])=>{C+="\n",C+=`${l.gray("deprecated:")} ${e}`,C+=r.length>0?l.gray(` (replaced by ${p(r.map(l.white),", ")})`):""}),C+="\n"};function Y(e,r){return e.errorCount===r.errorCount?r.warningCount-e.warningCount:0===e.errorCount?-1:0===r.errorCount?1:r.errorCount-e.errorCount}function D(e,r){return e.fatal===r.fatal&&e.severity===r.severity?e.line===r.line?e.column<r.column?-1:1:e.line-r.line:(e.fatal||2===e.severity)&&(!r.fatal||2!==r.severity)?1:-1}export{G as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-formatter-sukka",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.6.0",
|
|
4
4
|
"description": "Sukka's ESLint config",
|
|
5
5
|
"homepage": "https://github.com/SukkaW/eslint-config-sukka",
|
|
6
6
|
"repository": {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"fast-string-width": "^3.0.2",
|
|
37
37
|
"supports-hyperlinks": "^4.4.0",
|
|
38
|
-
"@eslint-sukka/rollup-config": "8.
|
|
38
|
+
"@eslint-sukka/rollup-config": "8.6.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"eslint": "*"
|