多行批处理tslint

时间:2019-04-29 15:40:56

标签: batch-processing jslint tslint

我启动了包含tslint命令的批处理

tslint -c ../tslint.json --project tsconfig.json --out output.txt --format msbuild -e '**/bin/Debug/**' -e '**/fonts/**' -e '**/images/**' -e '**/Scripts/**' -e '**/typings/**' -e 'file1.ts' -e 'file2.ts' -e 'file3.ts' -e 'file3.ts' -e 'file4.ts'  
…

不幸的是,我想排除很多文件,而且不容易阅读,所以我想读取相同的文件,但有可能能够在线并在该表格上写东西:

    tslint -c ../tslint.json --project tsconfig.json --out output.txt --format msbuild 
-e '**/bin/Debug/**' 
-e '**/fonts/**' 
-e '**/images/**' 
-e '**/Scripts/**' 
-e '**/typings/**' 
-e 'file1.ts' 
-e 'file2.ts' 
-e 'file3.ts' 
-e 'file3.ts' 
-e 'file4.ts' 

你知道怎么做吗?

1 个答案:

答案 0 :(得分:1)

这是我的评论。

您可以尝试使用尖号 ^ 来转义行返回符,并在每行之前包括一个空格:

tslint --config ../tslint.json --project tsconfig.json --out output.txt --format msbuild ^
--exclude '**/bin/Debug/**' ^
--exclude '**/fonts/**' ^
--exclude '**/images/**' ^
--exclude '**/Scripts/**' ^
--exclude '**/typings/**' ^
--exclude 'file1.ts' ^ 
--exclude 'file2.ts' ^
--exclude 'file3.ts' ^
--exclude 'file4.ts'

或者,用空格开始各行,并用插入符号 ^ 结束每行:

tslint -c ../tslint.json -p tsconfig.json -o output.txt -f msbuild^
 -e '**/bin/Debug/**'^
 -e '**/fonts/**'^
 -e '**/images/**'^
 -e '**/Scripts/**'^
 -e '**/typings/**'^
 -e 'file1.ts'^
 -e 'file2.ts'^
 -e 'file3.ts'^
 -e 'file3.ts'^
 -e 'file4.ts'

由于多个空格对tslint来说不太可能出现问题,因此您甚至可以尝试以下操作:

tslint -c ../tslint.json^
       -p tsconfig.json^
       -o output.txt^
       -f msbuild^
       -e '**/bin/Debug/**'^
       -e '**/fonts/**'^
       -e '**/images/**'^
       -e '**/Scripts/**'^
       -e '**/typings/**'^
       -e 'file1.ts'^
       -e 'file2.ts'^
       -e 'file3.ts'^
       -e 'file4.ts'