-2

I would like to make a build fail if there is any error from TSLint. How I can integrate this into VSTS(TFS online) build?

Skorunka František
  • 5,102
  • 7
  • 44
  • 69

1 Answers1

0

The build step will be failed already if there are any errors from TSLint. For example:

  1. Npm step/task (npm command: install; arguments: tslint typescript -g)
  2. Command line step/task (Tool: tslint; Arguments: app.ts; Working folder: $(Build.SourcesDirectory)

Sample tslint.json:

{
    "defaultSeverity": "error",
   "extends": [
        "tslint:recommended"
    ],
    "jsRules": {},
    "rules": {
        "member-access": [true, "no-public"]
    },
    "rulesDirectory": []
}
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
  • Hi, I got this error: `'tslint' is not recognized as an internal or external command`. I followed your instruction and first task completed successfully. Any idea? ta – Skorunka František May 12 '17 at 11:05
  • What's the detail build log? You can share it on the OneDrive. https://support.office.com/en-us/article/Share-OneDrive-files-and-folders-9fcc2f7d-de0c-4cec-93b0-a82024800c07?ui=en-US&rs=en-US&ad=US – starian chen-MSFT May 15 '17 at 01:47