Custom rule for TSLint to enforce blank lines between class methods - achieves a similar thing to lines-between-class-members in ESLint
npm install tslint-lines-between-class-members
Custom rule for TSLint to enforce blank lines between class methods - achieves a similar thing to lines-between-class-members in ESLint
bash
yarn
yarn add --dev tslint-lines-between-class-membersnpm
npm install --save-dev tslint-lines-between-class-members
`Configuration
Update your tslint.json config file, adding the new rules directory and the new rule
You can choose to specify the exact number of lines you want between methods, or leave it to default to just checking there is at least 1`json
{
"rulesDirectory": [
"node_modules/tslint-lines-between-class-members"
],
"rules": {
"lines-between-class-members": true,
}
}
`$3
At least one line:
`json
"lines-between-class-members": true
`Exactly one line:
`json
"lines-between-class-members": [true, 1]
`Exactly twenty two lines:
`json
"lines-between-class-members": [true, 22]
``