Skip to content

ng lint, is linting node_modules files. #5063

Closed

Description

@daBishMan

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.

Activity

  1. delasteve commented on Feb 27, 2017

    @delasteve
    Contributor

    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

  2. daBishMan commented on Feb 27, 2017

    @daBishMan
    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.

  3. delasteve commented on Feb 27, 2017

    @delasteve
    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/**/*"
      }
    ],
    
  4. daBishMan commented on Feb 27, 2017

    @daBishMan
    Author

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

    I am going to close this issue.

  5. lexigren commented on Mar 2, 2017

    @lexigren

    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.

  6. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions