I'm attempting to start linting my Angular project. Using Angular 4.x, so I still have an .angular.cli.json file, which contains:
"lint": [
{
"project": "CedarsReport/src/tsconfig.app.json"
},
{
"project": "CedarsReport/src/tsconfig.spec.json"
},
{
"project": "CedarsReport/e2e/tsconfig.e2e.json"
}
],
The tsconfig.app.json at this path is simply:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"module": "es2015",
"baseUrl": "",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
}
However, when I execute "ng lint" in the parent directory (or "ng lint my-app", where my-app is my project's name), I get errors only for test.ts in my project root:
CedarsReport/src/test.ts[16, 13]: Identifier '__karma__' is never reassigned; use 'const' instead of 'let'.
CedarsReport/src/test.ts[17, 13]: Identifier 'require' is never reassigned; use 'const' instead of 'let'.
even though test.ts is specifically excluded in tsconfig.app.json shown above. Additionally, the tsconfig.json in the parent directory (referenced in 'extends' above) contains this:
"include": [
"src/app/**/*",
"src/*.ts",
"src/*.html"
],
which I imagine should result in all my source code being linted (??), but this doesn't seem to be happening either.
I'm guessing I'm mis-understanding something about how to properly set up 'ng lint' so it knows where my source files are that I want linted, and what I want excluded. However the documentation for Angular CLI's lint command is sparse. Any pointers (even to documentation) appreciated!