ng lint lints files in node_modules if it is imported in your project
Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.4.2 node: 6.10.0 os: linux x64 @angular/animations: 4.4.3 @angular/common: 4.4.3 @angular/compiler: 4.4.3 @angular/core: 4.4.3 @angular/forms: 4.4.3 @angular/http: 4.4.3 @angular/platform-browser: 4.4.3 @angular/platform-browser-dynamic: 4.4.3 @angular/router: 4.4.3 @angular/cli: 1.4.2 @angular/compiler-cli: 4.4.3 @angular/language-service: 4.4.3 typescript: 2.3.4
Repro steps.
With a new project:
Add ngx-clipboard
npm i ngx-clipboard
import it in your app.module.ts
import { ClipboardModule } from 'ngx-clipboard';
imports: [
BrowserModule,
AppRoutingModule,
ClipboardModule
],
run ng lint
ng lint --type-check
The log given by the failure.
ERROR: /home/micah/Documents/scratch/one-four-two/node_modules/ngx-clipboard/src/clipboard.service.ts[94, 13]: Identifier 'yPosition' is never reassigned; use 'const' instead of 'let'. ERROR: /home/micah/Documents/scratch/one-four-two/node_modules/ngx-clipboard/src/clipboard.service.ts[103, 2]: Unnecessary semicolon ERROR: /home/micah/Documents/scratch/one-four-two/node_modules/ngx-clipboard/src/clipboard.directive.ts[16, 15]: The selector of the directive "ClipboardDirective" should have prefix "app" (https://angular.io/styleguide#style-02-08) ERROR: /home/micah/Documents/scratch/one-four-two/node_modules/ngx-clipboard/src/clipboard.directive.ts[19, 5]: In the class "ClipboardDirective", the directive input property "targetElm" should not be renamed.Please, consider the following use "@Input() targetElm: string"
Desired functionality.
All files pass linting. It should not lint imported node modules.
Mention any other details that might be useful.
It looks like this is a regression caused by removing "exclude": "**/node_modules/**/*" from the lint block in the .angular-cli.json
https://github.com/angular/angular-cli/issues/5063
This has been fixed via https://github.com/angular/devkit/pull/150 and will be available in the next release.
You may want to consider raising an issue with the package in question itself as publishing the typescript source is generally not recommended.
Thanks, missed that one in my search
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.