2

I have an angular 4 app and manually created 2 .spec files for a class. When I run nglint, it will lint the 2 spec files. The spec files that were included when I generated a component with the angular-cli are not being linted however (which is what I want)

I have added the following property to my .angular-cli.json file, but it still lints the files:

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

My spec files are located within /src/app/folder/

Kim Merino
  • 286
  • 1
  • 4
  • 16

1 Answers1

2

Tried now, once you add "**/**/*.spec.ts" to angular-cli.json - lint - exclude, it will stop linting any .spec file down from the app folder, no mater how deep you nest the folders.

This is the angular-cli.json code I tested with:

"lint": [
    {
      "project": "src/tsconfig.app.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "src/tsconfig.spec.json",
      "exclude": ["**/node_modules/**", "**/**/*.spec.ts"]
    },
    {
      "project": "e2e/tsconfig.e2e.json",
      "exclude": "**/node_modules/**"
    }
  ],
BogdanC
  • 2,746
  • 2
  • 24
  • 22
  • The selector of the directive "ClickOutsideDirective" should be used as attribute . How to avoid this issue....:) please help me out.... Thanks in advance – Sujatha Girijala Jun 12 '19 at 12:59