Skip to content

Commit

Permalink
fix(@angular/cli): allow tslint to find the appropriate config (#5792)
Browse files Browse the repository at this point in the history
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
clydin authored and filipesilva committed Apr 3, 2017
1 parent 0df3f7c commit 7377f66
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
3 changes: 1 addition & 2 deletions packages/@angular/cli/lib/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@
},
"tslintConfig": {
"description": "Location of the tslint.json configuration.",
"type": "string",
"default": "tslint.json"
"type": "string"
},
"exclude": {
"description": "File glob(s) to ignore.",
Expand Down
23 changes: 23 additions & 0 deletions tests/e2e/tests/lint/lint-with-nested-configs.ts
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')));
}

0 comments on commit 7377f66

Please sign in to comment.