-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(@angular/cli): allow tslint to find the appropriate config (#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 #5770
- Loading branch information
1 parent
0df3f7c
commit 7377f66
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { createDir, writeFile } from '../../utils/fs'; | ||
import { ng } from '../../utils/process'; | ||
import { expectToFail } from '../../utils/utils'; | ||
|
||
export default function () { | ||
const fileName = 'src/app/foo/foo.ts'; | ||
const nestedConfigContent = ` | ||
{ | ||
"rules": { | ||
"quotemark": [ | ||
true, | ||
"double", | ||
"avoid-escape" | ||
] | ||
} | ||
}`; | ||
|
||
return Promise.resolve() | ||
.then(() => createDir('src/app/foo')) | ||
.then(() => writeFile(fileName, 'const foo = \'\';\n')) | ||
.then(() => writeFile('src/app/foo/tslint.json', nestedConfigContent)) | ||
.then(() => expectToFail(() => ng('lint'))); | ||
} |