Angular-cli: [Angular CLI: 6.0.0] ng lint Invalid lint configuration. Nothing to lint.

Created on 14 May 2018  路  6Comments  路  Source: angular/angular-cli

Versions

Angular CLI: 6.0.0
Node: 9.0.0
OS: darwin x64
Angular: 6.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, http, language-service, platform-browser
... platform-browser-dynamic, router, upgrade

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

macOS (High Sierra)

Repro steps

Running ng lint.
The files are linted but there is still an error "Invalid lint configuration. Nothing to lint.". Same effect when success and error.

      "lint": {
                    "builder": "@angular-devkit/build-angular:tslint",
                    "options": {
                        "tslintConfig": "tslint.json",
                        "tsConfig": [
                            "tsconfig.app.json"
                        ],
                        "files": [
                            "source/**/*.ts"
                        ],
                        "exclude": [
                            "source/**/*.spec.ts",
                            "source/**/*.mock.ts"
                        ]
                    }
                }

Observed behavior

screen shot 2018-05-14 at 15 19 55

devkibuild-angular

Most helpful comment

As far as I understand, ng lint command runs lint configs for all projects. By default, even if you created just one, you actually have two configured in angular.json: the main and e2e version. I can imagine if you add no e2e test it will complain about wrong configuration as there is no single test to run.

I'd say it's not a bug. To workaround, you can:

  1. Add a e2e test spec,
  2. Or remove e2e configuration if you don't plan to do e2e at all;
  3. Or run linting per project: ng lint project-name

All 6 comments

I'm experiencing same error. Any ideas what it might be? It seems to be processing the files but at the end it throws this error message.

Same error here. Would be nice to see it fixed soon.

As far as I understand, ng lint command runs lint configs for all projects. By default, even if you created just one, you actually have two configured in angular.json: the main and e2e version. I can imagine if you add no e2e test it will complain about wrong configuration as there is no single test to run.

I'd say it's not a bug. To workaround, you can:

  1. Add a e2e test spec,
  2. Or remove e2e configuration if you don't plan to do e2e at all;
  3. Or run linting per project: ng lint project-name

@AlexGS74 Thank you for that explanation. It fixed my issue, I just removed lint for e2e tests. Would it be possible to add to that error message name of the project, so that it's easier to figure out what is going on?

Thanks for reporting this issue. This issue was originally reported a long time ago and since then we've had many releases, one of which might have addressed this problem. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sysmat picture sysmat  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

jbeckton picture jbeckton  路  3Comments

5amfung picture 5amfung  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments