-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate Lint Errors #5259
Comments
I see the same issue.
|
as per chat with @filipesilva , this may be due to the multiple TS projects now included in the CLI. |
It seems like the linter runs once for each project? and since the tests should include the same components it is hitting the same code twice |
For machine readable output formats, ng lint was concatenating multiple documents into a single file. This resulted in invalid JSON, XML, etc. The lint results are now aggregated and one full output is generated. Fix angular#5259 Close angular#5224
It seems that there's again a similar issue with @angular/cli@6.0.3 now, can someone confirm? |
After some tests, I found that commenting one of the two |
Same problem for me. Included two tsConfigs in "lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
} |
If "lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "src/tsconfig.spec.json",
"typeCheck": true,
"format": "stylish"
}
} |
I'd love to have a chance to include both spec and app tsconfigs of my project inside of angular.json/lint options, without caring about their content. Solution above is more like a temporary workaround (I have to admit it works fine), not a state we'd like to see here for ever IMO. (I see that PR is still closed - is anyone aware of this issue?) |
CC: @filipesilva |
I'm also having duplicated error messages when running this:
Any solution or workaround available? |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
OSX El Capitan Version 10.11.6
Versions.
Repro steps.
ng new lint-test
cd lint-test
ng g component components/test-lint
src/app/components/test-lint/test-lint.component.ts
and cause one lint error (e.g, use " instead of ')npm run lint
The log given by the failure.
Mention any other details that might be useful.
Through a bit of trial and error it seems the issue only occurs on files that are nested inside subfolders like
components
and are imported to other nested files. In this case it happens out of the box becauseng new
generates atest-lint.component.spec.ts
file for each component which has animport { TestLintComponent } from './test-lint.component';
thus causing lint errors on the component to be reported twice.A temporary fix in my particular case was to remove
"include": [ "**/*.spec.ts" ]
fromsrc/tsconfig.spec.json
since linting test specs was a priority to me.It'd be nice to know more about the cause and if there is a better fix for this dilemma.
Thanks! ^^
The text was updated successfully, but these errors were encountered: