@tsslint/cli 1.6.1 → 2.0.0-alpha.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.
Files changed (2) hide show
  1. package/index.js +15 -3
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -17,6 +17,7 @@ const darkGray = (s) => '\x1b[90m' + s + _reset;
17
17
  const lightRed = (s) => '\x1b[91m' + s + _reset;
18
18
  const lightGreen = (s) => '\x1b[92m' + s + _reset;
19
19
  const lightYellow = (s) => '\x1b[93m' + s + _reset;
20
+ const lightBlue = (s) => '\x1b[94m' + s + _reset;
20
21
  // https://talyian.github.io/ansicolors/
21
22
  const tsColor = (s) => '\x1b[34m' + s + _reset;
22
23
  const tsMacroColor = (s) => '\x1b[38;5;135m' + s + _reset;
@@ -104,6 +105,7 @@ class Project {
104
105
  let passed = 0;
105
106
  let errors = 0;
106
107
  let warnings = 0;
108
+ let messages = 0;
107
109
  let cached = 0;
108
110
  if (isTTY) {
109
111
  const write = process.stdout.write.bind(process.stdout);
@@ -301,6 +303,7 @@ class Project {
301
303
  [passed, 'passed', lightGreen],
302
304
  [errors, 'errors', lightRed],
303
305
  [warnings, 'warnings', lightYellow],
306
+ [messages, 'messages', lightBlue],
304
307
  [excluded, 'excluded', darkGray],
305
308
  ];
306
309
  let summary = data
@@ -310,11 +313,11 @@ class Project {
310
313
  if (hasFix) {
311
314
  summary += darkGray(` (Use `) + cyan(`--fix`) + darkGray(` to apply automatic fixes.)`);
312
315
  }
313
- else if (errors || warnings) {
316
+ else if (errors || warnings || messages) {
314
317
  summary += darkGray(` (No fixes available.)`);
315
318
  }
316
319
  clack.outro(summary);
317
- process.exit(errors ? 1 : 0);
320
+ process.exit((errors || messages) ? 1 : 0);
318
321
  async function startWorker(linterWorker) {
319
322
  const unfinishedProjects = projects.filter(project => project.currentFileIndex < project.fileNames.length);
320
323
  if (!unfinishedProjects.length) {
@@ -370,7 +373,9 @@ class Project {
370
373
  getNewLine: () => ts.sys.newLine,
371
374
  });
372
375
  output = output.trimEnd();
373
- output = output.replace(`TS${diagnostic.code}`, String(diagnostic.code));
376
+ if (typeof diagnostic.code === 'string') {
377
+ output = output.replace(`TS${diagnostic.code}`, diagnostic.code);
378
+ }
374
379
  if (diagnostic.category === ts.DiagnosticCategory.Error) {
375
380
  errors++;
376
381
  log(output, 1);
@@ -379,6 +384,10 @@ class Project {
379
384
  warnings++;
380
385
  log(output, 2);
381
386
  }
387
+ else if (diagnostic.category === ts.DiagnosticCategory.Message) {
388
+ messages++;
389
+ log(output);
390
+ }
382
391
  else {
383
392
  log(output);
384
393
  }
@@ -447,6 +456,9 @@ class Project {
447
456
  else if (code === 2) {
448
457
  clack.log.warn(msg);
449
458
  }
459
+ else if (code === 3) {
460
+ clack.log.message(msg);
461
+ }
450
462
  else {
451
463
  clack.log.step(msg);
452
464
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsslint/cli",
3
- "version": "1.6.1",
3
+ "version": "2.0.0-alpha.0",
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.6.1",
20
- "@tsslint/core": "1.6.1",
19
+ "@tsslint/config": "2.0.0-alpha.0",
20
+ "@tsslint/core": "2.0.0-alpha.0",
21
21
  "@volar/language-core": "~2.4.0",
22
22
  "@volar/language-hub": "0.0.1",
23
23
  "@volar/typescript": "~2.4.0",
@@ -31,5 +31,5 @@
31
31
  "@vue-vine/language-service": "latest",
32
32
  "@vue/language-core": "latest"
33
33
  },
34
- "gitHead": "875699df671c2d9a8331c930af8c549ebab19f17"
34
+ "gitHead": "19af9ad4d3ee0950a6e18faacbe01d3efb5c726c"
35
35
  }