Skip to content

Linter exclude option does not exclude files matching glob? #11773

Closed
@eppsilon

Description

@eppsilon

Bug Report or Feature Request (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [X] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

macOS 10.13.6

Angular CLI: 6.1.1
Node: 8.11.3
OS: darwin x64
Angular: 6.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.7.1
@angular-devkit/build-angular      0.7.1
@angular-devkit/build-ng-packagr   0.7.1
@angular-devkit/build-optimizer    0.7.1
@angular-devkit/build-webpack      0.7.1
@angular-devkit/core               0.7.1
@angular-devkit/schematics         0.7.1
@angular/cli                       6.1.1
@ngtools/json-schema               1.1.0
@ngtools/webpack                   6.1.1
@schematics/angular                0.7.1
@schematics/update                 0.7.1
ng-packagr                         4.0.1
rxjs                               6.2.2
typescript                         2.9.2
webpack                            4.9.2

Repro steps

  1. Create a new Angular workspace with a project named @company/app
  2. In projects/company/app/src/apis/widgets add at least one TS file with an error TS lint will catch
  3. In angular.json add this glob to the array under projects.@company/app.architect.lint.options.exclude: projects/company/app/src/apis/**"
  4. Run ng lint @company/app

The log given by the failure

Linter errors for files under projects/company/app/src/apis/widgets/**

Desired functionality

The glob seems like it should match all files under app/src/apis/widgets and exclude them. The path is relative to the angular.json file and is consistent with other paths in the architect configuration.

Oddly, **/projects/company/app/src/apis/widgets/** does exclude the files. Also, ./projects/company/app/src/apis/widgets/** does not.

Related issue

The exclude option in the tslint.json file inside projects/company/app appears to get ignored or clobbered by the angular.json setting. Ideally you could exclude files using tslint.json and ensure editors that are unaware of angular.json also exclude the right files.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions