Skip to content

Latest commit

 

History

History
71 lines (51 loc) · 1.95 KB

README.md

File metadata and controls

71 lines (51 loc) · 1.95 KB

@mcmath/tslint-rules

Version Build

Custom rules for TSLint

Install

Install as an npm devDependency. TypeScript and TSLint should also be installed.

npm install --save-dev typescript tslint @mcmath/tslint-rules

Usage

Include a tslint.json file in your project and add "@mcmath/tslint-rules" to the "extends" field. Custom rules can then be enabled under "rules".

{
  "extends": ["@mcmath/tslint-rules"],
  "rules": {
    "enum-member-name": [true, "caps-case"]
  }
}

Rules

enum-member-name

Ensures enum members follow a consistent naming convention.

This rule accepts a single string option. If no option is given, "pascal-case" is assumed.

Option Attributes Example
"pascal-case" default PascalCase
"camel-case" camelCase
"caps-case" CAPS_CASE
"snake-case" snake_case

enum-name

Ensures enum identifiers follow a consistent naming convention.

This rule accepts a single string option. If no option is given, "pascal-case" is assumed.

Option Attributes Example
"pascal-case" default PascalCase
"camel-case" camelCase
"caps-case" CAPS_CASE
"snake-case" snake_case

License

Copyright © 2017 Akim McMath. Licensed under the MIT License.