@mcmath/tslint-rules
v1.1.0
Published
Custom rules for TSLint
Downloads
9,009
Maintainers
Readme
@mcmath/tslint-rules
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.