eslint-plugin-jsort

1.1.3 • Public • Published

eslint-plugin-jsort

npm license status test coverage dependencies

ESLint plugin with rules to sort imports effortlessly.

$ npm install eslint-plugin-jsort

This rule sorts & formats import declaration with a lot of flexibility using eslint --fix.

JavaScript imports are frustrating and this tries to make them a bit easier to work with. Feel free to post any issues/suggestions you might have with the plugin on the issue tracker.

Capabilities

Supported Parsers

Installation

  1. Install ESLint:
$ npm i eslint --save-dev
  1. Install the plugin eslint-plugin-jsort:
$ npm install eslint-plugin-jsort --save-dev

Usage

  1. Add jsort to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
  "plugins": ["jsort"]
}
  1. Then configure the rules you want to use under the rules section.
{
  "rules": {
    "jsort/sort-imports": [
      "error",
      {
        /* `sort-imports` Additional Configuration */
      }
    ],
    "jsort/normalize-import-source": [
      "error",
      {
        /* `normalize-import-source` Additional Configuration */
      }
    ]
  }
}
  1. For "sort-imports Additional Configuration" see jsort/sort-imports docs.
  2. For "normalize-import-source Additional Configuration" see jsort/normalize-import-source docs

Available Rules

Other Alternatives

Other Resources

/eslint-plugin-jsort/

    Package Sidebar

    Install

    npm i eslint-plugin-jsort

    Weekly Downloads

    13

    Version

    1.1.3

    License

    Apache-2.0

    Unpacked Size

    254 kB

    Total Files

    39

    Last publish

    Collaborators

    • nate-wilkins