Detalhes do pacote

tslint-line-before-constructor

toxity6ISC0.5.1

Custom rule for TSLint to assure that constructor has blank line before declaration

tslint, custom-tslint-rule

readme (leia-me)

tslint-line-before-constructor

npm version CircleCI

Custom rule for TSLint to assure that constructor has blank line before declaration

Install

npm install --save-dev tslint-line-before-constructor

Configuration

Update tslint.json file and add new rules directory with new rule itself

{
    "rulesDirectory": [
      "tslint-line-before-constructor"
    ],
    "rules": {
      "tslint-line-before-constructor": true
    }
}

Example

// Bad
class Name {
    constructor() {}
}

// Good
class Name {

    constructor() {}

    public method(): void { }

    ...
}