Angular-cli: ng lint fails on src/typings

Created on 20 Sep 2016  路  3Comments  路  Source: angular/angular-cli

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

OSX 10.11.6

  1. 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.14
node: 6.5.0
os: darwin x64

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

Add jQuery to typings.json (and run typings install to create src/typings/globals/jquery/index.d.ts)

  1. The log given by the failure. Normally this include a stack trace and some
    more information.

src/typings/globals/jquery/index.d.ts[19, 5]: Declaration of public instance member variable not allowed to appear after declaration of public instance member function
Among many other errors

  1. Mention any other details that might be useful.

It would be nice to have a way to exclude folders ourselves (as of right now, ignoring in TSLint only works from a command line flag), or just automatically exclude src/typings be default


Thanks! We'll be in touch soon.

Most helpful comment

I'm running into an issue that seems counter to that last piece of advice, @filipesilva . Maybe you can help me out?

I'm trying to exclude a folder called /mocks/ when TSLint runs prior to my tests. I've added the following line to my scripts in package.json:
"lint": "tslint \"src/**/*.ts\" -e \"**/mocks/*.ts\"",

When I run npm run lint this faithfully ignores the /mocks/ folder, but when I run ng test, the folder gets linted. Is it still the case that configuring the lint task in package.json should affect the lint executed prior to tests run for ng test?

I'm running Windows 7.

angular-cli: 1.0.0-beta.16
node: 6.5.0
os: win32 x64

All 3 comments

We use TSLint for linting, and basically just call npm run lint when you do ng lint.

You can edit the lint script in package.json to exclude that directory:

"lint": "tslint \"src/**/*.ts\" -e \"src/typings/**/*\"",

I'm running into an issue that seems counter to that last piece of advice, @filipesilva . Maybe you can help me out?

I'm trying to exclude a folder called /mocks/ when TSLint runs prior to my tests. I've added the following line to my scripts in package.json:
"lint": "tslint \"src/**/*.ts\" -e \"**/mocks/*.ts\"",

When I run npm run lint this faithfully ignores the /mocks/ folder, but when I run ng test, the folder gets linted. Is it still the case that configuring the lint task in package.json should affect the lint executed prior to tests run for ng test?

I'm running Windows 7.

angular-cli: 1.0.0-beta.16
node: 6.5.0
os: win32 x64

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

NCC1701M picture NCC1701M  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments

NilsHolger picture NilsHolger  路  3Comments

naveedahmed1 picture naveedahmed1  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments