Skip to content

ng lint is linting node_modules since Beta 28.3 #4350

@maxime1992

Description

@maxime1992

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Ubuntu 16.10 x64

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.28.3
node: 7.4.0
os: linux x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/flex-layout: 2.0.0-beta.4
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Upgraded to angular-cli beta.28.3 and running ng lint gives me a high number of lint error that can be found in ... node_modules.

  • I tried to repro with fresh project but couldn't
  • Tried to compare all related files between fresh and existing repo : Didn't notice anything that might have that kind of impact
  • Tried to remove my yarn.lock and reinstall with fresh deps : Didn't change

Mention any other details that might be useful.

When I upgraded from beta 26 to beta 28.3, the lint property was added into angular-cli.json :
image

@victornoel found something interesting in the code tho :
https://github.com/angular/angular-cli/blob/master/packages/%40angular/cli/tasks/lint.ts#L32

image

We get config.project and store it into program .
Then we get the files from Linter.getFileNames(program); and not from config.files.

Thus, this part of our conf is never used :
image

Why is it working well in a fresh project, I have no idea ...

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