Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-unused-variables autofix leaves empty lines #2898

Closed
pablonete opened this issue Jun 7, 2017 · 0 comments
Closed

no-unused-variables autofix leaves empty lines #2898

pablonete opened this issue Jun 7, 2017 · 0 comments

Comments

@pablonete
Copy link
Contributor

Bug Report

  • TSLint version: master
  • TypeScript version: latest
  • Running TSLint via: CLI

TypeScript code being linted

Issue is noticeable in rule tests. Code to fix:

// This import statement is unused and will be deleted along with this comment.
import {a5, a6} from "a";
import {a7} from "a";
import {a8, a9, a10} from "a";

Which results on this fix:

// This import statement is unused and will be deleted along with this comment.


import {a8} from "a";

Actual behavior

When autofix deletes the whole import sentence, it leaves an empty line.

Expected behavior

Remove the line break when the whole sentence is deleted, so expected fix should be:

// This import statement is unused and will be deleted along with this comment.
import {a8} from "a";
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants