Skip to content

Commit 6c09f1d

Browse files
clydindond2clouds
authored andcommitted
fix(@angular/cli): allow tslint to find the appropriate config (angular#5792)
TSLint includes logic to find the most relevant config per linted file. Unfortunately, by defaulting the config filename this behavior was being disabled. Fixes angular#5770
1 parent be3e131 commit 6c09f1d

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

packages/@angular/cli/lib/config/schema.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,7 @@
232232
},
233233
"tslintConfig": {
234234
"description": "Location of the tslint.json configuration.",
235-
"type": "string",
236-
"default": "tslint.json"
235+
"type": "string"
237236
},
238237
"exclude": {
239238
"description": "File glob(s) to ignore.",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { createDir, writeFile } from '../../utils/fs';
2+
import { ng } from '../../utils/process';
3+
import { expectToFail } from '../../utils/utils';
4+
5+
export default function () {
6+
const fileName = 'src/app/foo/foo.ts';
7+
const nestedConfigContent = `
8+
{
9+
"rules": {
10+
"quotemark": [
11+
true,
12+
"double",
13+
"avoid-escape"
14+
]
15+
}
16+
}`;
17+
18+
return Promise.resolve()
19+
.then(() => createDir('src/app/foo'))
20+
.then(() => writeFile(fileName, 'const foo = \'\';\n'))
21+
.then(() => writeFile('src/app/foo/tslint.json', nestedConfigContent))
22+
.then(() => expectToFail(() => ng('lint')));
23+
}

0 commit comments

Comments
 (0)