@tsslint/cli 1.4.2 → 1.4.3
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/index.js +25 -3
- package/lib/worker.js +1 -1
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -15,6 +15,11 @@ const darkGray = (s) => '\x1b[90m' + s + _reset;
|
|
|
15
15
|
const lightRed = (s) => '\x1b[91m' + s + _reset;
|
|
16
16
|
const lightGreen = (s) => '\x1b[92m' + s + _reset;
|
|
17
17
|
const lightYellow = (s) => '\x1b[93m' + s + _reset;
|
|
18
|
+
// https://talyian.github.io/ansicolors/
|
|
19
|
+
const tsColor = (s) => '\x1b[34m' + s + _reset;
|
|
20
|
+
const vueColor = (s) => '\x1b[32m' + s + _reset;
|
|
21
|
+
const mdxColor = (s) => '\x1b[33m' + s + _reset;
|
|
22
|
+
const astroColor = (s) => '\x1b[38;5;209m' + s + _reset;
|
|
18
23
|
let threads = 1;
|
|
19
24
|
if (process.argv.includes('--threads')) {
|
|
20
25
|
const threadsIndex = process.argv.indexOf('--threads');
|
|
@@ -45,18 +50,34 @@ class Project {
|
|
|
45
50
|
// @ts-expect-error
|
|
46
51
|
clack) {
|
|
47
52
|
this.configFile = ts.findConfigFile(path.dirname(this.tsconfig), ts.sys.fileExists, 'tsslint.config.ts');
|
|
53
|
+
const labels = [];
|
|
54
|
+
if (this.languages.length === 0) {
|
|
55
|
+
labels.push(tsColor('TS'));
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
if (this.languages.includes('vue')) {
|
|
59
|
+
labels.push(vueColor('Vue'));
|
|
60
|
+
}
|
|
61
|
+
if (this.languages.includes('mdx')) {
|
|
62
|
+
labels.push(mdxColor('MDX'));
|
|
63
|
+
}
|
|
64
|
+
if (this.languages.includes('astro')) {
|
|
65
|
+
labels.push(astroColor('Astro'));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
const label = labels.join(darkGray(' | '));
|
|
48
69
|
if (!this.configFile) {
|
|
49
|
-
clack.log.error(`${
|
|
70
|
+
clack.log.error(`${label} ${path.relative(process.cwd(), this.tsconfig)} ${darkGray('(No tsslint.config.ts found)')}`);
|
|
50
71
|
return this;
|
|
51
72
|
}
|
|
52
73
|
const commonLine = await parseCommonLine(this.tsconfig, this.languages);
|
|
53
74
|
this.fileNames = commonLine.fileNames;
|
|
54
75
|
this.options = commonLine.options;
|
|
55
76
|
if (!this.fileNames.length) {
|
|
56
|
-
clack.log.warn(`${
|
|
77
|
+
clack.log.warn(`${label} ${path.relative(process.cwd(), this.tsconfig)} ${darkGray('(No included files)')}`);
|
|
57
78
|
return this;
|
|
58
79
|
}
|
|
59
|
-
clack.log.info(`${
|
|
80
|
+
clack.log.info(`${label} ${path.relative(process.cwd(), this.tsconfig)} ${darkGray(`(${this.fileNames.length})`)}`);
|
|
60
81
|
if (!process.argv.includes('--force')) {
|
|
61
82
|
this.cache = cache.loadCache(this.tsconfig, this.configFile, ts.sys.createHash);
|
|
62
83
|
}
|
|
@@ -343,6 +364,7 @@ class Project {
|
|
|
343
364
|
getCanonicalFileName: ts.sys.useCaseSensitiveFileNames ? x => x : x => x.toLowerCase(),
|
|
344
365
|
getNewLine: () => ts.sys.newLine,
|
|
345
366
|
});
|
|
367
|
+
output = output.trimEnd();
|
|
346
368
|
output = output.replace(`TS${diagnostic.code}`, String(diagnostic.code));
|
|
347
369
|
if (diagnostic.category === ts.DiagnosticCategory.Error) {
|
|
348
370
|
errors++;
|
package/lib/worker.js
CHANGED
|
@@ -192,7 +192,7 @@ async function setup(tsconfig, languages, configFile, builtConfig, _fileNames, _
|
|
|
192
192
|
languageServiceHost: linterHost,
|
|
193
193
|
typescript: ts,
|
|
194
194
|
tsconfig: ts.server.toNormalizedPath(tsconfig),
|
|
195
|
-
}, config, 'cli'
|
|
195
|
+
}, config, 'cli');
|
|
196
196
|
return true;
|
|
197
197
|
}
|
|
198
198
|
function lintAndFix(fileName, fileCache) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsslint/cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"tsslint": "./bin/tsslint.js"
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@clack/prompts": "^0.8.2",
|
|
19
|
-
"@tsslint/config": "1.4.
|
|
20
|
-
"@tsslint/core": "1.4.
|
|
19
|
+
"@tsslint/config": "1.4.3",
|
|
20
|
+
"@tsslint/core": "1.4.3",
|
|
21
21
|
"@volar/language-core": "~2.4.0",
|
|
22
22
|
"@volar/typescript": "~2.4.0",
|
|
23
23
|
"glob": "^10.4.1"
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@vue/language-core": "latest"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "7cdb4a39c0af8ee4cebd430bb546c6b6e2ddc28b"
|
|
32
32
|
}
|