Skip to content

AlexJuarez/eslint-plugin-import-order-autofix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-import-order-autofix

This plugin is an extension of the lovely and more stable eslint-plugin-import to enable --fix for import/order.

With this change import order set by "groups" and "newlines-between" will when run with --fix attempt to reorder and properly newline your imports.

Setup

npm install --save eslint-plugin-import-order-autofix

Configuration

In your .eslintrc add "import-order-autofix" to your plugins, and add "import-order-autofix/order" to your rules. For additional information see the docs order

Examples

const fs = require('fs-extra');
const get = require('lodash/get');
const path = require('path');
const uniq = require('lodash/uniq');
const generateDemo = require('./generateDemo');

const {
  extensionize,
  stripBasename
} = require('./utils');

will be turned into

const path = require('path');

const fs = require('fs-extra');
const get = require('lodash/get');
const uniq = require('lodash/uniq');

const generateDemo = require('./generateDemo');
const {
  extensionize,
  stripBasename
} = require('./utils');

About

An extension of eslint-pluigin-import that adds the fix option

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published