2016-01-03 19 views

risposta

44

AGGIORNAMENTO CON TSLINT v5.8.0

Come è stata menzionata da Saugat Acharya è ora possibile aggiornare tslint.json Opzioni CLI:

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

Maggiori informazioni here


Questa caratteristica è stata introdotta con TSLINT 3.6

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

È ora possibile aggiungere --exclude (o -e) vedere PR qui.

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 

si sta guardando utilizzando

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

Buono a sapersi, tuttavia, non lo uso da un po '. – user3330840

+0

sai come escludere percorsi multipli? –

+3

ripetete l'argomento di esclusione più volte –

4

Sto usando codice Visual Studio e questo

/* tslint:disable */

ha lavorato per me. Check out questa pagina, circa 3/4 del modo in giù ci sono alcuni comandi disabilitare https://c9.io/lijunle/tslint

7

Oltre alla risposta di Michael, si consideri un secondo modo: l'aggiunta di linterOptions.exclude per tslint.json

Ad esempio, si possono avere tslint.json con righe seguenti:

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

@Maraboc ok, ho aggiunto una spiegazione. – arkhwise

+1

Questo dipende dalla versione 5.8.0, https://github.com/palantir/tslint/releases. – hlovdal

4

partire da tslint v5.8.0 è possibile impostare una proprietà exclude sotto la vostra chiave cliOptions nel file tslint.json:

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

Ulteriori informazioni su questo here.

+1

Questo dovrebbe essere contrassegnato come la risposta corretta (e aggiornata a novembre 2017). –

Problemi correlati