Individual TSLint rules for subdirectory

In case you want to have different TSLint rules for a subdirectory, for example a different Angular component selector rule, you just need 2 steps to achieve this.

  1. Create a tslint.json in your subdirectory root.
  2. Extend from the deafult tslint.json and append the new rules:
{
   "extends": "../../../../tslint.json",
   "rules": {
      "directive-selector": [true, "attribute", "uv", "camelCase"],
      "component-selector": [true, "element", "uv", "kebab-case"]
   }
}

In this case, the expected selector prefix is now uv instead the default app.

Leave a Reply

Your email address will not be published. Required fields are marked *