Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 5e371e9

Browse files
authored
Merge pull request #27 from vemoo/expose-exclude
expose exclude config
2 parents 8338871 + 5feb42c commit 5e371e9

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ You can either configure the TSLint extension using a `tsconfig` or `jsconfig` a
2121

2222
* `tslint.ignoreDefinitionFiles` - Control if TypeScript definition files should be ignored. Default is `true`.
2323

24+
* `tslint.exclude` - A glob or an array of globs. Any file matching these globs will not be linted.
25+
2426
* `tslint.alwaysShowRuleFailuresAsWarnings` - Always show rule failures as warnings, ignoring the severity configuration in the tslint.json configuration.
2527

2628
* `tslint.suppressWhileTypeErrorsPresent` - Suppress tslint errors from being reported while other errors are present.

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@
123123
"type": "boolean",
124124
"description": "Control if TypeScript definition files should be ignored."
125125
},
126+
"tslint.exclude": {
127+
"description": "A glob or an array of globs. Any file matching these globs will not be linted.",
128+
"anyOf": [
129+
{
130+
"type": "string"
131+
},
132+
{
133+
"type": "array",
134+
"items": {
135+
"type": "string"
136+
}
137+
}
138+
]
139+
},
126140
"tslint.alwaysShowRuleFailuresAsWarnings": {
127141
"type": "boolean",
128142
"description": "Always show rule failures as warnings, independent of the tslint configuration."

schemas/tsconfig.schema.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@
3737
"default": true,
3838
"description": "Control if TypeScript definition files should be ignored. Default is `true`."
3939
},
40+
"exclude": {
41+
"description": "A glob or an array of globs. Any file matching these globs will not be linted.",
42+
"anyOf": [
43+
{
44+
"type": "string"
45+
},
46+
{
47+
"type": "array",
48+
"items": {
49+
"type": "string"
50+
}
51+
}
52+
]
53+
},
4054
"alwaysShowRuleFailuresAsWarnings": {
4155
"type": "boolean",
4256
"default": true,

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ interface SynchronizedConfiguration {
1010
configFile?: string;
1111
suppressWhileTypeErrorsPresent?: boolean;
1212
jsEnable?: boolean;
13+
exclude?: string | string[];
1314
}
1415

1516
export async function activate(context: vscode.ExtensionContext) {
@@ -49,6 +50,7 @@ function getConfiguration(): SynchronizedConfiguration {
4950
withConfigValue<boolean>(config, 'suppressWhileTypeErrorsPresent', value => { outConfig.suppressWhileTypeErrorsPresent = value; });
5051
withConfigValue<boolean>(config, 'jsEnable', value => { outConfig.jsEnable = value; });
5152
withConfigValue<string>(config, 'configFile', value => { outConfig.configFile = value; });
53+
withConfigValue<string | string[]>(config, 'exclude', value => { outConfig.exclude = value; });
5254

5355
return outConfig;
5456
}

0 commit comments

Comments
 (0)