Skip to content

ng lint lints files in node_modules if it is imported in your project #7768

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

Closed
micahwood opened this issue Sep 20, 2017 · 3 comments
Closed

Comments

@micahwood
Copy link

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
#5063

@micahwood micahwood changed the title ng lint tests files in node_modules if it is imported in your project ng lint lints files in node_modules if it is imported in your project Sep 20, 2017
@clydin
Copy link
Member

clydin commented Sep 20, 2017

This has been fixed via angular/devkit#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.

@micahwood
Copy link
Author

Thanks, missed that one in my search

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants