Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1028 from palantir/readme-update
Browse files Browse the repository at this point in the history
Update README and tweak CLI docs
  • Loading branch information
jkillian committed Mar 11, 2016
2 parents f4d94cd + 1058ee6 commit d6fc245
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 12 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ tslint accepts the following command-line options:
of characters for the max-line-length rule, or what functions to ban
for the ban rule).
-e, --exclude:
A filename or glob which indicates files to exclude from linting.
This option can be supplied multiple times if you need multiple
globs to indicate which files to exclude.
-i, --init:
Generates a tslint.json config file in the current working directory.
-o, --out:
A filename to output the results to. By default, tslint outputs to
stdout, which is usually the console where you're running it from.
Expand All @@ -115,12 +123,20 @@ tslint accepts the following command-line options:
-t, --format:
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) and json (machine readable),
and prose is the default if this option is not used. Additional
formatters can be added and used if the --formatters-dir option
is set.
formatters are prose (human readable), json (machine readable)
and verbose. prose is the default if this option is not used. Additonal
formatters can be added and used if the --formatters-dir option is set.
--test:
Runs tslint on the specified directory and checks if tslint's output matches
the expected output in .lint files. Automatically loads the tslint.json file in the
specified directory as the configuration file for the tests. See the
full tslint documentation for more details on how this can be used to test custom rules.
-v, --version:
The current version of tslint.
--help:
-h, --help:
Prints this help message.
```

Expand Down
5 changes: 3 additions & 2 deletions src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import * as fs from "fs";
import * as path from "path";
import * as findup from "findup-sync";

const PACKAGE_DEPRECATION_MSG = "Configuration of TSLint via package.json has been deprecated,\
please start using the standard tslint.json (http://palantir.github.io/tslint/usage/tslint-json/)";
export const CONFIG_FILENAME = "tslint.json";
export const DEFAULT_CONFIG = {
"rules": {
Expand Down Expand Up @@ -54,6 +52,9 @@ export const DEFAULT_CONFIG = {
},
};

const PACKAGE_DEPRECATION_MSG = "Configuration of TSLint via package.json has been deprecated, "
+ "please start using a tslint.json file instead (http://palantir.github.io/tslint/usage/tslint-json/).";

/**
* Searches for a TSLint configuration and returns the data from the config.
* @param configFile A path to a config file, this can be null if the location of a config is not known
Expand Down
5 changes: 2 additions & 3 deletions src/language/walker/blockScopeAwareRuleWalker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ export abstract class BlockScopeAwareRuleWalker<T, U> extends ScopeAwareRuleWalk
&& (node.parent.kind === ts.SyntaxKind.TryStatement
|| node.parent.kind === ts.SyntaxKind.IfStatement)
)
|| (node.kind === ts.SyntaxKind.Block
&& (
node.parent.kind === ts.SyntaxKind.Block
|| (node.kind === ts.SyntaxKind.Block && node.parent != null
&& (node.parent.kind === ts.SyntaxKind.Block
|| node.parent.kind === ts.SyntaxKind.SourceFile)
);
}
Expand Down
9 changes: 7 additions & 2 deletions src/tslint-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ tslint accepts the following commandline options:
of characters for the max-line-length rule, or what functions to ban
for the ban rule).
-e, --exclude:
A filename or glob which indicates files to exclude from linting.
This option can be supplied multiple times if you need multiple
globs to indicate which files to exclude.
-i, --init:
Generates a tslint.json config file in the current working directory.
Expand All @@ -145,9 +150,9 @@ tslint accepts the following commandline options:
stdout, which is usually the console where you're running it from.
-r, --rules-dir:
An additional rules directory, for additional user-created rules.
An additional rules directory, for user-created rules.
tslint will always check its default rules directory, in
node_modules/tslint/build/rules, before checking the user-provided
node_modules/tslint/lib/rules, before checking the user-provided
rules directory, so rules in the user-provided rules directory
with the same name as the base rules will not be loaded.
Expand Down

0 comments on commit d6fc245

Please sign in to comment.