0

I've got TSLint running nicely in my IDE and everything is great! However when I run npm run tslint it throws errors on some of my .svg and .scss files. It shouldn't be running on that and it doesn't run those in my IDE so what's up?

Here's my package.json script:

  "scripts": {
    "lint": "tslint ./src/*",
  },

Can I edit that script to ignore .svg and .scss files?

kaya3
  • 47,440
  • 4
  • 68
  • 97
Barry Michael Doyle
  • 9,333
  • 30
  • 83
  • 143
  • Possible duplicate of [How to ignore a particular directory or file for tslint?](https://stackoverflow.com/questions/34578677/how-to-ignore-a-particular-directory-or-file-for-tslint) – RobC Mar 20 '19 at 09:09

1 Answers1

1

You'll want to only lint .ts and .tsx files (or just .ts if you're not on React).

  "scripts": {
    "lint": "tslint ./src/**/*.ts ./src/**/*.tsx",
  },
Josh
  • 1,997
  • 13
  • 21
  • `tslint` utilizes the [glob](https://github.com/palantir/tslint/blob/master/package.json#LC37) package for file globbing, so presumably this could be refactored to utilize [brace expansion](https://github.com/isaacs/node-glob). For instance: `"lint": "tslint ./src/**/*.{ts,tsx}",` – RobC Mar 21 '19 at 09:47