пакетный цлинт на несколько строк - PullRequest
0 голосов
/ 29 апреля 2019

Я запускаю пакет, содержащий команду 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 Ответ

1 голос
/ 30 апреля 2019

Вот мой комментарий как ответ.

Вы можете попытаться экранировать возврат строки с помощью каретки, ^, включая пробел перед каждым:

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'
...