github-archiver 1.0.1 → 1.0.4
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/.releaserc.json +9 -1
- package/CHANGELOG.md +25 -0
- package/bin/github-archiver.js +1 -1
- package/package.json +6 -2
- package/.claude/CLAUDE.md +0 -248
- package/.claude/settings.json +0 -15
- package/.github/dependabot.yml +0 -76
- package/.github/workflows/ci.yml +0 -64
- package/.github/workflows/release.yml +0 -55
- package/AGENTS.md +0 -248
- package/CONTRIBUTING.md +0 -343
- package/QUICKSTART.md +0 -221
- package/bun.lock +0 -1380
- package/issues.txt +0 -1105
- package/notes.md +0 -0
- package/scripts/build.ts +0 -14
- package/src/commands/archive.ts +0 -344
- package/src/commands/auth.ts +0 -184
- package/src/constants/defaults.ts +0 -6
- package/src/constants/messages.ts +0 -24
- package/src/constants/paths.ts +0 -12
- package/src/index.ts +0 -42
- package/src/services/archiver.ts +0 -192
- package/src/services/auth-manager.ts +0 -79
- package/src/services/github.ts +0 -211
- package/src/types/config.ts +0 -24
- package/src/types/error.ts +0 -35
- package/src/types/github.ts +0 -34
- package/src/types/index.ts +0 -4
- package/src/utils/colors.ts +0 -79
- package/src/utils/config.ts +0 -95
- package/src/utils/errors.ts +0 -93
- package/src/utils/formatting.ts +0 -65
- package/src/utils/input-handler.ts +0 -163
- package/src/utils/logger.ts +0 -65
- package/src/utils/parser.ts +0 -125
- package/src/utils/progress.ts +0 -87
- package/tests/unit/formatting.test.ts +0 -93
- package/tests/unit/parser.test.ts +0 -140
- package/tsconfig.json +0 -36
package/issues.txt
DELETED
|
@@ -1,1105 +0,0 @@
|
|
|
1
|
-
src\commands\archive.ts:29:16 lint/complexity/noExcessiveCognitiveComplexity ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
2
|
-
|
|
3
|
-
× Excessive complexity of 25 detected (max: 20).
|
|
4
|
-
|
|
5
|
-
27 │ }
|
|
6
|
-
28 │
|
|
7
|
-
> 29 │ async function archiveCommand(options: CommandOptions): Promise<void> {
|
|
8
|
-
│ ^^^^^^^^^^^^^^
|
|
9
|
-
30 │ try {
|
|
10
|
-
31 │ logger.info("Archive command started", { options });
|
|
11
|
-
|
|
12
|
-
i Please refactor this function to reduce its complexity score from 25 to the max allowed complexity 20.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
src\commands\archive.ts:77:9 lint/suspicious/noEvolvingTypes ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
16
|
-
|
|
17
|
-
× The type of this variable may evolve implicitly to any type, including the any type.
|
|
18
|
-
|
|
19
|
-
75 │ console.log("📝 Getting repositories...");
|
|
20
|
-
76 │
|
|
21
|
-
> 77 │ let repositories = [];
|
|
22
|
-
│ ^^^^^^^^^^^^
|
|
23
|
-
78 │ let parseErrors: Array<{ url: string; error: string; line: number }> = [];
|
|
24
|
-
79 │
|
|
25
|
-
|
|
26
|
-
i Add an explicit type or initialization to avoid implicit type evolution.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
src\commands\archive.ts:103:7 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
30
|
-
|
|
31
|
-
× Prefer for...of instead of forEach.
|
|
32
|
-
|
|
33
|
-
101 │ if (parseErrors.length > 0) {
|
|
34
|
-
102 │ console.warn(`!� Found ${parseErrors.length} invalid repositories:`);
|
|
35
|
-
> 103 │ parseErrors.forEach((err) => {
|
|
36
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
37
|
-
> 104 │ console.warn(` Line ${err.line}: ${err.error}`);
|
|
38
|
-
> 105 │ });
|
|
39
|
-
│ ^^
|
|
40
|
-
106 │ console.warn("");
|
|
41
|
-
107 │ }
|
|
42
|
-
|
|
43
|
-
i forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
src\commands\archive.ts:174:7 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
47
|
-
|
|
48
|
-
× Prefer for...of instead of forEach.
|
|
49
|
-
|
|
50
|
-
172 │ console.log("");
|
|
51
|
-
173 │ console.log("❌ Failed repositories:");
|
|
52
|
-
> 174 │ results
|
|
53
|
-
│ ^^^^^^^
|
|
54
|
-
> 175 │ .filter((r) => !r.success)
|
|
55
|
-
> 176 │ .forEach((r) => {
|
|
56
|
-
> 177 │ console.log(` ${r.owner}/${r.repo}: ${r.message}`);
|
|
57
|
-
> 178 │ });
|
|
58
|
-
│ ^^
|
|
59
|
-
179 │ }
|
|
60
|
-
180 │
|
|
61
|
-
|
|
62
|
-
i forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
src\commands\archive.ts:185:7 lint/complexity/noForEach ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
66
|
-
|
|
67
|
-
× Prefer for...of instead of forEach.
|
|
68
|
-
|
|
69
|
-
183 │ console.log("");
|
|
70
|
-
184 │ console.log("!� Skipped repositories:");
|
|
71
|
-
> 185 │ results
|
|
72
|
-
│ ^^^^^^^
|
|
73
|
-
> 186 │ .filter((r) => r.success && !r.archived)
|
|
74
|
-
> 187 │ .forEach((r) => {
|
|
75
|
-
> 188 │ console.log(` ${r.owner}/${r.repo}: ${r.message}`);
|
|
76
|
-
> 189 │ });
|
|
77
|
-
│ ^^
|
|
78
|
-
190 │ }
|
|
79
|
-
191 │
|
|
80
|
-
|
|
81
|
-
i forEach may lead to performance issues when working with large arrays. When combined with functions like filter or map, this causes multiple iterations over the same type.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
src\commands\archive.ts:269:17 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
85
|
-
|
|
86
|
-
× Unexpected any. Specify a different type.
|
|
87
|
-
|
|
88
|
-
267 │ async function archiveRepositories(
|
|
89
|
-
268 │ archiver: Archiver,
|
|
90
|
-
> 269 │ repositories: any[],
|
|
91
|
-
│ ^^^
|
|
92
|
-
270 │ options: any,
|
|
93
|
-
271 │ progressDisplay: ProgressDisplay
|
|
94
|
-
|
|
95
|
-
i any disables many type checking rules. Its use should be avoided.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
src\commands\archive.ts:270:12 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
99
|
-
|
|
100
|
-
× Unexpected any. Specify a different type.
|
|
101
|
-
|
|
102
|
-
268 │ archiver: Archiver,
|
|
103
|
-
269 │ repositories: any[],
|
|
104
|
-
> 270 │ options: any,
|
|
105
|
-
│ ^^^
|
|
106
|
-
271 │ progressDisplay: ProgressDisplay
|
|
107
|
-
272 │ ): Promise<any[]> {
|
|
108
|
-
|
|
109
|
-
i any disables many type checking rules. Its use should be avoided.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
src\commands\archive.ts:272:12 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
113
|
-
|
|
114
|
-
× Unexpected any. Specify a different type.
|
|
115
|
-
|
|
116
|
-
270 │ options: any,
|
|
117
|
-
271 │ progressDisplay: ProgressDisplay
|
|
118
|
-
> 272 │ ): Promise<any[]> {
|
|
119
|
-
│ ^^^
|
|
120
|
-
273 │ const results = await archiver.archiveRepositories(repositories, options);
|
|
121
|
-
274 │
|
|
122
|
-
|
|
123
|
-
i any disables many type checking rules. Its use should be avoided.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
src\commands\archive.ts:284:17 lint/style/useTemplate FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
127
|
-
|
|
128
|
-
× Template literals are preferred over string concatenation.
|
|
129
|
-
|
|
130
|
-
283 │ if (progressDisplay.shouldUpdate()) {
|
|
131
|
-
> 284 │ console.log("\r" + progressDisplay.getProgressBar(progress));
|
|
132
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
133
|
-
285 │ }
|
|
134
|
-
286 │
|
|
135
|
-
|
|
136
|
-
i Unsafe fix: Use a template literal.
|
|
137
|
-
|
|
138
|
-
282 282 │
|
|
139
|
-
283 283 │ if (progressDisplay.shouldUpdate()) {
|
|
140
|
-
284 │ - ····console.log("\r"·+·progressDisplay.getProgressBar(progress));
|
|
141
|
-
284 │ + ····console.log(`\r${progressDisplay.getProgressBar(progress)}`);
|
|
142
|
-
285 285 │ }
|
|
143
|
-
286 286 │
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
src\commands\auth.ts:2:33 lint/style/useNodejsImportProtocol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
147
|
-
|
|
148
|
-
× A Node.js builtin module should be imported with the node: protocol.
|
|
149
|
-
|
|
150
|
-
1 │ import { Command } from "commander";
|
|
151
|
-
> 2 │ import { createInterface } from "readline";
|
|
152
|
-
│ ^^^^^^^^^^
|
|
153
|
-
3 │ import { MESSAGES } from "../constants/messages";
|
|
154
|
-
4 │ import { PATHS } from "../constants/paths";
|
|
155
|
-
|
|
156
|
-
i Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
|
|
157
|
-
|
|
158
|
-
i Unsafe fix: Add the node: protocol.
|
|
159
|
-
|
|
160
|
-
1 1 │ import { Command } from "commander";
|
|
161
|
-
2 │ - import·{·createInterface·}·from·"readline";
|
|
162
|
-
2 │ + import·{·createInterface·}·from·"node:readline";
|
|
163
|
-
3 3 │ import { MESSAGES } from "../constants/messages";
|
|
164
|
-
4 4 │ import { PATHS } from "../constants/paths";
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
src\commands\index.ts:1:1 lint/performance/noBarrelFile ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
168
|
-
|
|
169
|
-
× Avoid barrel files, they slow down performance, and cause large module graphs with modules that go unused.
|
|
170
|
-
|
|
171
|
-
> 1 │ export { createArchiveCommand } from "./archive";
|
|
172
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
173
|
-
2 │ export { createAuthCommand } from "./auth";
|
|
174
|
-
3 │
|
|
175
|
-
|
|
176
|
-
i Check this thorough explanation to better understand the context.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
src\constants\paths.ts:1:25 lint/style/useNodejsImportProtocol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
180
|
-
|
|
181
|
-
× A Node.js builtin module should be imported with the node: protocol.
|
|
182
|
-
|
|
183
|
-
> 1 │ import { homedir } from "os";
|
|
184
|
-
│ ^^^^
|
|
185
|
-
2 │ import { join } from "path";
|
|
186
|
-
3 │
|
|
187
|
-
|
|
188
|
-
i Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
|
|
189
|
-
|
|
190
|
-
i Unsafe fix: Add the node: protocol.
|
|
191
|
-
|
|
192
|
-
1 │ - import·{·homedir·}·from·"os";
|
|
193
|
-
1 │ + import·{·homedir·}·from·"node:os";
|
|
194
|
-
2 2 │ import { join } from "path";
|
|
195
|
-
3 3 │
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
src\constants\paths.ts:2:22 lint/style/useNodejsImportProtocol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
199
|
-
|
|
200
|
-
× A Node.js builtin module should be imported with the node: protocol.
|
|
201
|
-
|
|
202
|
-
1 │ import { homedir } from "os";
|
|
203
|
-
> 2 │ import { join } from "path";
|
|
204
|
-
│ ^^^^^^
|
|
205
|
-
3 │
|
|
206
|
-
4 │ const appDir = join(homedir(), ".github-archiver");
|
|
207
|
-
|
|
208
|
-
i Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
|
|
209
|
-
|
|
210
|
-
i Unsafe fix: Add the node: protocol.
|
|
211
|
-
|
|
212
|
-
1 1 │ import { homedir } from "os";
|
|
213
|
-
2 │ - import·{·join·}·from·"path";
|
|
214
|
-
2 │ + import·{·join·}·from·"node:path";
|
|
215
|
-
3 3 │
|
|
216
|
-
4 4 │ const appDir = join(homedir(), ".github-archiver");
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
src\services\archiver.ts:13:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
220
|
-
|
|
221
|
-
× Member 'queue' is never reassigned.
|
|
222
|
-
|
|
223
|
-
12 │ export class Archiver {
|
|
224
|
-
> 13 │ private queue: PQueue;
|
|
225
|
-
│ ^^^^^
|
|
226
|
-
14 │ private results: ArchiveResult[] = [];
|
|
227
|
-
15 │ private readonly gitHubService: GitHubService;
|
|
228
|
-
|
|
229
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
230
|
-
|
|
231
|
-
i Unsafe fix: Add readonly decorator.
|
|
232
|
-
|
|
233
|
-
13 │ ··private·readonly·queue:·PQueue;
|
|
234
|
-
│ +++++++++
|
|
235
|
-
|
|
236
|
-
src\services\archiver.ts:13:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
237
|
-
|
|
238
|
-
× Member 'queue' is never reassigned.
|
|
239
|
-
|
|
240
|
-
12 │ export class Archiver {
|
|
241
|
-
> 13 │ private queue: PQueue;
|
|
242
|
-
│ ^^^^^
|
|
243
|
-
14 │ private results: ArchiveResult[] = [];
|
|
244
|
-
15 │ private readonly gitHubService: GitHubService;
|
|
245
|
-
|
|
246
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
247
|
-
|
|
248
|
-
i Unsafe fix: Add readonly decorator.
|
|
249
|
-
|
|
250
|
-
13 │ ··private·readonly·queue:·PQueue;
|
|
251
|
-
│ +++++++++
|
|
252
|
-
|
|
253
|
-
src\services\archiver.ts:18:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
254
|
-
|
|
255
|
-
× Member 'startTime' is never reassigned.
|
|
256
|
-
|
|
257
|
-
16 │ private completed = 0;
|
|
258
|
-
17 │ private failed = 0;
|
|
259
|
-
> 18 │ private startTime = 0;
|
|
260
|
-
│ ^^^^^^^^^
|
|
261
|
-
19 │
|
|
262
|
-
20 │ constructor(gitHubService: GitHubService, options: ArchiveOptions) {
|
|
263
|
-
|
|
264
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
265
|
-
|
|
266
|
-
i Unsafe fix: Add readonly decorator.
|
|
267
|
-
|
|
268
|
-
18 │ ··private·readonly·startTime·=·0;
|
|
269
|
-
│ +++++++++
|
|
270
|
-
|
|
271
|
-
src\services\archiver.ts:18:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
272
|
-
|
|
273
|
-
× Member 'startTime' is never reassigned.
|
|
274
|
-
|
|
275
|
-
16 │ private completed = 0;
|
|
276
|
-
17 │ private failed = 0;
|
|
277
|
-
> 18 │ private startTime = 0;
|
|
278
|
-
│ ^^^^^^^^^
|
|
279
|
-
19 │
|
|
280
|
-
20 │ constructor(gitHubService: GitHubService, options: ArchiveOptions) {
|
|
281
|
-
|
|
282
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
283
|
-
|
|
284
|
-
i Unsafe fix: Add readonly decorator.
|
|
285
|
-
|
|
286
|
-
18 │ ··private·readonly·startTime·=·0;
|
|
287
|
-
│ +++++++++
|
|
288
|
-
|
|
289
|
-
src\services\auth-manager.ts:61:14 lint/correctness/noUnusedVariables FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
290
|
-
|
|
291
|
-
× This variable error is unused.
|
|
292
|
-
|
|
293
|
-
59 │ user: data.login,
|
|
294
|
-
60 │ };
|
|
295
|
-
> 61 │ } catch (error) {
|
|
296
|
-
│ ^^^^^
|
|
297
|
-
62 │ return {
|
|
298
|
-
63 │ valid: false,
|
|
299
|
-
|
|
300
|
-
i Unused variables are often the result of typos, incomplete refactors, or other sources of bugs.
|
|
301
|
-
|
|
302
|
-
i Unsafe fix: If this is intentional, prepend error with an underscore.
|
|
303
|
-
|
|
304
|
-
59 59 │ user: data.login,
|
|
305
|
-
60 60 │ };
|
|
306
|
-
61 │ - ····}·catch·(error)·{
|
|
307
|
-
61 │ + ····}·catch·(_error)·{
|
|
308
|
-
62 62 │ return {
|
|
309
|
-
63 63 │ valid: false,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
src\services\auth-manager.ts:68:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
313
|
-
|
|
314
|
-
× This async function lacks an await expression.
|
|
315
|
-
|
|
316
|
-
66 │ }
|
|
317
|
-
67 │
|
|
318
|
-
> 68 │ async getStoredCredentials(): Promise<StoredCredentials | null> {
|
|
319
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
320
|
-
> 69 │ return this.configManager.getStoredCredentials();
|
|
321
|
-
> 70 │ }
|
|
322
|
-
│ ^
|
|
323
|
-
71 │
|
|
324
|
-
72 │ async ensureConfigDir(): Promise<void> {
|
|
325
|
-
|
|
326
|
-
i Remove this async modifier, or add an await expression in the function.
|
|
327
|
-
|
|
328
|
-
66 │ }
|
|
329
|
-
67 │
|
|
330
|
-
> 68 │ async getStoredCredentials(): Promise<StoredCredentials | null> {
|
|
331
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
332
|
-
> 69 │ return this.configManager.getStoredCredentials();
|
|
333
|
-
> 70 │ }
|
|
334
|
-
│ ^
|
|
335
|
-
71 │
|
|
336
|
-
72 │ async ensureConfigDir(): Promise<void> {
|
|
337
|
-
|
|
338
|
-
i Async functions without await expressions may not need to be declared async.
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
src\services\auth-manager.ts:76:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
342
|
-
|
|
343
|
-
× This async function lacks an await expression.
|
|
344
|
-
|
|
345
|
-
74 │ }
|
|
346
|
-
75 │
|
|
347
|
-
> 76 │ async loadConfig(): Promise<Config> {
|
|
348
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
349
|
-
> 77 │ return this.configManager.loadConfig();
|
|
350
|
-
> 78 │ }
|
|
351
|
-
│ ^
|
|
352
|
-
79 │ }
|
|
353
|
-
80 │
|
|
354
|
-
|
|
355
|
-
i Remove this async modifier, or add an await expression in the function.
|
|
356
|
-
|
|
357
|
-
74 │ }
|
|
358
|
-
75 │
|
|
359
|
-
> 76 │ async loadConfig(): Promise<Config> {
|
|
360
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
361
|
-
> 77 │ return this.configManager.loadConfig();
|
|
362
|
-
> 78 │ }
|
|
363
|
-
│ ^
|
|
364
|
-
79 │ }
|
|
365
|
-
80 │
|
|
366
|
-
|
|
367
|
-
i Async functions without await expressions may not need to be declared async.
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
src\services\auth-manager.ts:8:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
371
|
-
|
|
372
|
-
× Member 'configManager' is never reassigned.
|
|
373
|
-
|
|
374
|
-
7 │ export class AuthManager {
|
|
375
|
-
> 8 │ private configManager: ConfigManager;
|
|
376
|
-
│ ^^^^^^^^^^^^^
|
|
377
|
-
9 │
|
|
378
|
-
10 │ constructor(configDir: string = PATHS.APP_DIR) {
|
|
379
|
-
|
|
380
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
381
|
-
|
|
382
|
-
i Unsafe fix: Add readonly decorator.
|
|
383
|
-
|
|
384
|
-
8 │ ··private·readonly·configManager:·ConfigManager;
|
|
385
|
-
│ +++++++++
|
|
386
|
-
|
|
387
|
-
src\services\auth-manager.ts:8:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
388
|
-
|
|
389
|
-
× Member 'configManager' is never reassigned.
|
|
390
|
-
|
|
391
|
-
7 │ export class AuthManager {
|
|
392
|
-
> 8 │ private configManager: ConfigManager;
|
|
393
|
-
│ ^^^^^^^^^^^^^
|
|
394
|
-
9 │
|
|
395
|
-
10 │ constructor(configDir: string = PATHS.APP_DIR) {
|
|
396
|
-
|
|
397
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
398
|
-
|
|
399
|
-
i Unsafe fix: Add readonly decorator.
|
|
400
|
-
|
|
401
|
-
8 │ ··private·readonly·configManager:·ConfigManager;
|
|
402
|
-
│ +++++++++
|
|
403
|
-
|
|
404
|
-
src\services\github.ts:25:42 lint/complexity/noExcessiveCognitiveComplexity ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
405
|
-
|
|
406
|
-
× Excessive complexity of 26 detected (max: 20).
|
|
407
|
-
|
|
408
|
-
23 │ logger.debug(`Attempting to archive ${owner}/${repo}`);
|
|
409
|
-
24 │
|
|
410
|
-
> 25 │ await this.retryWithBackoff(async () => {
|
|
411
|
-
│ ^^^
|
|
412
|
-
26 │ try {
|
|
413
|
-
27 │ await this.octokit.rest.repos.update({
|
|
414
|
-
|
|
415
|
-
i Please refactor this function to reduce its complexity score from 26 to the max allowed complexity 20.
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
src\services\github.ts:36:34 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
419
|
-
|
|
420
|
-
× Unexpected any. Specify a different type.
|
|
421
|
-
|
|
422
|
-
34 │ } catch (error) {
|
|
423
|
-
35 │ const message = error instanceof Error ? error.message : String(error);
|
|
424
|
-
> 36 │ const status = (error as any)?.status;
|
|
425
|
-
│ ^^^
|
|
426
|
-
37 │ const code = (error as any)?.response?.data?.message;
|
|
427
|
-
38 │
|
|
428
|
-
|
|
429
|
-
i any disables many type checking rules. Its use should be avoided.
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
src\services\github.ts:37:32 lint/suspicious/noExplicitAny ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
433
|
-
|
|
434
|
-
× Unexpected any. Specify a different type.
|
|
435
|
-
|
|
436
|
-
35 │ const message = error instanceof Error ? error.message : String(error);
|
|
437
|
-
36 │ const status = (error as any)?.status;
|
|
438
|
-
> 37 │ const code = (error as any)?.response?.data?.message;
|
|
439
|
-
│ ^^^
|
|
440
|
-
38 │
|
|
441
|
-
39 │ logger.error(`Failed to archive ${owner}/${repo}: ${message}`, {
|
|
442
|
-
|
|
443
|
-
i any disables many type checking rules. Its use should be avoided.
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
src\services\github.ts:54:11 lint/style/useCollapsedIf ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
447
|
-
|
|
448
|
-
× This if statement can be collapsed into another if statement.
|
|
449
|
-
|
|
450
|
-
52 │ if (status === 422) {
|
|
451
|
-
53 │ // Already archived or other validation error
|
|
452
|
-
> 54 │ if (message.includes("archived")) {
|
|
453
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
454
|
-
> 55 │ throw new Error(`Repository ${owner}/${repo} is already archived`);
|
|
455
|
-
> 56 │ }
|
|
456
|
-
│ ^
|
|
457
|
-
57 │ }
|
|
458
|
-
58 │
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
src\services\github.ts:15:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
462
|
-
|
|
463
|
-
× Member 'octokit' is never reassigned.
|
|
464
|
-
|
|
465
|
-
14 │ export class GitHubService {
|
|
466
|
-
> 15 │ private octokit: Octokit;
|
|
467
|
-
│ ^^^^^^^
|
|
468
|
-
16 │
|
|
469
|
-
17 │ constructor(token: string) {
|
|
470
|
-
|
|
471
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
472
|
-
|
|
473
|
-
i Unsafe fix: Add readonly decorator.
|
|
474
|
-
|
|
475
|
-
15 │ ··private·readonly·octokit:·Octokit;
|
|
476
|
-
│ +++++++++
|
|
477
|
-
|
|
478
|
-
src\services\github.ts:15:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
479
|
-
|
|
480
|
-
× Member 'octokit' is never reassigned.
|
|
481
|
-
|
|
482
|
-
14 │ export class GitHubService {
|
|
483
|
-
> 15 │ private octokit: Octokit;
|
|
484
|
-
│ ^^^^^^^
|
|
485
|
-
16 │
|
|
486
|
-
17 │ constructor(token: string) {
|
|
487
|
-
|
|
488
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
489
|
-
|
|
490
|
-
i Unsafe fix: Add readonly decorator.
|
|
491
|
-
|
|
492
|
-
15 │ ··private·readonly·octokit:·Octokit;
|
|
493
|
-
│ +++++++++
|
|
494
|
-
|
|
495
|
-
src\services\index.ts:1:1 lint/performance/noBarrelFile ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
496
|
-
|
|
497
|
-
× Avoid barrel files, they slow down performance, and cause large module graphs with modules that go unused.
|
|
498
|
-
|
|
499
|
-
> 1 │ export { Archiver } from "./archiver";
|
|
500
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
501
|
-
2 │ export { AuthManager } from "./auth-manager";
|
|
502
|
-
3 │ export { GitHubService } from "./github";
|
|
503
|
-
|
|
504
|
-
i Check this thorough explanation to better understand the context.
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
src\types\error.ts:1:8 lint/style/noEnum ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
508
|
-
|
|
509
|
-
× Don't use enum
|
|
510
|
-
|
|
511
|
-
> 1 │ export enum ErrorCode {
|
|
512
|
-
│ ^^^^^^^^^^^^^^^^
|
|
513
|
-
> 2 │ INVALID_AUTH = "INVALID_AUTH",
|
|
514
|
-
> 3 │ REPO_NOT_FOUND = "REPO_NOT_FOUND",
|
|
515
|
-
> 4 │ ALREADY_ARCHIVED = "ALREADY_ARCHIVED",
|
|
516
|
-
...
|
|
517
|
-
> 12 │ FILE_ERROR = "FILE_ERROR",
|
|
518
|
-
> 13 │ }
|
|
519
|
-
│ ^
|
|
520
|
-
14 │
|
|
521
|
-
15 │ export class ArchiveError extends Error {
|
|
522
|
-
|
|
523
|
-
i TypeScript enums are not a type-level extension to JavaScript like type annotations or definitions. Users may wish to disable non-type-level extensions to use bundlers or compilers that only strip types.
|
|
524
|
-
|
|
525
|
-
i Use JavaScript objects or TypeScript unions instead.
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
src\types\error.ts:17:5 lint/style/useConsistentMemberAccessibility ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
529
|
-
|
|
530
|
-
× The public modifier is disallowed.
|
|
531
|
-
|
|
532
|
-
15 │ export class ArchiveError extends Error {
|
|
533
|
-
16 │ constructor(
|
|
534
|
-
> 17 │ public code: ErrorCode,
|
|
535
|
-
│ ^^^^^^
|
|
536
|
-
18 │ message: string,
|
|
537
|
-
19 │ public statusCode?: number,
|
|
538
|
-
|
|
539
|
-
i Remove the accessibility modifier.
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
src\types\error.ts:17:5 lint/style/noParameterProperties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
543
|
-
|
|
544
|
-
× Use a more explicit class property instead of a parameter property.
|
|
545
|
-
|
|
546
|
-
15 │ export class ArchiveError extends Error {
|
|
547
|
-
16 │ constructor(
|
|
548
|
-
> 17 │ public code: ErrorCode,
|
|
549
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^
|
|
550
|
-
18 │ message: string,
|
|
551
|
-
19 │ public statusCode?: number,
|
|
552
|
-
|
|
553
|
-
i Parameter properties are less explicit than other ways of declaring and initializing class properties.
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
src\types\error.ts:19:5 lint/style/useConsistentMemberAccessibility ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
557
|
-
|
|
558
|
-
× The public modifier is disallowed.
|
|
559
|
-
|
|
560
|
-
17 │ public code: ErrorCode,
|
|
561
|
-
18 │ message: string,
|
|
562
|
-
> 19 │ public statusCode?: number,
|
|
563
|
-
│ ^^^^^^
|
|
564
|
-
20 │ public retryable = false
|
|
565
|
-
21 │ ) {
|
|
566
|
-
|
|
567
|
-
i Remove the accessibility modifier.
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
src\types\error.ts:19:5 lint/style/noParameterProperties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
571
|
-
|
|
572
|
-
× Use a more explicit class property instead of a parameter property.
|
|
573
|
-
|
|
574
|
-
17 │ public code: ErrorCode,
|
|
575
|
-
18 │ message: string,
|
|
576
|
-
> 19 │ public statusCode?: number,
|
|
577
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
578
|
-
20 │ public retryable = false
|
|
579
|
-
21 │ ) {
|
|
580
|
-
|
|
581
|
-
i Parameter properties are less explicit than other ways of declaring and initializing class properties.
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
src\types\error.ts:20:5 lint/style/useConsistentMemberAccessibility ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
585
|
-
|
|
586
|
-
× The public modifier is disallowed.
|
|
587
|
-
|
|
588
|
-
18 │ message: string,
|
|
589
|
-
19 │ public statusCode?: number,
|
|
590
|
-
> 20 │ public retryable = false
|
|
591
|
-
│ ^^^^^^
|
|
592
|
-
21 │ ) {
|
|
593
|
-
22 │ super(message);
|
|
594
|
-
|
|
595
|
-
i Remove the accessibility modifier.
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
src\types\error.ts:20:5 lint/style/noParameterProperties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
599
|
-
|
|
600
|
-
× Use a more explicit class property instead of a parameter property.
|
|
601
|
-
|
|
602
|
-
18 │ message: string,
|
|
603
|
-
19 │ public statusCode?: number,
|
|
604
|
-
> 20 │ public retryable = false
|
|
605
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
606
|
-
21 │ ) {
|
|
607
|
-
22 │ super(message);
|
|
608
|
-
|
|
609
|
-
i Parameter properties are less explicit than other ways of declaring and initializing class properties.
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
src\types\index.ts:1:1 lint/performance/noBarrelFile ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
613
|
-
|
|
614
|
-
× Avoid barrel files, they slow down performance, and cause large module graphs with modules that go unused.
|
|
615
|
-
|
|
616
|
-
> 1 │ export * from "./config";
|
|
617
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
618
|
-
2 │ export * from "./error";
|
|
619
|
-
3 │ export * from "./github";
|
|
620
|
-
|
|
621
|
-
i Check this thorough explanation to better understand the context.
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
src\utils\colors.ts:1:8 lint/complexity/noStaticOnlyClass ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
625
|
-
|
|
626
|
-
× Avoid classes that contain only static members.
|
|
627
|
-
|
|
628
|
-
> 1 │ export class Colors {
|
|
629
|
-
│ ^^^^^^^^^^^^^^
|
|
630
|
-
> 2 │ // ANSI color codes
|
|
631
|
-
> 3 │ private static readonly RESET = "\x1b[0m";
|
|
632
|
-
> 4 │ private static readonly BRIGHT = "\x1b[1m";
|
|
633
|
-
...
|
|
634
|
-
> 66 │ return colors[status](icons[status]);
|
|
635
|
-
> 67 │ }
|
|
636
|
-
> 68 │ }
|
|
637
|
-
│ ^
|
|
638
|
-
69 │
|
|
639
|
-
|
|
640
|
-
i Prefer using simple functions instead of classes with only static members.
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
src\utils\config.ts:14:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
644
|
-
|
|
645
|
-
× Member 'configFile' is never reassigned.
|
|
646
|
-
|
|
647
|
-
12 │ export class ConfigManager {
|
|
648
|
-
13 │ private configDir: string;
|
|
649
|
-
> 14 │ private configFile: string;
|
|
650
|
-
│ ^^^^^^^^^^
|
|
651
|
-
15 │
|
|
652
|
-
16 │ constructor(configDir: string = PATHS.APP_DIR) {
|
|
653
|
-
|
|
654
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
655
|
-
|
|
656
|
-
i Unsafe fix: Add readonly decorator.
|
|
657
|
-
|
|
658
|
-
14 │ ··private·readonly·configFile:·string;
|
|
659
|
-
│ +++++++++
|
|
660
|
-
|
|
661
|
-
src\utils\config.ts:1:32 lint/style/useNodejsImportProtocol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
662
|
-
|
|
663
|
-
× A Node.js builtin module should be imported with the node: protocol.
|
|
664
|
-
|
|
665
|
-
> 1 │ import { promises as fs } from "fs";
|
|
666
|
-
│ ^^^^
|
|
667
|
-
2 │ import { join } from "path";
|
|
668
|
-
3 │ import {
|
|
669
|
-
|
|
670
|
-
i Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
|
|
671
|
-
|
|
672
|
-
i Unsafe fix: Add the node: protocol.
|
|
673
|
-
|
|
674
|
-
1 │ - import·{·promises·as·fs·}·from·"fs";
|
|
675
|
-
1 │ + import·{·promises·as·fs·}·from·"node:fs";
|
|
676
|
-
2 2 │ import { join } from "path";
|
|
677
|
-
3 3 │ import {
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
src\utils\config.ts:2:22 lint/style/useNodejsImportProtocol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
681
|
-
|
|
682
|
-
× A Node.js builtin module should be imported with the node: protocol.
|
|
683
|
-
|
|
684
|
-
1 │ import { promises as fs } from "fs";
|
|
685
|
-
> 2 │ import { join } from "path";
|
|
686
|
-
│ ^^^^^^
|
|
687
|
-
3 │ import {
|
|
688
|
-
4 │ DEFAULT_CONCURRENCY,
|
|
689
|
-
|
|
690
|
-
i Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
|
|
691
|
-
|
|
692
|
-
i Unsafe fix: Add the node: protocol.
|
|
693
|
-
|
|
694
|
-
1 1 │ import { promises as fs } from "fs";
|
|
695
|
-
2 │ - import·{·join·}·from·"path";
|
|
696
|
-
2 │ + import·{·join·}·from·"node:path";
|
|
697
|
-
3 3 │ import {
|
|
698
|
-
4 4 │ DEFAULT_CONCURRENCY,
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
src\utils\config.ts:13:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
702
|
-
|
|
703
|
-
× Member 'configDir' is never reassigned.
|
|
704
|
-
|
|
705
|
-
12 │ export class ConfigManager {
|
|
706
|
-
> 13 │ private configDir: string;
|
|
707
|
-
│ ^^^^^^^^^
|
|
708
|
-
14 │ private configFile: string;
|
|
709
|
-
15 │
|
|
710
|
-
|
|
711
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
712
|
-
|
|
713
|
-
i Unsafe fix: Add readonly decorator.
|
|
714
|
-
|
|
715
|
-
13 │ ··private·readonly·configDir:·string;
|
|
716
|
-
│ +++++++++
|
|
717
|
-
|
|
718
|
-
src\utils\config.ts:13:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
719
|
-
|
|
720
|
-
× Member 'configDir' is never reassigned.
|
|
721
|
-
|
|
722
|
-
12 │ export class ConfigManager {
|
|
723
|
-
> 13 │ private configDir: string;
|
|
724
|
-
│ ^^^^^^^^^
|
|
725
|
-
14 │ private configFile: string;
|
|
726
|
-
15 │
|
|
727
|
-
|
|
728
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
729
|
-
|
|
730
|
-
i Unsafe fix: Add readonly decorator.
|
|
731
|
-
|
|
732
|
-
13 │ ··private·readonly·configDir:·string;
|
|
733
|
-
│ +++++++++
|
|
734
|
-
|
|
735
|
-
src\utils\config.ts:14:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
736
|
-
|
|
737
|
-
× Member 'configFile' is never reassigned.
|
|
738
|
-
|
|
739
|
-
12 │ export class ConfigManager {
|
|
740
|
-
13 │ private configDir: string;
|
|
741
|
-
> 14 │ private configFile: string;
|
|
742
|
-
│ ^^^^^^^^^^
|
|
743
|
-
15 │
|
|
744
|
-
16 │ constructor(configDir: string = PATHS.APP_DIR) {
|
|
745
|
-
|
|
746
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
747
|
-
|
|
748
|
-
i Unsafe fix: Add readonly decorator.
|
|
749
|
-
|
|
750
|
-
14 │ ··private·readonly·configFile:·string;
|
|
751
|
-
│ +++++++++
|
|
752
|
-
|
|
753
|
-
src\utils\formatting.ts:1:8 lint/complexity/noStaticOnlyClass ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
754
|
-
|
|
755
|
-
× Avoid classes that contain only static members.
|
|
756
|
-
|
|
757
|
-
> 1 │ export class Formatting {
|
|
758
|
-
│ ^^^^^^^^^^^^^^^^^^
|
|
759
|
-
> 2 │ static formatDuration(ms: number): string {
|
|
760
|
-
> 3 │ if (ms < 1000) {
|
|
761
|
-
> 4 │ return `${ms}ms`;
|
|
762
|
-
...
|
|
763
|
-
> 48 │ return text.substring(0, maxLength - 3) + "...";
|
|
764
|
-
> 49 │ }
|
|
765
|
-
> 50 │ }
|
|
766
|
-
│ ^
|
|
767
|
-
51 │
|
|
768
|
-
|
|
769
|
-
i Prefer using simple functions instead of classes with only static members.
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
src\utils\formatting.ts:15:5 lint/style/useBlockStatements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
773
|
-
|
|
774
|
-
× Block statements are preferred in this position.
|
|
775
|
-
|
|
776
|
-
14 │ static formatBytes(bytes: number): string {
|
|
777
|
-
> 15 │ if (bytes === 0) return "0 B";
|
|
778
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
779
|
-
16 │ const k = 1024;
|
|
780
|
-
17 │ const sizes = ["B", "KB", "MB", "GB"];
|
|
781
|
-
|
|
782
|
-
i Unsafe fix: Wrap the statement with a `JsBlockStatement`
|
|
783
|
-
|
|
784
|
-
15 │ ····if·(bytes·===·0)·{·return·"0·B";·}
|
|
785
|
-
│ ++ ++
|
|
786
|
-
|
|
787
|
-
src\utils\formatting.ts:23:5 lint/style/useBlockStatements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
788
|
-
|
|
789
|
-
× Block statements are preferred in this position.
|
|
790
|
-
|
|
791
|
-
22 │ static formatPercent(value: number, total: number): string {
|
|
792
|
-
> 23 │ if (total === 0) return "0%";
|
|
793
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
794
|
-
24 │ return `${((value / total) * 100).toFixed(1)}%`;
|
|
795
|
-
25 │ }
|
|
796
|
-
|
|
797
|
-
i Unsafe fix: Wrap the statement with a `JsBlockStatement`
|
|
798
|
-
|
|
799
|
-
23 │ ····if·(total·===·0)·{·return·"0%";·}
|
|
800
|
-
│ ++ ++
|
|
801
|
-
|
|
802
|
-
src\utils\formatting.ts:32:5 lint/style/useBlockStatements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
803
|
-
|
|
804
|
-
× Block statements are preferred in this position.
|
|
805
|
-
|
|
806
|
-
30 │ width = 30
|
|
807
|
-
31 │ ): string {
|
|
808
|
-
> 32 │ if (total === 0) return "[ ]";
|
|
809
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
810
|
-
33 │ const filledWidth = Math.round((completed / total) * width);
|
|
811
|
-
34 │ const emptyWidth = width - filledWidth;
|
|
812
|
-
|
|
813
|
-
i Unsafe fix: Wrap the statement with a `JsBlockStatement`
|
|
814
|
-
|
|
815
|
-
32 │ ····if·(total·===·0)·{·return·"[·]";·}
|
|
816
|
-
│ ++ ++
|
|
817
|
-
|
|
818
|
-
src\utils\formatting.ts:47:5 lint/style/useBlockStatements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
819
|
-
|
|
820
|
-
× Block statements are preferred in this position.
|
|
821
|
-
|
|
822
|
-
46 │ static truncate(text: string, maxLength: number): string {
|
|
823
|
-
> 47 │ if (text.length <= maxLength) return text;
|
|
824
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
825
|
-
48 │ return text.substring(0, maxLength - 3) + "...";
|
|
826
|
-
49 │ }
|
|
827
|
-
|
|
828
|
-
i Unsafe fix: Wrap the statement with a `JsBlockStatement`
|
|
829
|
-
|
|
830
|
-
47 │ ····if·(text.length·<=·maxLength)·{·return·text;·}
|
|
831
|
-
│ ++ ++
|
|
832
|
-
|
|
833
|
-
src\utils\formatting.ts:48:12 lint/style/useTemplate FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
834
|
-
|
|
835
|
-
× Template literals are preferred over string concatenation.
|
|
836
|
-
|
|
837
|
-
46 │ static truncate(text: string, maxLength: number): string {
|
|
838
|
-
47 │ if (text.length <= maxLength) return text;
|
|
839
|
-
> 48 │ return text.substring(0, maxLength - 3) + "...";
|
|
840
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
841
|
-
49 │ }
|
|
842
|
-
50 │ }
|
|
843
|
-
|
|
844
|
-
i Unsafe fix: Use a template literal.
|
|
845
|
-
|
|
846
|
-
46 46 │ static truncate(text: string, maxLength: number): string {
|
|
847
|
-
47 47 │ if (text.length <= maxLength) return text;
|
|
848
|
-
48 │ - ····return·text.substring(0,·maxLength·-·3)·+·"...";
|
|
849
|
-
48 │ + ····return·`${text.substring(0,·maxLength·-·3)}...`;
|
|
850
|
-
49 49 │ }
|
|
851
|
-
50 50 │ }
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
src\utils\index.ts:1:1 lint/performance/noBarrelFile ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
855
|
-
|
|
856
|
-
× Avoid barrel files, they slow down performance, and cause large module graphs with modules that go unused.
|
|
857
|
-
|
|
858
|
-
> 1 │ export * from "./colors";
|
|
859
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
860
|
-
2 │ export * from "./config";
|
|
861
|
-
3 │ export * from "./errors";
|
|
862
|
-
|
|
863
|
-
i Check this thorough explanation to better understand the context.
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
src\utils\input-handler.ts:10:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
867
|
-
|
|
868
|
-
× This async function lacks an await expression.
|
|
869
|
-
|
|
870
|
-
9 │ export class InputHandler {
|
|
871
|
-
> 10 │ async getRepositoriesFromInteractive(): Promise<{
|
|
872
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
873
|
-
> 11 │ repos: RepositoryIdentifier[];
|
|
874
|
-
...
|
|
875
|
-
> 70 │ });
|
|
876
|
-
> 71 │ }
|
|
877
|
-
│ ^
|
|
878
|
-
72 │
|
|
879
|
-
73 │ async getRepositoriesFromFile(filePath: string): Promise<{
|
|
880
|
-
|
|
881
|
-
i Remove this async modifier, or add an await expression in the function.
|
|
882
|
-
|
|
883
|
-
9 │ export class InputHandler {
|
|
884
|
-
> 10 │ async getRepositoriesFromInteractive(): Promise<{
|
|
885
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
886
|
-
> 11 │ repos: RepositoryIdentifier[];
|
|
887
|
-
...
|
|
888
|
-
> 70 │ });
|
|
889
|
-
> 71 │ }
|
|
890
|
-
│ ^
|
|
891
|
-
72 │
|
|
892
|
-
73 │ async getRepositoriesFromFile(filePath: string): Promise<{
|
|
893
|
-
|
|
894
|
-
i Async functions without await expressions may not need to be declared async.
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
src\utils\input-handler.ts:103:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
898
|
-
|
|
899
|
-
× This async function lacks an await expression.
|
|
900
|
-
|
|
901
|
-
101 │ }
|
|
902
|
-
102 │
|
|
903
|
-
> 103 │ async getRepositoriesFromStdin(): Promise<{
|
|
904
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
905
|
-
> 104 │ repos: RepositoryIdentifier[];
|
|
906
|
-
...
|
|
907
|
-
> 140 │ });
|
|
908
|
-
> 141 │ }
|
|
909
|
-
│ ^
|
|
910
|
-
142 │
|
|
911
|
-
143 │ async promptForConfirmation(message: string): Promise<boolean> {
|
|
912
|
-
|
|
913
|
-
i Remove this async modifier, or add an await expression in the function.
|
|
914
|
-
|
|
915
|
-
101 │ }
|
|
916
|
-
102 │
|
|
917
|
-
> 103 │ async getRepositoriesFromStdin(): Promise<{
|
|
918
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
919
|
-
> 104 │ repos: RepositoryIdentifier[];
|
|
920
|
-
...
|
|
921
|
-
> 140 │ });
|
|
922
|
-
> 141 │ }
|
|
923
|
-
│ ^
|
|
924
|
-
142 │
|
|
925
|
-
143 │ async promptForConfirmation(message: string): Promise<boolean> {
|
|
926
|
-
|
|
927
|
-
i Async functions without await expressions may not need to be declared async.
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
src\utils\input-handler.ts:143:3 lint/suspicious/useAwait ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
931
|
-
|
|
932
|
-
× This async function lacks an await expression.
|
|
933
|
-
|
|
934
|
-
141 │ }
|
|
935
|
-
142 │
|
|
936
|
-
> 143 │ async promptForConfirmation(message: string): Promise<boolean> {
|
|
937
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
938
|
-
> 144 │ return new Promise((resolve) => {
|
|
939
|
-
...
|
|
940
|
-
> 156 │ });
|
|
941
|
-
> 157 │ }
|
|
942
|
-
│ ^
|
|
943
|
-
158 │ }
|
|
944
|
-
159 │
|
|
945
|
-
|
|
946
|
-
i Remove this async modifier, or add an await expression in the function.
|
|
947
|
-
|
|
948
|
-
141 │ }
|
|
949
|
-
142 │
|
|
950
|
-
> 143 │ async promptForConfirmation(message: string): Promise<boolean> {
|
|
951
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
952
|
-
> 144 │ return new Promise((resolve) => {
|
|
953
|
-
...
|
|
954
|
-
> 156 │ });
|
|
955
|
-
> 157 │ }
|
|
956
|
-
│ ^
|
|
957
|
-
158 │ }
|
|
958
|
-
159 │
|
|
959
|
-
|
|
960
|
-
i Async functions without await expressions may not need to be declared async.
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
src\utils\logger.ts:1:32 lint/style/useNodejsImportProtocol FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
964
|
-
|
|
965
|
-
× A Node.js builtin module should be imported with the node: protocol.
|
|
966
|
-
|
|
967
|
-
> 1 │ import { promises as fs } from "fs";
|
|
968
|
-
│ ^^^^
|
|
969
|
-
2 │ import winston from "winston";
|
|
970
|
-
3 │ import { DEFAULT_LOG_LEVEL } from "../constants/defaults";
|
|
971
|
-
|
|
972
|
-
i Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
|
|
973
|
-
|
|
974
|
-
i Unsafe fix: Add the node: protocol.
|
|
975
|
-
|
|
976
|
-
1 │ - import·{·promises·as·fs·}·from·"fs";
|
|
977
|
-
1 │ + import·{·promises·as·fs·}·from·"node:fs";
|
|
978
|
-
2 2 │ import winston from "winston";
|
|
979
|
-
3 3 │ import { DEFAULT_LOG_LEVEL } from "../constants/defaults";
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
src\utils\parser.ts:125:12 lint/performance/useTopLevelRegex ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
983
|
-
|
|
984
|
-
× This regex literal is not defined in the top level scope. This can lead to performance issues if this function is called frequently.
|
|
985
|
-
|
|
986
|
-
123 │ // Names cannot start with a hyphen or period
|
|
987
|
-
124 │ // Names must be 1-39 characters for owners, 1-100 for repos
|
|
988
|
-
> 125 │ return /^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$/.test(name);
|
|
989
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
990
|
-
126 │ }
|
|
991
|
-
127 │ }
|
|
992
|
-
|
|
993
|
-
i Move the regex literal outside of this scope, and place it at the top level of this module, as a constant.
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
src\utils\parser.ts:7:8 lint/complexity/noStaticOnlyClass ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
997
|
-
|
|
998
|
-
× Avoid classes that contain only static members.
|
|
999
|
-
|
|
1000
|
-
5 │ const logger = getLogger();
|
|
1001
|
-
6 │
|
|
1002
|
-
> 7 │ export class URLParser {
|
|
1003
|
-
│ ^^^^^^^^^^^^^^^^^
|
|
1004
|
-
> 8 │ private static readonly GITHUB_URL_PATTERNS = [
|
|
1005
|
-
...
|
|
1006
|
-
> 125 │ return /^[a-zA-Z0-9]([a-zA-Z0-9._-]*[a-zA-Z0-9])?$/.test(name);
|
|
1007
|
-
> 126 │ }
|
|
1008
|
-
> 127 │ }
|
|
1009
|
-
│ ^
|
|
1010
|
-
128 │
|
|
1011
|
-
|
|
1012
|
-
i Prefer using simple functions instead of classes with only static members.
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
src\utils\progress.ts:14:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1016
|
-
|
|
1017
|
-
× Member 'startTime' is never reassigned.
|
|
1018
|
-
|
|
1019
|
-
13 │ export class ProgressDisplay {
|
|
1020
|
-
> 14 │ private startTime: number;
|
|
1021
|
-
│ ^^^^^^^^^
|
|
1022
|
-
15 │ private lastUpdate = 0;
|
|
1023
|
-
16 │ private updateInterval = 500; // ms
|
|
1024
|
-
|
|
1025
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
1026
|
-
|
|
1027
|
-
i Unsafe fix: Add readonly decorator.
|
|
1028
|
-
|
|
1029
|
-
14 │ ··private·readonly·startTime:·number;
|
|
1030
|
-
│ +++++++++
|
|
1031
|
-
|
|
1032
|
-
src\utils\progress.ts:14:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1033
|
-
|
|
1034
|
-
× Member 'startTime' is never reassigned.
|
|
1035
|
-
|
|
1036
|
-
13 │ export class ProgressDisplay {
|
|
1037
|
-
> 14 │ private startTime: number;
|
|
1038
|
-
│ ^^^^^^^^^
|
|
1039
|
-
15 │ private lastUpdate = 0;
|
|
1040
|
-
16 │ private updateInterval = 500; // ms
|
|
1041
|
-
|
|
1042
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
1043
|
-
|
|
1044
|
-
i Unsafe fix: Add readonly decorator.
|
|
1045
|
-
|
|
1046
|
-
14 │ ··private·readonly·startTime:·number;
|
|
1047
|
-
│ +++++++++
|
|
1048
|
-
|
|
1049
|
-
src\utils\progress.ts:16:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1050
|
-
|
|
1051
|
-
× Member 'updateInterval' is never reassigned.
|
|
1052
|
-
|
|
1053
|
-
14 │ private startTime: number;
|
|
1054
|
-
15 │ private lastUpdate = 0;
|
|
1055
|
-
> 16 │ private updateInterval = 500; // ms
|
|
1056
|
-
│ ^^^^^^^^^^^^^^
|
|
1057
|
-
17 │
|
|
1058
|
-
18 │ constructor() {
|
|
1059
|
-
|
|
1060
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
1061
|
-
|
|
1062
|
-
i Unsafe fix: Add readonly decorator.
|
|
1063
|
-
|
|
1064
|
-
16 │ ··private·readonly·updateInterval·=·500;·//·ms
|
|
1065
|
-
│ +++++++++
|
|
1066
|
-
|
|
1067
|
-
src\utils\progress.ts:16:11 lint/style/useReadonlyClassProperties FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1068
|
-
|
|
1069
|
-
× Member 'updateInterval' is never reassigned.
|
|
1070
|
-
|
|
1071
|
-
14 │ private startTime: number;
|
|
1072
|
-
15 │ private lastUpdate = 0;
|
|
1073
|
-
> 16 │ private updateInterval = 500; // ms
|
|
1074
|
-
│ ^^^^^^^^^^^^^^
|
|
1075
|
-
17 │
|
|
1076
|
-
18 │ constructor() {
|
|
1077
|
-
|
|
1078
|
-
i Using readonly improves code safety, clarity, and helps prevent unintended mutations.
|
|
1079
|
-
|
|
1080
|
-
i Unsafe fix: Add readonly decorator.
|
|
1081
|
-
|
|
1082
|
-
16 │ ··private·readonly·updateInterval·=·500;·//·ms
|
|
1083
|
-
│ +++++++++
|
|
1084
|
-
|
|
1085
|
-
src\utils\progress.ts:77:5 lint/style/useBlockStatements FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1086
|
-
|
|
1087
|
-
× Block statements are preferred in this position.
|
|
1088
|
-
|
|
1089
|
-
76 │ getEstimatedTimeRemaining(completed: number, total: number): string | null {
|
|
1090
|
-
> 77 │ if (completed === 0) return null;
|
|
1091
|
-
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
1092
|
-
78 │
|
|
1093
|
-
79 │ const elapsed = Date.now() - this.startTime;
|
|
1094
|
-
|
|
1095
|
-
i Unsafe fix: Wrap the statement with a `JsBlockStatement`
|
|
1096
|
-
|
|
1097
|
-
77 │ ····if·(completed·===·0)·{·return·null;·}
|
|
1098
|
-
│ ++ ++
|
|
1099
|
-
|
|
1100
|
-
Checked 31 files in 87ms. No fixes applied.
|
|
1101
|
-
Found 62 errors.
|
|
1102
|
-
ci ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
1103
|
-
|
|
1104
|
-
× Some errors were emitted while running checks.
|
|
1105
|
-
|