amatiasq / vsc-sort-imports

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

Sorting seems pretty broken #33

Closed thisissami closed 5 years ago

thisissami commented 5 years ago

Here is the imports at the top of my file:

import React from 'react';
import { Provider } from 'react-redux';
import { ThemeProvider } from 'emotion-theming';
import { createStore } from 'redux';
import styled from 'react-emotion';
import { BrowserRouter, Route, Switch } from 'react-router-dom';

import appReducer, { addBatch, addRoom } from './appReducer';
import { batchProps, storageRoomProps } from './batches/batchProps';
import Inventory from './inventory';
import MainHeader from './navigation/MainHeader';
import theme from '../theme';

after saving my file (with autosave + es-lint style set on sort-imports), I end up with the following:

import { BrowserRouter, Route, Switch } from 'react-router-dom';
import appReducer, { addBatch, addRoom } from './appReducer';
import { batchProps, storageRoomProps } from './batches/batchProps';

import Inventory from './inventory';
import MainHeader from './navigation/MainHeader';
import { Provider } from 'react-redux';
import React from 'react';
import { ThemeProvider } from 'emotion-theming';
import { createStore } from 'redux';
import styled from 'react-emotion';
import theme from '../theme';

this seems pretty broken. any thoughts on what might be causing this?

eddie-dunn commented 5 years ago

What's broken about it? You do know that with case-sensitive sorting, upper case comes before lower case, right?

amatiasq commented 5 years ago

@thisissami You probably want to use a different style, the default one is hard to understand but we can't change it for backwards compatibility.

https://github.com/amatiasq/vsc-sort-imports#use-a-different-style-or-parser