Skip to content

If no-consecutive-blank-lines is set to false or [true, <n>] in tslint.json blank lines are always collapsed to one #129

Open
@InExtremaRes

Description

@InExtremaRes

Having this file (with 4 empty/blank lines):

const x = 'hello';




console.log(x);

and tslint.json:

{
  "rules": {
    "no-consecutive-blank-lines": false
  }
}

Running tsfmt -r replaces the file and removes consecutive blank lines as this:

const x = 'hello';

console.log(x);

Expected behavior

I expect the output file sill has consecutive blank lines (as the original) since no-consecutive-blank-lines is explicitly set to false. If tslint.json contains "no-consecutive-blank-lines": [true, 2] I would expect the output file gets removed some blank lines but keeps two of them. Instead every time no-consecutive-blank-lines is set to something all blank lines are collapsed to one.

If I run npx tsfmt --no-tslint -r then blank lines are not removed. The same if I take off the option of tslint.json at all.

By the way, why that option needs to be addressed here in a postprocessing? Isn't that on the tslint realm? Users can just run tslint --fix and let it take care of this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions