0
votes

Outcome I'm looking for:

I have sublime IDE and want my typescript code to be linted as I type versus using a watcher any ng commands.

I have an angularcli and I'm looking at the .angular-cli.json file.

I see theirs a lint array section and I've added a link to my new tslint.json file:

  "lint": [
    {
      "project": "tslint.json"
    }
  ]

I've then created a tslint.json file and added one rule for testing:

{
  "rules": {
    "semicolon": [
        true,
        "always"
     ]
  }
}

I've tried doing an ng lint because my package.json has the following:

 "scripts": {
    "lint": "gulp lint"
  }

When I do an ng lint I get this error:

nvalidConfigError: Parsing '/Users/markoddi/Public/appscatter_ui2/.angular-cli.json' failed. Ensure the file is valid JSON. Error: Unexpected token / in JSON at position 1135

In short I need some help wiring this up so tslint occurs while coding.

1

1 Answers

0
votes

AFAIK, you can't do this with the CLI. See this: https://github.com/angular/angular-cli/issues/2551

You may, however, be able to do this as a plugin to your editor. For example, with VS Code you can use this: https://marketplace.visualstudio.com/items?itemName=eg2.tslint I'm not sure what is available for sublime.