-
Notifications
You must be signed in to change notification settings - Fork 235
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
@angular/core and @angular/compiler explicitly listed as dependencies in published package.json #990
Comments
Was upgrading our Angular app and had to upgrade Codelyzer for the support of v11. However, this will result in two different versions of This does not seem the desired behavior, so it means our upgrade is blocked because of this. |
This error caused me to have to remove Codelyzer from our app. There is a work-around, but we have too many people installing to have to explain work-around to each. Work-around is to:
Hope this is fixed soon. |
This also leads to npm audit vulnerabilities that can't be resolved:
Running |
Having these dependencies results in not being able to build our project that is within a monorepo, as Angular 9.0.0 is what gets installed in the root |
Bump. Any actions taken around this for the 2+ years the issue has been open? With Codelyzer currently on I would be flattered by a response from the dev team, uninstalling such a fantastic package would be a shame. 54 Open PRs, some date back to 2019? |
Describe the bug
I'm seeing a Typescript issue because of
@angular/core
being explicitly listed as a dependency ofcodelyzer
.Context and configuration
codelyzer
lists@angular/core: 9.0.0
as an explicit dependency in itspackage.json
, while my own app is running@angular/core: 9.2.13
. I have a custom rule that extendsBasicTemplateAstVisitor
.The following code snippet is a minimal reproduction of the scenario I'm facing:
This throws a Typescript error with the latest version of
codelyzer
:This error stems from the fact that
ElementAst
invisitElement
(node_modules\codelyzer\angular\templates\basicTemplateAstVisitor.d.ts
) refers tonode_modules\codelyzer\node_modules\@angular\compiler\src\template_parser\template_ast.d.ts
as opposed tonode_modules\@angular\compiler\compiler.d.ts
.Removing both
@angular/core
as well as@angular/compiler
from thecodelyzer
package.json
and running annpm i
innode_modules/codelyzer
addresses the issue locally, because it then starts using the right@angular/compiler
.So this makes me wonder: why are
@angular/core
and@angular/common
explicitly listed asdependencies
in the published package? AFAIK havingdependencies
in a package is bad idea, andpeerDependencies
are the way to go. Am I missing something here?Expected behavior
No Typescript error should be thrown, since
codelyzer
should be using@angular/core
from your mainnode_modules
.Proposed fix
Remove
@angular/core
and@angular/compiler
from the publishedpackage.json
.Environment
Irrelevant AFAIK, can add if needed.
The text was updated successfully, but these errors were encountered: