Skip to content

Nate-Wilkins/eslint-plugin-jsort

Repository files navigation

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

Development

Written in Typescript. Workflows are defined in .envrc.sh.

Other Alternatives

Other Resources

Contributions

Author Estimated Hours
nate-wilkins

16.8 Hours

depfu[bot]

4.95 Hours

dependabot[bot]

2 Hours

About

Sort imports effortlessly

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •