eslint-cli-bundle 2.0.0 → 3.0.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/LICENSE +22 -0
- package/README.md +10 -1
- package/dist/api.d.ts +32 -11
- package/dist/api.js +7 -7
- package/dist/babel.cjs +38 -27
- package/dist/config.d.ts +10 -2
- package/dist/config.js +1 -1
- package/dist/eslint-C-fkO7XK.js +166 -0
- package/dist/eslint-helpers-4m3QC9jt.js +370 -0
- package/dist/eslint.js +11 -8
- package/dist/jiti-CaIpDikP.js +15 -0
- package/dist/naming-BtEmRC_V.js +1 -0
- package/dist/rolldown-runtime-C7uQZ-1I.js +1 -0
- package/dist/shared/translate-cli-options.js +1 -0
- package/dist/src-Bnjf7phB.js +1 -0
- package/dist/types/config-helpers.d.ts +1473 -0
- package/dist/{types-CXey2reC.d.ts → types/core.d.ts} +62 -5
- package/dist/types/estree.d.ts +527 -0
- package/dist/types/plugin-kit.d.ts +1732 -0
- package/dist/worker.js +1 -0
- package/package.json +20 -15
- package/dist/chunk-qnHZjHhP.js +0 -1
- package/dist/eslint-BTrx12MV.js +0 -256
- package/dist/jiti-BvM1NyiB.js +0 -9
- package/dist/src-D7slgxDU.js +0 -1
package/dist/config.d.ts
CHANGED
|
@@ -5,8 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
type Config,
|
|
8
|
+
type ConfigObject,
|
|
8
9
|
defineConfig,
|
|
9
10
|
globalIgnores,
|
|
10
|
-
|
|
11
|
+
includeIgnoreFile,
|
|
12
|
+
} from "./types/config-helpers.js";
|
|
11
13
|
|
|
12
|
-
export {
|
|
14
|
+
export {
|
|
15
|
+
type Config,
|
|
16
|
+
type ConfigObject,
|
|
17
|
+
defineConfig,
|
|
18
|
+
globalIgnores,
|
|
19
|
+
includeIgnoreFile,
|
|
20
|
+
};
|
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-C7uQZ-1I.js";var n=/* @__PURE__ */ t((t=>{var n=e(`node:fs`),r=e(`node:path`);let i=[`env`,`extends`,`globals`,`ignorePatterns`,`noInlineConfig`,`overrides`,`parser`,`parserOptions`,`reportUnusedDisableDirectives`,`root`],a=/* @__PURE__ */ new Set([`basePath`,`ignores`,`name`]);function o(e,t){return e.name?e.name:`UserConfig${t}`}function s(e,t){return typeof e==`string`?e:e.name?e.name:`ExtendedConfig${t}`}function c(e){if(Array.isArray(e.plugins))return!0;for(let t of i)if(t in e)return!0;return!1}function l(e){return Object.keys(e).every(e=>a.has(e))}function u(e){let t=e.indexOf(`/`);if(t===-1)return{namespace:``,name:e};let n=e.slice(0,t);if(n[0]===`@`&&n!==`@`){let r=e.indexOf(`/`,t+1);if(r!==-1)return n=e.slice(0,r),{namespace:n,name:e.slice(r+1)}}let r=e.slice(t+1);return{namespace:n,name:r}}function d(e,t,n){let r=t.meta?.namespace;if(!r||r===e||!n.rules&&!n.processor&&!n.language)return n;let i={...n};if(i.rules){let t=Object.keys(i.rules),n={};for(let a=0;a<t.length;a++){let o=t[a],{namespace:s,name:c}=u(o);s===r?n[`${e}/${c}`]=i.rules[o]:n[o]=i.rules[o]}i.rules=n}if(typeof i.processor==`string`){let{namespace:t,name:n}=u(i.processor);t&&t===r&&(i.processor=`${e}/${n}`)}if(typeof i.language==`string`){let{namespace:t,name:n}=u(i.language);t===r&&(i.language=`${e}/${n}`)}return i}function f(e,t,n,r){if(Array.isArray(n))return n.map(n=>f(e,t,n,r));if(c(n))throw TypeError(`Plugin config "${r}" is an eslintrc config and cannot be used in this context.`);return d(e,t,n)}function p(e,t){let{namespace:n,name:r}=u(t),i=e.plugins?.[n];if(!i)throw TypeError(`Plugin "${n}" not found.`);let a=i.configs?.[r];if(a&&(Array.isArray(a)||!c(a)))return f(n,i,a,t);let o=i.configs?.[`flat/${r}`];if(o&&(Array.isArray(o)||!c(o)))return f(n,i,o,t);let s=a||o?`Plugin config "${r}" in plugin "${n}" is an eslintrc config and cannot be used in this context.`:`Plugin config "${r}" not found in plugin "${n}".`;throw TypeError(s)}function*m(e,t=``){for(let n=0;n<e.length;n++){let r=t?`${t}[${n}]`:`[${n}]`;if(Array.isArray(e[n])){yield*m(e[n],r);continue}yield{indexPath:r,value:e[n]}}}function h(e=[],t=[]){if(!t.length)return e.concat();if(!e.length)return t.concat();let n=[];for(let r of e)for(let e of t){let t=[];Array.isArray(r)?t.push(...r):t.push(r),Array.isArray(e)?t.push(...e):t.push(e),n.push(t)}return n}function g(e,t,n,r){let i={...n};return l(n)||(e.files&&(i.files=h(e.files,n.files)),e.ignores&&(i.ignores=e.ignores.concat(n.ignores??[]))),i.name=`${t} > ${r}`,e.basePath&&(i.basePath=e.basePath),i}function _(e,t){if(!e.extends)return[e];if(!Array.isArray(e.extends))throw TypeError("The `extends` property must be an array.");let{extends:n,...r}=e,i=/* @__PURE__ */ new WeakMap,a=n.map(t=>{if(typeof t==`string`){let n=p(e,t);return Array.isArray(n)?n.forEach((e,n)=>{i.set(e,`${t}[${n}]`)}):i.set(n,t),n}return t}),o=[];for(let{indexPath:n,value:c}of m(a)){let a=c;if(`basePath`in a)throw TypeError("'basePath' in `extends` is not allowed.");if(`extends`in a)throw TypeError(`Nested 'extends' is not allowed.`);let l=t.get(e),u=i.get(c)??s(c,n);o.push(g(r,l,a,u))}return l(r)||o.push(r),o.flat()}function v(e,t){return e.flatMap(e=>_(e,t))}function y(...e){let t=/* @__PURE__ */ new WeakMap,n=[];if(e.length===0)throw TypeError(`Expected one or more arguments.`);for(let{indexPath:r,value:i}of m(e)){if(typeof i!=`object`||!i)throw TypeError(`Expected an object but received ${String(i)}.`);let e=i;t.set(e,o(e,r)),n.push(e)}return v(n,t)}let b=0;function x(e,t){if(!Array.isArray(e))throw TypeError(`ignorePatterns must be an array`);if(e.length===0)throw TypeError(`ignorePatterns must contain at least one pattern`);let n=b++;return{name:t||`globalIgnores ${n}`,ignores:e}}function S(e){let t=e.startsWith(`!`),n=t?`!`:``,r=(t?e.slice(1):e).trimEnd();if([``,`**`,`/**`,`**/`].includes(r))return`${n}${r}`;let i=r.indexOf(`/`);return`${n}${i<0||i===r.length-1?`**/`:``}${(i===0?r.slice(1):r).replaceAll(/(?=((?:\\.|[^{(])*))\1([{(])/guy,`$1\\$2`)}${r.endsWith(`/**`)?`/*`:``}`}function C(e){return n.readFileSync(e,`utf8`).split(/\r?\n/u).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`#`)).map(S)}function w(e){if(typeof e==`string`)return{gitignoreResolution:!1,name:e};let t=e??{};if(typeof t!=`object`||Array.isArray(t))throw TypeError("The options argument to `includeIgnoreFile()` should be an object or a string.");let n=t.gitignoreResolution??!1;if(typeof n!=`boolean`)throw TypeError("The `gitignoreResolution` option must be specified a boolean or omitted");let r=t.name??`Imported .gitignore patterns`;if(typeof r!=`string`)throw TypeError("The `name` option must be specified as a string or omitted.");return{gitignoreResolution:n,name:r}}function T(e,t){let n=!Array.isArray(e),i=Array.isArray(e)?e:[e];for(let e of i){if(typeof e!=`string`)throw TypeError("The first argument to `includeIgnoreFile()` should be a string or array of strings");if(!r.isAbsolute(e))throw Error(`The ignore file location must be an absolute path. Received ${e}`)}let{gitignoreResolution:a,name:o}=w(t);return n?{name:o,ignores:C(e),...a?{basePath:r.dirname(e)}:{}}:i.map((e,t)=>({name:`${o} (${t})`,ignores:C(e),...a?{basePath:r.dirname(e)}:{}}))}t.convertIgnorePatternToMinimatch=S,t.defineConfig=y,t.globalIgnores=x,t.includeIgnoreFile=T})),r=(/* @__PURE__ */ t(((e,t)=>{let{defineConfig:r,globalIgnores:i,includeIgnoreFile:a}=n();t.exports={defineConfig:r,globalIgnores:i,includeIgnoreFile:a}})))(),i=r.defineConfig,a=r.globalIgnores,o=r.includeIgnoreFile;export{i as defineConfig,a as globalIgnores,o as includeIgnoreFile};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import{r as e,t}from"./rolldown-runtime-C7uQZ-1I.js";import{C as n,l as r,m as i,n as a,p as o,r as s,s as c,t as l,w as u,x as d}from"./eslint-helpers-4m3QC9jt.js";import{t as f}from"./naming-BtEmRC_V.js";var p=/* @__PURE__ */ t(((e,t)=>{t.exports=function(e,t){let n=t.align,r=t.stringLength,i=e.map(e=>e.map(e=>r(e))),a=i.reduce((e,t)=>(t.forEach((t,n)=>{(!e[n]||t>e[n])&&(e[n]=t)}),e),[]);return e.map((e,t)=>e.map((e,r)=>{let o=a[r]-i[t][r]||0,s=o>0?` `.repeat(o):``;return n[r]===`r`?s+e:e+s}).join(` `).trimEnd()).join(`
|
|
2
|
+
`)}})),m=/* @__PURE__ */ t(((t,n)=>{let r=e(`node:util`),i=p();function a(e){return e===void 0?(e,t)=>r.styleText(e,t,{validateStream:!0}):e?(e,t)=>r.styleText(e,t,{validateStream:!1}):(e,t)=>t}function o(e){return e.includes(`\x1B`)||e.includes(``)?r.stripVTControlCharacters(e).length:e.length}function s(e,t){return t===1?e:`${e}s`}n.exports=function(e,t){let n=a(t?.color),r=`
|
|
3
|
+
`,c=0,l=0,u=0,d=0,f=`yellow`;e.forEach(e=>{let t=e.messages;t.length!==0&&(c+=e.errorCount,l+=e.warningCount,u+=e.fixableErrorCount,d+=e.fixableWarningCount,r+=`${n(`underline`,e.filePath)}\n`,r+=`${i(t.map(e=>{let t;e.fatal||e.severity===2?(t=n(`red`,`error`),f=`red`):t=n(`yellow`,`warning`);let r=e.message;return r.length>1&&r.endsWith(`.`)&&r.at(-2)!==` `&&(r=r.slice(0,-1)),[``,String(e.line||0),String(e.column||0),t,r,e.ruleId?n(`dim`,e.ruleId):``]}),{align:[``,`r`,`l`],stringLength:o}).split(`
|
|
4
|
+
`).map(e=>e.replace(/(\d+)\s+(\d+)/u,(e,t,r)=>n(`dim`,`${t}:${r}`))).join(`
|
|
5
|
+
`)}\n\n`)});let p=c+l;return p>0&&(r+=`${n(f,n(`bold`,[`✖ `,p,s(` problem`,p),` (`,c,s(` error`,c),`, `,l,s(` warning`,l),`)`].join(``)))}\n`,(u>0||d>0)&&(r+=`${n(f,n(`bold`,[` `,u,s(` error`,u),` and `,d,s(` warning`,d)," potentially fixable with the `--fix` option."].join(``)))}\n`)),p>0?n(`reset`,r):``}})),h=/* @__PURE__ */ t(((e,t)=>{let n=(function(){let e={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},t=/[&<>"']/gu;return function(n){return n?n.toString().replace(t,t=>e[t]||t):``}})();function r(e){let{reportColor:t,reportSummary:n,date:r,results:i}=e;return`
|
|
6
|
+
<!DOCTYPE html>
|
|
7
|
+
<html>
|
|
8
|
+
<head>
|
|
9
|
+
<meta charset="UTF-8">
|
|
10
|
+
<title>ESLint Report</title>
|
|
11
|
+
<link rel="icon" type="image/png" sizes="any" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAHaAAAB2gGFomX7AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABD1JREFUWMPFl11sk2UUx3/nbYtjxS1MF7MLMTECMgSTtSSyrQkLhAj7UBPnDSEGoxegGzMwojhXVpmTAA5iYpSoMQa8GBhFOrMFk03buei6yRAlcmOM0SEmU9d90b19jxcM1o5+sGnsc/e+z/l6ztf/HFFVMnns6QieeOCHBePGsHM+wrOtvLG2C4WRVDSSygNV7sCjlspxwDnPB44aols/DXk+mbMBmx/6OseITF1CuOtfevkPh2Uu+/jbdX8lujSScRlT5r7/QDlAfsRmfzmpnkQ/H3H13gf6bBrBn1uqK8WylgEnU8eZmk1repbfchJG1TyKyIKEwuBHFd3lD3naY3O1siiwXsVoBV2VgM1ht/QQUJk2ByqKghsQziYQ8ifKgexIXmuyzC4r67Y7R+xPAfuB/Nn3Cpva+0s7khpQVtZtd4bt51BWxtBYAiciprG7c7D4SixzU9PYalDL6110Ifb/w8W9eY7JqFeFHbO8fPGyLHwwFHJNJTSgwtVTB9oaw9BlQ+tO93vOxypoaQnfE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uNTlWODcuODQzYzAtMS40ODEsMC44ODQtMi44NDksMi4xNjctMy41OSBsNzMuNzA3LTQyLjUyN2MxLjI4Mi0wLjc0MSwyLjg4Ni0wLjc0MSw0LjE2OCwwbDczLjc3Miw0Mi41MjdjMS4yODMsMC43NDEsMi4xODYsMi4xMDksMi4xODYsMy41OVYxNzIuODk4eicvPg0KPC9zdmc+">
|
|
13
|
+
<style>
|
|
14
|
+
body {
|
|
15
|
+
font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
font-weight: normal;
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
color: #333;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
#overview {
|
|
24
|
+
padding: 20px 30px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
td,
|
|
28
|
+
th {
|
|
29
|
+
padding: 5px 10px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
h1 {
|
|
33
|
+
margin: 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
table {
|
|
37
|
+
margin: 30px;
|
|
38
|
+
width: calc(100% - 60px);
|
|
39
|
+
max-width: 1000px;
|
|
40
|
+
border-radius: 5px;
|
|
41
|
+
border: 1px solid #ddd;
|
|
42
|
+
border-spacing: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
th {
|
|
46
|
+
font-weight: 400;
|
|
47
|
+
font-size: medium;
|
|
48
|
+
text-align: left;
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
td.clr-1,
|
|
53
|
+
td.clr-2,
|
|
54
|
+
th span {
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
th span {
|
|
59
|
+
float: right;
|
|
60
|
+
margin-left: 20px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
th span::after {
|
|
64
|
+
content: "";
|
|
65
|
+
clear: both;
|
|
66
|
+
display: block;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
tr:last-child td {
|
|
70
|
+
border-bottom: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
tr td:first-child,
|
|
74
|
+
tr td:last-child {
|
|
75
|
+
color: #9da0a4;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#overview.bg-0,
|
|
79
|
+
tr.bg-0 th {
|
|
80
|
+
color: #468847;
|
|
81
|
+
background: #dff0d8;
|
|
82
|
+
border-bottom: 1px solid #d6e9c6;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
#overview.bg-1,
|
|
86
|
+
tr.bg-1 th {
|
|
87
|
+
color: #f0ad4e;
|
|
88
|
+
background: #fcf8e3;
|
|
89
|
+
border-bottom: 1px solid #fbeed5;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
#overview.bg-2,
|
|
93
|
+
tr.bg-2 th {
|
|
94
|
+
color: #b94a48;
|
|
95
|
+
background: #f2dede;
|
|
96
|
+
border-bottom: 1px solid #eed3d7;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
td {
|
|
100
|
+
border-bottom: 1px solid #ddd;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
td.clr-1 {
|
|
104
|
+
color: #f0ad4e;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
td.clr-2 {
|
|
108
|
+
color: #b94a48;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
td a {
|
|
112
|
+
color: #3a33d1;
|
|
113
|
+
text-decoration: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
td a:hover {
|
|
117
|
+
color: #272296;
|
|
118
|
+
text-decoration: underline;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
121
|
+
</head>
|
|
122
|
+
<body>
|
|
123
|
+
<div id="overview" class="bg-${t}">
|
|
124
|
+
<h1>ESLint Report</h1>
|
|
125
|
+
<div>
|
|
126
|
+
<span>${n}</span> - Generated on ${r}
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<table>
|
|
130
|
+
<tbody>
|
|
131
|
+
${i}
|
|
132
|
+
</tbody>
|
|
133
|
+
</table>
|
|
134
|
+
<script type="text/javascript">
|
|
135
|
+
var groups = document.querySelectorAll("tr[data-group]");
|
|
136
|
+
for (i = 0; i < groups.length; i++) {
|
|
137
|
+
groups[i].addEventListener("click", function() {
|
|
138
|
+
var inGroup = document.getElementsByClassName(this.getAttribute("data-group"));
|
|
139
|
+
this.innerHTML = (this.innerHTML.indexOf("+") > -1) ? this.innerHTML.replace("+", "-") : this.innerHTML.replace("-", "+");
|
|
140
|
+
for (var j = 0; j < inGroup.length; j++) {
|
|
141
|
+
inGroup[j].style.display = (inGroup[j].style.display !== "none") ? "none" : "table-row";
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
<\/script>
|
|
146
|
+
</body>
|
|
147
|
+
</html>
|
|
148
|
+
`.trimStart()}function i(e,t){return t===1?e:`${e}s`}function a(e,t){let n=e+t,r=`${n} ${i(`problem`,n)}`;return n!==0&&(r+=` (${e} ${i(`error`,e)}, ${t} ${i(`warning`,t)})`),r}function o(e,t){return e===0?t===0?0:1:2}function s(e){let{parentIndex:t,lineNumber:r,columnNumber:i,severityNumber:a,severityName:o,message:s,ruleUrl:c,ruleId:l}=e;return`
|
|
149
|
+
<tr style="display: none;" class="f-${t}">
|
|
150
|
+
<td>${r}:${i}</td>
|
|
151
|
+
<td class="clr-${a}">${o}</td>
|
|
152
|
+
<td>${n(s)}</td>
|
|
153
|
+
<td>
|
|
154
|
+
<a href="${c||``}" target="_blank" rel="noopener noreferrer">${n(l)}</a>
|
|
155
|
+
</td>
|
|
156
|
+
</tr>
|
|
157
|
+
`.trimStart()}function c(e,t,n){return e.map(e=>{let r=e.line||0,i=e.column||0,a;if(n){let t=n[e.ruleId];t&&t.docs&&t.docs.url&&(a=t.docs.url)}return s({parentIndex:t,lineNumber:r,columnNumber:i,severityNumber:e.severity,severityName:e.severity===1?`Warning`:`Error`,message:e.message,ruleId:e.ruleId,ruleUrl:a})}).join(`
|
|
158
|
+
`)}function l(e){let{color:t,index:r,filePath:i,summary:a}=e;return`
|
|
159
|
+
<tr class="bg-${t}" data-group="f-${r}">
|
|
160
|
+
<th colspan="4">
|
|
161
|
+
[+] ${n(i)}
|
|
162
|
+
<span>${n(a)}</span>
|
|
163
|
+
</th>
|
|
164
|
+
</tr>
|
|
165
|
+
`.trimStart()}function u(e,t){return e.map((e,n)=>l({index:n,color:o(e.errorCount,e.warningCount),filePath:e.filePath,summary:a(e.errorCount,e.warningCount)})+c(e.messages,n,t)).join(`
|
|
166
|
+
`)}t.exports=function(e,t){let n,i,s=t?t.rulesMeta:{};return n=0,i=0,e.forEach(e=>{n+=e.errorCount,i+=e.warningCount}),r({date:/* @__PURE__ */ new Date,reportColor:o(n,i),reportSummary:a(n,i),results:u(e,s)})}})),g=/* @__PURE__ */ t(((e,t)=>{t.exports=function(e){return JSON.stringify(e)}})),_=/* @__PURE__ */ t(((e,t)=>{t.exports=function(e,t){return JSON.stringify({results:e,metadata:t})}})),v=/* @__PURE__ */ t((e=>{function t(e){globalThis?.process?.env.DEBUG===`@hwc/retry`&&console.debug(e)}function n(e,t){let n=Date.now()-e.lastAttempt,r=Math.max(e.lastAttempt-e.timestamp,1);return n>=Math.min(r*1.2,t)}function r(e,t){return e.age>t}function i(){if(Promise.withResolvers)return Promise.withResolvers();let e,t,n=new Promise((n,r)=>{e=n,t=r});if(e===void 0||t===void 0)throw Error(`Promise executor did not initialize resolve or reject.`);return{promise:n,resolve:e,reject:t}}var a=class{id=Math.random().toString(36).slice(2);fn;error;timestamp=Date.now();lastAttempt=this.timestamp;resolve;reject;signal;constructor(e,t,n,r,i){this.fn=e,this.error=t,this.timestamp=Date.now(),this.lastAttempt=Date.now(),this.resolve=n,this.reject=r,this.signal=i}get age(){return Date.now()-this.timestamp}};e.Retrier=class{#e=[];#t=[];#n=0;#r;#i;#a;#o;#s;constructor(e,{timeout:t=6e4,maxDelay:n=100,concurrency:r=1e3}={}){if(typeof e!=`function`)throw Error(`Missing function to check errors`);this.#o=e,this.#r=t,this.#i=n,this.#s=r}get retrying(){return this.#e.length}get pending(){return this.#t.length}get working(){return this.#n}#c(e,{signal:n,promise:r,resolve:i,reject:o}){let s;try{s=e()}catch(e){return o(Error(`Synchronous error: ${e.message}`,{cause:e})),r}return!s||typeof s.then!=`function`?(o(/* @__PURE__ */ Error(`Result is not a promise.`)),r):(this.#n++,r.finally(()=>{this.#n--,this.#u()}).catch(()=>{}),Promise.resolve(s).then(e=>{t(`Function called successfully without retry.`),i(e)}).catch(r=>{if(!this.#o(r)){o(r);return}let s=new a(e,r,i,o,n);t(`Function failed, queuing for retry with task ${s.id}.`),this.#e.push(s),n?.addEventListener(`abort`,()=>{t(`Task ${s.id} was aborted due to AbortSignal.`),o(n.reason)}),this.#d()}),r)}retry(e,{signal:t}={}){t?.throwIfAborted();let{promise:n,resolve:r,reject:a}=i();return this.#t.push(()=>this.#c(e,{signal:t,promise:n,resolve:r,reject:a})),this.#u(),n}#l(){this.pending&&this.#u(),this.retrying&&this.#d()}#u(){t(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);let e=this.#s-this.working;if(e<=0)return;let n=Math.min(this.pending,e);for(let e=0;e<n;e++)this.#t.shift()?.();t(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`)}#d(){clearTimeout(this.#a),this.#a=void 0,t(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`);let e=()=>{this.#a=setTimeout(()=>this.#l(),0)},i=this.#e.shift();if(!i){t(`Queue is empty, exiting.`),this.pending&&e();return}if(r(i,this.#r)){t(`Task ${i.id} was abandoned due to timeout.`),i.reject(i.error),e();return}if(!n(i,this.#i)){t(`Task ${i.id} is not ready to retry, skipping.`),this.#e.push(i),e();return}i.lastAttempt=Date.now(),Promise.resolve(i.fn()).then(e=>{t(`Task ${i.id} succeeded after ${i.age}ms.`),i.resolve(e)}).catch(e=>{if(!this.#o(e)){t(`Task ${i.id} failed with non-retryable error: ${e.message}.`),i.reject(e);return}i.lastAttempt=Date.now(),this.#e.push(i),t(`Task ${i.id} failed, requeueing to try again.`)}).finally(()=>{this.#l()})}}})),y=/* @__PURE__ */ t((t=>{let n=e(`node:module`).createRequire;function r(e,t){return n(t).resolve(e)}t.resolve=r})),b=/* @__PURE__ */ t(((t,p)=>{n();let{existsSync:b}=e(`node:fs`),x=e(`node:fs/promises`),S=e(`node:os`),C=e(`node:path`),{pathToFileURL:w}=e(`node:url`),{SHARE_ENV:ee,Worker:te}=e(`node:worker_threads`),{version:ne}=u(),{defaultConfig:re}=i(),T=o(),ie={stylish:m(),html:h(),json:g(),"json-with-metadata":_()},{createDebug:ae,findFiles:oe,getCacheFile:E,isNonEmptyString:D,isArrayOfNonEmptyString:O,createIgnoreResult:se,isErrorMessage:k,getPlaceholderPath:A,processOptions:ce,loadOptionsFromModule:le,getFixerForFixTypes:ue,verifyText:j,lintFile:M,createLinter:N,createLintResultCache:P,createDefaultConfigs:F,createConfigLoader:I}=l(),{Retrier:L}=v(),{ConfigLoader:R}=s(),{WarningService:z}=c(),{SuppressionsService:B}=a(),{Config:V}=r(),{getShorthandName:H,getNamespaceFromTerm:U,normalizePackageName:W}=f(),{resolve:de}=y(),G=process.hrtime.bigint,K=ae(`eslint:eslint`),q=/* @__PURE__ */ new WeakMap,fe=/* @__PURE__ */ new Set([`checkstyle`,`codeframe`,`compact`,`jslint-xml`,`junit`,`table`,`tap`,`unix`,`visualstudio`]),J=/* @__PURE__ */ new Set([`ENFILE`,`EMFILE`]);function pe(e){return Array.from(e).reduce((e,[t,n])=>(e[t]=n.meta,e),{})}function me(e){if(typeof e.deprecated!=`object`)return e.replacedBy||[];let{replacedBy:t}=e.deprecated;return Array.isArray(t)?t.map(e=>{if(typeof e!=`object`||!e)return``;let t=e.plugin?.name,n=e.rule?.name;return`${typeof t==`string`?`${H(t,`eslint-plugin`)}/`:``}${typeof n==`string`?n:``}`}):[]}let Y=/* @__PURE__ */ new WeakMap;function he(e,t){let{options:{cwd:n},configLoader:r}=q.get(e),i=C.isAbsolute(t)?t:A(n),a=r.getCachedConfigArrayForFile(i).getConfig(i);if(a&&!Y.has(a)){let e=[];if(a.rules)for(let[t,n]of Object.entries(a.rules)){if(V.getRuleNumericSeverity(n)===0)continue;let r=a.getRuleDefinition(t),i=r&&r.meta;if(i&&i.deprecated){let n=typeof i.deprecated==`object`;e.push({ruleId:t,replacedBy:me(i),info:n?i.deprecated:void 0})}}Y.set(a,Object.freeze(e))}return a?Y.get(a):Object.freeze([])}function X(e,t){let n={configurable:!0,enumerable:!0,get(){return he(e,this.filePath)}};for(let e of t)Object.defineProperty(e,"usedDeprecatedRules",n);return t}function ge(e,t){return e.filePath<t.filePath?-1:+(e.filePath>t.filePath)}async function _e({configFile:e,cwd:t}){let n=await new R({cwd:t,configFile:e}).findConfigFileForPath(C.join(t,`__placeholder__.js`));if(!n)throw Error(`No ESLint configuration file was found.`);return{configFilePath:n,basePath:e?t:C.dirname(n)}}function Z(e){return TypeError(`Results object was not created from this ESLint instance.`,{cause:e})}function Q(e,t){let n=Math.ceil(e/50);return n>t&&(n=t),n<=1&&(n=0),n}function ve(e,t,n,r){let i=e.getValidCachedLintResults(n,r);return!i||t&&i.messages&&i.messages.length>0}function ye(e,t,n){let r=G(),{configLoader:i,lintResultCache:a,options:{cacheStrategy:o,fix:s}}=q.get(e),c=!a||o===`content`,l=0,u=t.length,d=0;for(let e of t){let t=Q(l+u,n);if(d>=t)break;u--;let r=i.getCachedConfigArrayForFile(e).getConfig(e);r&&(c||ve(a,s,e,r))&&(l++,d=Q(l,n))}return K(`%d file(s) to process counted in %t`,l,G()-r),d}function be(e,t,{availableParallelism:n}=S){let{concurrency:r}=q.get(e).options;switch(r){case`off`:return 0;case`auto`:return ye(e,t,n()>>1);default:{let e=Math.min(r,t.length);return e>1?e:0}}}let $=Symbol(`Do not check for uncloneable options.`);async function xe(e,t,n,r){let i=e.length,a=Array(i),o=w(C.join(d,`./worker.js`)),s=new Uint32Array(new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT)),c=new AbortController,l=c.signal,u={env:ee,workerData:{eslintOptionsOrURL:n,filePathIndexArray:s,filePaths:e}},f=1;function p(e,t){let n=G(),r=new te(o,u);r.once(`message`,t=>{let r=G()-n,i=Number(t.netLintingDuration)/Number(r);f=Math.min(f,i),T.enabled&&t.timings&&T.mergeData(t.timings);for(let e of t){let{index:t}=e;delete e.index,a[t]=e}e()}),r.once(`error`,e=>{c.abort(e),t(e)}),l.addEventListener(`abort`,()=>r.terminate())}let m=Array(t);for(let e=0;e<t;++e)m[e]=new Promise(p);try{await Promise.all(m)}catch(e){throw T.disableDisplay(),e}return f<.7&&r(),a}async function Se(e,t,n,r,i){let{configLoader:a,lintResultCache:o}=q.get(e),s=await xe(t,n,r,i);return o&&s.forEach((e,n)=>{if(e){let r=t[n],i=a.getCachedConfigArrayForFile(r).getConfig(r);i&&o.setCachedLintResults(r,i,e)}}),s}async function Ce(e,t){let{configLoader:n,linter:r,lintResultCache:i,options:a}=q.get(e),o=new AbortController,s=new L(e=>J.has(e.code),{concurrency:100});return await Promise.all(t.map(async e=>{let t=n.getCachedConfigArrayForFile(e),c=t.getConfig(e),l=await M(e,t,a,r,i,null,s,o);return c&&i?.setCachedLintResults(e,c,l),l}))}function we(e){try{structuredClone(e);return}catch{}let t=Object.keys(e).filter(t=>{try{structuredClone(e[t])}catch{return!0}return!1}).sort(),n=/* @__PURE__ */ TypeError(`The ${t.length===1?`option`:`options`} ${new Intl.ListFormat(`en-US`).format(t.map(e=>`"${e}"`))} cannot be cloned. When concurrency is enabled, all options must be cloneable values (JSON values). Remove uncloneable options or use an options module.`);throw n.code=`ESLINT_UNCLONEABLE_OPTIONS`,n}var Te=class e{static configType=`flat`;#e;#t;constructor(e={}){let t=ce(e);!e[$]&&t.concurrency!==`off`&&(we(e),this.#t=e);let n=new z,r=N(t,n),i=E(t.cacheLocation,t.cwd),a=P(t,i),o=null;if(t.applySuppressions){let e=E(t.suppressionsLocation,t.cwd,{prefix:`suppressions_`});o=new B({filePath:e,cwd:t.cwd})}let s=F(e.plugins);this.#e=I(t,s,r,n),q.set(this,{options:t,linter:r,cacheFilePath:i,lintResultCache:a,defaultConfigs:s,configs:null,configLoader:this.#e,warningService:n,suppressionsService:o}),b(C.resolve(t.cwd,`.eslintignore`))&&n.emitESLintIgnoreWarning()}static get version(){return ne}static get defaultConfig(){return re}static async outputFixes(e){if(!Array.isArray(e))throw Error(`'results' must be an array`);let t=new L(e=>J.has(e.code),{concurrency:100});await Promise.all(e.filter(e=>{if(typeof e!=`object`||!e)throw Error(`'results' must include only objects`);return typeof e.output==`string`&&C.isAbsolute(e.filePath)}).map(e=>t.retry(()=>x.writeFile(e.filePath,e.output))))}static getErrorResults(e){let t=[];return e.forEach(e=>{let n=e.messages.filter(k),r=e.suppressedMessages.filter(k);n.length>0&&t.push({...e,messages:n,suppressedMessages:r,errorCount:n.length,warningCount:0,fixableErrorCount:e.fixableErrorCount,fixableWarningCount:0})}),t}static async fromOptionsModule(t){if(!(t instanceof URL))throw TypeError(`Argument must be a URL object`);let n=t.href,r={...await le(n),[$]:!0},i=new e(r);return r.concurrency!==`off`&&(i.#t=n),i}getRulesMetaForResults(e){if(e.length===0)return{};let t=/* @__PURE__ */ new Map,{configLoader:n,options:{cwd:r}}=q.get(this);for(let i of e){let e=i.filePath===`<text>`?A(r):i.filePath,a=i.messages.concat(i.suppressedMessages);for(let{ruleId:r}of a){if(!r)continue;let i;try{i=n.getCachedConfigArrayForFile(e)}catch(e){throw Z(e)}let a=i.getConfig(e);if(!a)throw Z();let o=a.getRuleDefinition(r);o&&t.set(r,o)}}return pe(t)}hasFlag(e){return q.get(this).linter.hasFlag(e)}async lintFiles(e){let t=e,{cacheFilePath:n,lintResultCache:r,options:i,warningService:a,suppressionsService:o}=q.get(this);if(e===``||Array.isArray(e)&&e.length===0){if(i.passOnNoPatterns)return[];t=[`.`]}else{if(!D(e)&&!O(e))throw Error(`'patterns' must be a non-empty string or an array of non-empty strings`);typeof e==`string`&&(t=[e])}K(`Using file patterns: %s`,t);let{concurrency:s,cwd:c,globInputPaths:l,errorOnUnmatchedPattern:u}=i;if(!r&&n){K(`Deleting cache file at %s`,n);try{b(n)&&await x.unlink(n)}catch(e){if(b(n))throw e}}let d=G(),f=await oe({patterns:t,cwd:c,globInputPaths:l,configLoader:this.#e,errorOnUnmatchedPattern:u});K(`%d file(s) found in %t`,f.length,G()-d);let m,h=p.exports.calculateWorkerCount(this,f);if(h){K(`Linting using %d worker thread(s).`,h);let e;e=h<=2?`disable concurrency`:s===`auto`?`disable concurrency or use a numeric concurrency setting`:`reduce or disable concurrency`,m=await Se(this,f,h,this.#t,()=>a.emitPoorConcurrencyWarning(e))}else K(`Linting in single-thread mode.`),m=await Ce(this,f);r&&r.reconcile();let g=m.filter(e=>!!e);if(!i.applySuppressions)return X(this,g);let{results:_}=o.applySuppressions(g,await o.load());return X(this,_)}async lintText(e,t={}){if(typeof e!=`string`)throw Error(`'code' must be a string`);if(typeof t!=`object`)throw Error(`'options' must be an object, null, or undefined`);let{filePath:n,warnIgnored:r,...i}=t||{},a=Object.keys(i);if(a.length>0)throw Error(`'options' must not include the unknown option(s): ${a.join(`, `)}`);if(n!==void 0&&!D(n))throw Error(`'options.filePath' must be a non-empty string or undefined`);if(typeof r!=`boolean`&&r!==void 0)throw Error(`'options.warnIgnored' must be a boolean or undefined`);let{linter:o,options:s,suppressionsService:c}=q.get(this),{allowInlineConfig:l,cwd:u,fix:d,fixTypes:f,warnIgnored:p,ruleFilter:m,stats:h}=s,g=[],_=G(),v=f?new Set(f):null,y=C.resolve(u,n||`__placeholder__.js`),b=await this.#e.loadConfigArrayForFile(y),x=b?.getConfigStatus(y)??`unconfigured`;if(y&&x!==`matched`)(typeof r==`boolean`?r:p)&&g.push(se(y,u,x));else{let t=b.getConfig(y),n=ue(d,v,t);g.push(j({text:e,filePath:y.endsWith(`__placeholder__.js`)?`<text>`:y,configs:b,cwd:u,fix:n,allowInlineConfig:l,ruleFilter:m,stats:h,linter:o}))}if(K(`Linting complete in %t`,G()-_),!n||!s.applySuppressions)return X(this,g);let{results:S}=c.applySuppressions(g,await c.load());return X(this,S)}async loadFormatter(e=`stylish`){if(typeof e!=`string`)throw Error(`'name' must be a string`);let t=e.replace(/\\/gu,`/`),n=U(t),{cwd:r}=q.get(this).options,i,a=!1;if(!n&&t.includes(`/`))i=C.resolve(r,t);else try{let e=W(t,`eslint-formatter`);i=de(e,A(r))}catch{i=C.resolve(d,`../`,`cli-engine`,`formatters`,`${t}.js`),a=!0}let o;try{o=a&&ie[t]||(await import(w(i))).default}catch(t){throw t.message=a&&fe.has(e)?`The ${e} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${e}\``:`There was a problem loading formatter: ${i}\nError: ${t.message}`,t}if(typeof o!=`function`)throw TypeError(`Formatter must be a function, but got a ${typeof o}.`);let s=this;return{format(e,t){let n=null;return e.sort(ge),o(e,{...t,cwd:r,get rulesMeta(){return n||=s.getRulesMetaForResults(e),n}})}}}async calculateConfigForFile(e){if(!D(e))throw Error(`'filePath' must be a non-empty string`);let t=q.get(this).options,n=C.resolve(t.cwd,e),r=await this.#e.loadConfigArrayForFile(n);if(!r){let e=/* @__PURE__ */ Error(`Could not find config file.`);throw e.messageTemplate=`config-file-missing`,e}return r.getConfig(n)}async findConfigFile(e){let t=q.get(this).options,n=C.join(t.cwd,`__placeholder__`);return this.#e.findConfigFileForPath(e??n).catch(()=>void 0)}async isPathIgnored(e){return await this.calculateConfigForFile(e)===void 0}};async function Ee(){return!0}p.exports={ESLint:Te,shouldUseFlatConfig:Ee,locateConfigFileToUse:_e,calculateWorkerCount:be}}));export{b as t};
|