You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/usage/configuration/index.md
+35-4
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ title: Configuring TSLint
4
4
permalink: /usage/configuration/
5
5
---
6
6
7
-
### tslint.json
7
+
### TSLint Configuration
8
8
9
-
When using [the CLI][0] or many [third-party tools][1], a file named `tslint.json` is used to
10
-
configure which rules get run and each of their options. This configuration file may be comp
9
+
When using [the CLI][0] or many [third-party tools][1], a file named `tslint.json`or `tslint.yaml`is used to
10
+
configure which rules get run and each of their options.
11
11
12
-
`tslint.json` files can have the following fields specified:
12
+
`tslint.json`or `tslint.yaml`files can have the following fields specified:
13
13
14
14
*`extends?: string | string[]`:
15
15
The name of a built-in configuration preset (see built-in presets below), or a path or
@@ -71,6 +71,37 @@ An example `tslint.json` file might look like this:
71
71
}
72
72
```
73
73
74
+
The corresponding YAML file looks like this:
75
+
76
+
```yaml
77
+
---
78
+
extends: "tslint:recommended"
79
+
rulesDirectory:
80
+
- path/to/custom/rules/directory/
81
+
- another/path/
82
+
rules:
83
+
max-line-length:
84
+
options: [120]
85
+
new-parens: true
86
+
no-arg: true
87
+
no-bitwise: true
88
+
no-conditional-assignment: true
89
+
no-consecutive-blank-lines: false
90
+
no-console:
91
+
severity: warning
92
+
options:
93
+
- debug
94
+
- info
95
+
- log
96
+
- time
97
+
- timeEnd
98
+
- trace
99
+
jsRules:
100
+
max-line-length:
101
+
options: [120]
102
+
...
103
+
```
104
+
74
105
### Rule severity
75
106
76
107
The severity level of each rule can can be configured to `default`, `error`, `warning`/`warn`, or `off`/`none`. If no severity level is specified, `default` is used. The `defaultSeverity` top-level option replaces the severity level for each rule that uses severity level `default` in the current file. Valid values for `defaultSeverity` include `error`, `warning`/`warn`, and `off`/`none`.
0 commit comments