codemod-imports-sort
codemod-imports-sort copied to clipboard
Moves comment line
Nice tool! One issue: I use flow, so there's a /* @flow */
comment in the 1st line of source files.
Before:
/* @flow */
import calcDropTargetClass from "../common/calcDropTargetClass";
import classNames from "classnames";
import dropSourceInTarget from "../StandardShow/dropSourceInTarget";
import { DropTarget } from "react-dnd";
import React from "react";
import SearchTypes from "../../constants/SearchTypes";
After:
import classNames from "classnames";
import React from "react";
import { DropTarget } from "react-dnd";
import SearchTypes from "../../constants/SearchTypes";
/* @flow */
import calcDropTargetClass from "../common/calcDropTargetClass";
import dropSourceInTarget from "../StandardShow/dropSourceInTarget";
Looks like it's keeping comments above their following import, but moving the comment messes things up. Maybe special-case and keep /* flow */
at top?