From a56bea5c765b2c8b0ad178a65b7123775aadc68e Mon Sep 17 00:00:00 2001 From: york yao Date: Tue, 13 Nov 2018 21:10:59 +0800 Subject: [PATCH] feat: show absolute path in --detail mode, as link in console --- clean-scripts.config.js | 2 +- spec/result.txt | 15 --------------- src/index.ts | 2 +- 3 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 spec/result.txt diff --git a/clean-scripts.config.js b/clean-scripts.config.js index 0dda65e..0ab9363 100644 --- a/clean-scripts.config.js +++ b/clean-scripts.config.js @@ -5,7 +5,7 @@ module.exports = { build: [ 'rimraf dist/', 'tsc -p src/', - 'node dist/index.js -p src --detail --supressError > spec/result.txt' + 'node dist/index.js -p src --detail --supressError' ], lint: { ts: `tslint ${tsFiles}`, diff --git a/spec/result.txt b/spec/result.txt deleted file mode 100644 index 57c9980..0000000 --- a/spec/result.txt +++ /dev/null @@ -1,15 +0,0 @@ -src/tsconfig.ts:43:20: config -src/core.ts:30:45: intrinsicName -src/core.ts:39:159: intrinsicName -src/index.ts:21:37: v -src/index.ts:21:47: version -src/index.ts:27:24: suppressError -src/index.ts:29:62: p -src/index.ts:29:72: project -src/index.ts:29:93: detail -src/index.ts:29:106: debug -src/index.ts:58:4: error -src/index.ts:59:7: error -src/index.ts:62:17: error -3208 / 3221 99.60% -type-coverage success. diff --git a/src/index.ts b/src/index.ts index eacbb23..4f43930 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,7 +28,7 @@ async function executeCommandLine() { const { correctCount, totalCount, anys } = await lint(argv.p || argv.project || '.', argv.detail, argv.debug) for (const { file, line, character, text } of anys) { - console.log(`${file}:${line + 1}:${character + 1}: ${text}`) + console.log(`${path.resolve(process.cwd(), file)}:${line + 1}:${character + 1}: ${text}`) } const percent = Math.round(10000 * correctCount / totalCount) / 100 console.log(`${correctCount} / ${totalCount} ${percent.toFixed(2)}%`)