amatiasq / vsc-sort-imports

Sort ES6 imports automatically.
ISC License
58 stars 24 forks source link

Sorting based on eslint rules #23

Closed strongui closed 6 years ago

strongui commented 6 years ago

I start with this in my file:


import { combineReducers } from 'redux';
import { reducer as formReducer } from 'redux-form';
import { routerReducer } from 'react-router-redux';

import appCoreData from './appCoreReducer';
import appPageData from './appPageReducer';
import formCache from './formCacheReducer';
import history from './historyReducer';
import swagger from './swaggerReducer';
import ui from './uiReducer';
import user from './userReducer';

And when I save the file I end up with this:


import appCoreData from './appCoreReducer';
import appPageData from './appPageReducer';
import { combineReducers } from 'redux';
import formCache from './formCacheReducer';
import { reducer as formReducer } from 'redux-form';
import history from './historyReducer';
import { routerReducer } from 'react-router-redux';
import swagger from './swaggerReducer';
import ui from './uiReducer';
import user from './userReducer';

Any way to keep the sort as my first example?

amatiasq commented 6 years ago

I need time to analyse the configuration you want and find a proper style, if you're in a hurry you can do it yourself by looking at the different styles here for example and at the README you will find how to use it.

strongui commented 6 years ago

@amatiasq That should work. Thanks!