1.2.0 • Published 2 years ago

eslint-plugin-better-align v1.2.0

Weekly downloads
-
License
MPL-2.0
Repository
github
Last release
2 years ago

eslint-plugin-better-align

eslint-plugin-better-align/import-align

Before

import a from "a";
import bb from "b";
import ccc from "c";
import    "d";
import {
    xxx,
    yyy,
    zzz,
}    from "e";

After

import a   from "a";
import bb  from "b";
import ccc from "c";
import "d"; // Redundent spacing in from side effect import statement are stripped for now.
import {
    xxx,
    yyy,
    zzz,
}    from "e";  // Multiline import statement are ignored for now.

Usage:

  1. Install the plugin
yarn add -D eslint-plugin-better-align
  1. In your eslint config file, adding:
...
"plugins": [
    "better-align",
],
"rules": {
    "better-align/import-align": [2, "always"],
},
...