2016-01-03 11 views

Odpowiedz

44

aktualizacji za TSLINT v5.8.0

Jak wspomniano przez Saugat Acharya można teraz aktualizować tslint.json Opcje CLI:

{ 
    "extends": "tslint:latest", 
    "linterOptions": { 
     "exclude": [ 
      "bin", 
      "lib/*generated.js" 
     ] 
    } 
} 

Zobacz szczegóły here


Ta funkcja została wprowadzone z TSLINT 3.6

tslint \"src/**/*.ts\" -e \"**/__test__/**\" 

Możesz teraz dodać --exclude (lub -e), zobacz tutaj PR.

CLI

enter code here usage: tslint [options] file ... 

Options: 

-c, --config   configuration file 
--force    return status code 0 even if there are lint errors 
-h, --help   display detailed help 
-i, --init   generate a tslint.json config file in the current working directory 
-o, --out    output file 
-r, --rules-dir  rules directory 
-s, --formatters-dir formatters directory 
-e, --exclude   exclude globs from path expansion 
-t, --format   output format (prose, json, verbose, pmd, msbuild, checkstyle) [default: "prose"] 
--test    test that tslint produces the correct output for the specified directory 
-v, --version   current version 

szukasz przy użyciu

-e, --exclude   exclude globs from path expansion 
+0

Dobrze wiedzieć, jednak nie używam go przez jakiś czas. – user3330840

+0

Czy wiesz, jak wykluczyć wiele ścieżek? –

+3

Powtórz kilkakrotnie argument wykluczenia –

7

Poza odpowiedzią Michała, za drugi sposób: Dodawanie linterOptions.exclude do tslint.json

na przykład, może masz tslint.json z następujących linii:

{ 
    "linterOptions": { 
    "exclude": [ 
     "someDirectory/*.d.ts" 
    ] 
    } 
} 
+0

@Maraboc ok, dodałem wyjaśnienie. – arkhwise

+1

Jest to zależne od wersji 5.8.0, https://github.com/palantir/tslint/releases. – hlovdal

4

Począwszy od tslint v5.8.0 można ustawić właściwość exclude pod klucz cliOptions w pliku tslint.json:

{ 
    "extends": "tslint:latest", 
    "cliOptions": { 
     "exclude": [ 
      "bin", 
      "**/__test__", 
      "lib/*generated.js" 
     ] 
    } 
} 

Więcej informacji na ten temat: here.

+1

Powinno to zostać oznaczone jako poprawna (i zaktualizowana do listopada 2017 r.) Odpowiedź. –

Powiązane problemy