Skip to content
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

ng lint, is linting node_modules files. #5063

Closed
daBishMan opened this issue Feb 27, 2017 · 6 comments
Closed

ng lint, is linting node_modules files. #5063

daBishMan opened this issue Feb 27, 2017 · 6 comments

Comments

@daBishMan
Copy link

Please provide us with the following information:

OS?

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
$ ng -v
@angular/cli: 1.0.0-rc.0
node: 7.5.0
os: win32 x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.8

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
This app was updated from 32.3 to rc.0

The log given by the failure.

Normally this include a stack trace and some more information.
It running lint against node_module.

/node_modules/lru-ts/index.ts[231, 5]:

Mention any other details that might be useful.

this did not happen in 32.3


Thanks! We'll be in touch soon.

@delasteve
Copy link
Contributor

delasteve commented Feb 27, 2017

Hey @daBishMan, this is because the library you're using publishes .ts files as well as .js files. TSLint would do the same if you did tslint --project=src/tsconfig.app.json. Check out the CHANGELOG.md for how to ignore node_modules. This should be happening in beta.32.3. I'd be surprised if it wasn't.

https://github.com/angular/angular-cli/blob/master/CHANGELOG.md#breaking-changes-3

Discussed in #4350, fixed in #4437

@daBishMan
Copy link
Author

Thank you so much for your quick reply.

I have included the following in .angular.cli.json based on my understanding. I looked at https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/lib/config/schema.json

"lint": [ { "project": "src/tsconfig.app.json", "exclude": [ "../node_modules/**/*" ] }, { "project": "src/tsconfig.spec.json" }, { "project": "e2e/tsconfig.e2e.json" } ],

this is how I excluded in .angular-cli.json, but it is still happening, am I missing something.

@delasteve
Copy link
Contributor

I misspoke when I suggested it was in the CHANGELOG.md, sorry. I was thinking of the first PR I did that changed how linting was done, not the update that had allowed exclude.

#4350 (comment) discusses what needs to be done.

In short, this should fix your issue.

"lint": [
  {
    "project": "src/tsconfig.app.json",
    "exclude": "**/node_modules/**/*"
  },
  {
    "project": "src/tsconfig.spec.json",
    "exclude": "**/node_modules/**/*"
  },
  {
    "project": "e2e/tsconfig.e2e.json",
    "exclude": "**/node_modules/**/*"
  }
],

@daBishMan
Copy link
Author

thank you so much again for your help. This does fix my issue.

I am going to close this issue.

@lexigren
Copy link

lexigren commented Mar 2, 2017

My config:

"lint": [
    {
      "files": "src/**/*.ts",
      "project": "src/tsconfig.json",
      "exclude": "**/node_modules/**/*"
    },
    {
      "files": "e2e/**/*.ts",
      "project": "e2e/tsconfig.json",
      "exclude": "**/node_modules/**/*"
    }
  ]

Still linting node_modules.
My version is 1.0.0-beta.28.3.

dinvlad pushed a commit to cumulous/web that referenced this issue Oct 20, 2017
Apparently, we have to set up a special glob pattern
in .angular-cli.json instead of tsconfig.*
(angular/angular-cli#5063).

We also no longer need tsconfig.lint.json.
@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 6, 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

3 participants