-
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.
feat(@angular/cli): allow lint project setting to be optional
- Loading branch information
1 parent
a5d8bc1
commit 8035f54
Showing
2 changed files
with
70 additions
and
7 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,26 @@ | ||
import { ng } from '../../utils/process'; | ||
import { writeFile } from '../../utils/fs'; | ||
import { expectToFail } from '../../utils/utils'; | ||
import { oneLine } from 'common-tags'; | ||
|
||
export default function () { | ||
return Promise.resolve() | ||
.then(() => ng('set', 'lint.0.project', '')) | ||
.then(() => ng('lint', '--type-check')) | ||
.then(({ stdout }) => { | ||
if (!stdout.match(/A "project" must be specified to enable type checking./)) { | ||
throw new Error(oneLine` | ||
Expected to match "A "project" must be specified to enable type checking." | ||
in ${stdout}. | ||
`); | ||
} | ||
|
||
return stdout; | ||
}) | ||
.then(() => ng('set', 'lint.0.files', '"**/baz.ts"')) | ||
.then(() => writeFile('src/app/foo.ts', 'const foo = "";\n')) | ||
.then(() => writeFile('src/app/baz.ts', 'const baz = \'\';\n')) | ||
.then(() => ng('lint')) | ||
.then(() => ng('set', 'lint.0.files', '"**/foo.ts"')) | ||
.then(() => expectToFail(() => ng('lint'))); | ||
} |