Skip to content

Generation of library produces tslint error like "'Component' is not included in a module" #10638

@Nodarii

Description

@Nodarii

Versions

Angular CLI: 6.0.0
Node: 8.9.4
OS: win32 x64
Angular: 6.0.0
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.6.0
@angular-devkit/build-angular      0.6.0
@angular-devkit/build-ng-packagr   0.6.0
@angular-devkit/build-optimizer    0.6.0
@angular-devkit/core               0.6.0
@angular-devkit/schematics         0.6.0
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.0.0
@schematics/angular                0.6.0
@schematics/update                 0.6.0
ng-packagr                         3.0.0-rc.2
rxjs                               6.1.0
typescript                         2.7.2
webpack                            4.6.0

Repro steps

  • ng new projectX && cd projectX && ng generate library my-lib
  • Open project in Webstorm (I'm using v2018.1)

Observed behavior

Project builds successfully but linter shows error like:
Error:(3, 2) ng: Component 'MyLibComponent' is not included in a module and will not be available inside a template. Consider adding it to a NgModule declaration
image
TypeScript config:
image

Desired behavior

Cli should produce code that passes all tslint checks.

Mention any other details that might be useful (optional)

Of course it it is not critical, but kind of annoying issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions