diff --git a/README.md b/README.md index 886262fa8ec..9a398e12b6f 100644 --- a/README.md +++ b/README.md @@ -68,11 +68,17 @@ usage: `tslint [options] [file ...]` Options: ``` --c, --config configuration file --o, --out output file --r, --rules-dir rules directory --s, --formatters-dir formatters directory --t, --format output format (prose, json) [default: "prose"] +-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 ``` By default, configuration is loaded from `tslint.json`, if it exists in the current path, or the user's home directory, in that order. @@ -130,7 +136,8 @@ tslint accepts the following command-line options: The formatter to use to format the results of the linter before outputting it to stdout or the file passed in --out. The core formatters are prose (human readable), json (machine readable) - and verbose. prose is the default if this option is not used. Additonal + and verbose. prose is the default if this option is not used. + Other built-in options include pmd, msbuild, and checkstyle. Additonal formatters can be added and used if the --formatters-dir option is set. --test: @@ -194,7 +201,7 @@ A sample configuration file with all options is available [here](https://github. * `"check-uppercase"` enforces the rule that the first non-whitespace character of a comment must be uppercase, if applicable. * `curly` enforces braces for `if`/`for`/`do`/`while` statements. * `eofline` enforces the file to end with a newline. -* `forin` enforces a `for ... in` statement to be filtered with an `if` statement.* +* `forin` enforces a `for ... in` statement to be filtered with an `if` statement. * `indent` enforces indentation with tabs or spaces. Rule options (one is required): * `"tabs"` enforces consistent tabs. * `"spaces"` enforces consistent spaces. @@ -234,8 +241,9 @@ A sample configuration file with all options is available [here](https://github. * `no-eval` disallows `eval` function invocations. * `no-inferrable-types` disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean. * `no-internal-module` disallows internal `module` (use `namespace` instead). -* `no-null-keyword` disallows use of the `null` keyword literal -* `no-reference` disallows `/// ` imports (use ES6-style imports instead). +* `no-invalid-this` disallows using the `this` keyword outside of classes. +* `no-null-keyword` disallows use of the `null` keyword literal. +* `no-reference` disallows `/// ` imports (use ES6-style imports instead). * `no-require-imports` disallows invocation of `require()` (use ES6-style imports instead). * `no-shadowed-variable` disallows shadowed variable declarations. * `no-string-literal` disallows object access via string literals. @@ -293,7 +301,7 @@ A sample configuration file with all options is available [here](https://github. * `"parameter"` checks function parameters. * `"property-declaration"` checks object property declarations. * `"variable-declaration"` checks variable declaration. -* `use-isnan` enforces that you use the isNaN() function to check for NaN references instead of a comparison to the NaN constant. Similar to the [use-isnan ESLint rule](http://eslint.org/docs/rules/use-isnan). +* `use-isnan` enforces that you use the isNaN() function to check for NaN references instead of a comparison to the NaN constant. * `use-strict` enforces ECMAScript 5's strict mode. * `check-module` checks that all top-level modules are using strict mode. * `check-function` checks that all top-level functions are using strict mode. diff --git a/docs/sample.tslint.json b/docs/sample.tslint.json index 904927ead18..29ee3ee2c17 100644 --- a/docs/sample.tslint.json +++ b/docs/sample.tslint.json @@ -67,7 +67,9 @@ "no-eval": true, "no-inferrable-types": false, "no-internal-module": true, + "no-invalid-this": true, "no-null-keyword": true, + "no-reference": true, "no-require-imports": true, "no-shadowed-variable": true, "no-string-literal": true, @@ -134,6 +136,7 @@ "variable-declaration": "space" } ], + "use-isnan": true, "use-strict": [ true, "check-module", diff --git a/src/tslint-cli.ts b/src/tslint-cli.ts index c716c466eb5..9c0430bd993 100644 --- a/src/tslint-cli.ts +++ b/src/tslint-cli.ts @@ -75,7 +75,7 @@ let processed = optimist "t": { alias: "format", default: "prose", - describe: "output format (prose, json, verbose)", + describe: "output format (prose, json, verbose, pmd, msbuild, checkstyle)", }, "test": { describe: "test that tslint produces the correct output for the specified directory", @@ -174,7 +174,8 @@ tslint accepts the following commandline options: The formatter to use to format the results of the linter before outputting it to stdout or the file passed in --out. The core formatters are prose (human readable), json (machine readable) - and verbose. prose is the default if this option is not used. Additonal + and verbose. prose is the default if this option is not used. + Other built-in options include pmd, msbuild, and checkstyle. Additonal formatters can be added and used if the --formatters-dir option is set. --test: