Sorting when only a single import statement is detected would cause that statement to be duplicated. This is due to how the line number for import statements is calculated.
This PR fixes that.
Previously:
// this is an import
import 'something.dart';
would become this after sorting:
// this is an import
import 'something.dart';
import 'something.dart'; // <- Duplicated!
Now:
Sorting doesn't even run when only one import statement is detected.
Description
Sorting when only a single import statement is detected would cause that statement to be duplicated. This is due to how the line number for import statements is calculated.
This PR fixes that.
Previously:
would become this after sorting:
Now:
Sorting doesn't even run when only one import statement is detected.
Solves #53