Coder Social home page Coder Social logo

renke / atom-import-sort Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 5.0 168 KB

[PLACEHOLDER] Sort ES2015 (aka ES6) imports. Manually – or automatically when you save your JavaSript or TypeScript files.

Home Page: https://github.com/renke/import-sort

TypeScript 48.59% JavaScript 51.41%

atom-import-sort's People

Contributors

renke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

atom-import-sort's Issues

Config directly from Atom

Hi,

Why not adding the possibility to change to default sorting mode directly front Atom config?

I don't want the atom-import-sort config in my codebase

does not work with linter-eslint

https://atom.io/packages/linter-eslint provides helpful lint errors such as:
screen shot 2016-01-28 at 2 00 22 pm

with atom-import-sort disabled I get helpful lint errors such as:
screen shot 2016-01-28 at 2 01 32 pm

but with atom-import-sort enabled the lines are no longer visible and just looks like:
screen shot 2016-01-28 at 2 02 25 pm

I have sort on save turned on. It appears to work until I save and then the lint error lines go away.

Thanks! Great and helpful package.

Inline comments are placed after the import blocks

Sometimes to avoid some lint errors it's needed to place an inline comment after the import, for example:

import SomeThing from './components/some/SomeThing'; //eslint-disable-inline import/no-named-as-default
import someOtherThing from './someOtherThing';

After applying the sort, it becomes:

import SomeThing from './components/some/SomeThing'; 
import someOtherThing from './someOtherThing';

//eslint-disable-inline import/no-named-as-default

Making it not possible to disable the lint.

TypeScript support

We converted our project from Babel/ES6 to TypeScript, but we still use ES6-style imports. It would be great if this plugin could sort TypeScript imports too.

keyboard shortcut doesn't work

(Apologies. I originally posted this issue in the wrong repo; moving renke/import-sort#105 here.)

Atom v1.41.0
atom-import-sort v6.0.0

The "Sort on save" option works as expected, but I can't seem to be able to use the keyboard shortcut to activate the import-sort:sort command. Defining a custom keyboard shortcut in my keymap.cson also doesn't trigger sorting.

UPDATE

I was able to get this working by modifying the package source code locally. This selector seems problematic:

https://github.com/renke/atom-import-sort/blob/master/src/index.ts#L38

'atom-text-editor[data-grammar~="source"][data-grammar~="js"],atom-text-editor[data-grammar~="source"][data-grammar~="ts"]',

I changed the selector to just 'atom-text-editor', added a custom keyboard shortcut, and it worked.

// ~/.atom/packages/atom-import-sort/lib/index.js
atom.commands.add(
  'atom-text-editor', 
  "import-sort:sort", 
  () => this.sortCurrentEditor()
);
'atom-text-editor':
  'ctrl-alt-i': 'import-sort:sort'

Support auto padding for imports

It would be nice to add padding for the imports

Before

import { DashboardComponent } from './dashboard.component';
import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpModule }    from '@angular/http';
import { FormsModule }    from '@angular/forms';

After

import { DashboardComponent }   from    './dashboard.component';
import { NgModule }             from    '@angular/core';
import { BrowserModule }        from    '@angular/platform-browser';
import { HttpModule }           from    '@angular/http';
import { FormsModule }          from    '@angular/forms';

Fails on JSX files

It looks like the parser is trying to parse the entire file before sorting the import section at the top, and it fails on unrecognized syntax. It'd be nice if it could stop parsing at the end of the imports to avoid getting confused.

Error: 'pipelineOperator'

I am a new user and just installed the plugin. Upon first run go error:

Failed to sort imports: Error: 'pipelineOperator' requires 'proposal' option whose value should be one of: minimal

screen shot 2018-07-17 at 11 43 36 am

Making Deprecated Call

I'm seeing this warning in Atom with v6.0:

Argument to path.dirname must be a string
Object.dirname - /Applications/Atom.app/Contents/Resources/app.asar/src/electron-shims.js:9:10
module.exports.moduleId - /Users/chadhamre/.atom/packages/atom-import-sort/node_modules/eslint/node_modules/import-fresh/index.js:11:36
loadJSConfigFile - /Users/chadhamre/.atom/packages/atom-import-sort/node_modules/eslint/lib/config/config-file.js:159:16
loadConfigFile - /Users/chadhamre/.atom/packages/atom-import-sort/node_modules/eslint/lib/config/config-file.js:214:22
loadFromDisk - /Users/chadhamre/.atom/packages/atom-import-sort/node_modules/eslint/lib/config/config-file.js:523:18
Object.load - /Users/chadhamre/.atom/packages/atom-import-sort/node_modules/eslint/lib/config/config-file.js:587:20

On selection sort

Thanks for working on this useful plugin. Do you think there is value on adding on selection sort?

Sometimes I like to have few core dependencies on top of my JS file and only sort a given group of imports.

When I selected the group of imports and pressed control + alt + o I was expecting the sorting to affect only these elements.

I believe this should not be difficult to add to your plugin. If you agree with this change I'm willing to write a PR for that.

Support webpack aliases

Yo! Thank you for making this :D

We use webpack aliases in our project, so

import MyComponent from 'components/myfolder/MyComponent' instead of
import MyComponent from '../myfolder/MyComponent'

Would be nice if we could configure them to go in the "local" list :)

Run project locally

Hi,

I wanted to test your work and add a functionnality to sort correctly when importing packages with webpack (like ~components/Something.js)

but I clone it and npm i send those errors

node_modules/@types/atom/index.d.ts(191,22): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(248,50): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(276,52): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(276,73): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(278,52): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(278,71): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(280,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(280,84): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(280,104): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(281,75): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(281,95): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(282,92): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(282,112): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(284,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(284,95): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(285,86): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(286,103): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(288,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(288,112): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(289,103): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(290,120): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(292,52): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(292,73): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(294,52): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(294,71): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(296,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(296,84): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(296,104): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(297,75): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(297,95): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(298,92): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(298,112): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(300,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(300,95): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(301,86): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(302,103): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(304,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(304,112): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(305,103): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(306,120): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(308,51): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(308,87): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(310,51): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(310,85): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(312,59): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(312,83): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(312,118): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(313,74): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(313,109): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(314,91): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(314,126): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(316,59): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(316,109): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(317,100): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(318,117): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(320,59): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(320,126): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(321,117): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(322,134): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(324,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(324,94): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(325,85): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(326,102): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(328,64): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(344,33): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(348,36): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(349,36): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(350,48): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(351,48): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(402,34): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(403,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(405,34): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(438,68): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(439,66): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(440,66): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(441,62): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(442,65): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(443,54): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(444,54): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(464,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(465,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(466,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(467,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(473,32): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(474,42): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(478,32): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(479,42): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(490,49): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(517,28): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(602,21): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(665,26): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(670,37): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(672,60): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(681,80): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(682,80): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(683,57): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(684,57): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(685,66): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(698,52): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(699,30): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(700,35): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(711,27): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(712,35): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(713,36): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(714,46): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(715,39): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(720,38): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(782,47): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(783,40): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(786,40): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(787,39): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(788,39): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(789,40): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(791,41): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(792,41): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(793,47): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(822,46): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(840,26): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(1046,18): error TS2503: Cannot find namespace 'PathWatcher'.
node_modules/@types/atom/index.d.ts(1047,19): error TS2503: Cannot find namespace 'PathWatcher'.
node_modules/@types/atom/index.d.ts(1057,22): error TS2503: Cannot find namespace 'PathWatcher'.
node_modules/@types/atom/index.d.ts(1063,27): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1065,49): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1066,49): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1067,55): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1068,34): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1069,55): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1070,61): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1071,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1072,38): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/atom/index.d.ts(1453,36): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1454,36): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1455,36): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1456,36): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1468,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(1470,31): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/atom/index.d.ts(1473,38): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1475,38): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1477,38): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1479,38): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPoint'.
node_modules/@types/atom/index.d.ts(1531,23): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IPointStatic'.
node_modules/@types/atom/index.d.ts(1532,23): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRangeStatic'.
node_modules/@types/atom/index.d.ts(1603,52): error TS2694: Namespace 'global.TextBuffer' has no exported member 'IRange'.
node_modules/@types/status-bar/index.d.ts(8,23): error TS2688: Cannot find type definition file for 'text-buffer/v0'.
node_modules/@types/status-bar/index.d.ts(26,32): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.
node_modules/@types/status-bar/index.d.ts(28,34): error TS2694: Namespace 'global.TextBuffer' has no exported member 'ITextBuffer'.

Thanks for your answer

sort rule changed after update

Here's what's the imports looks before:

image

After update, the imports become this (after save):

image

Don't know what happened.

Sort on save turned on.

Wether have config in package.json have not effect on this issue.

Sorting seems to not follow the GIF demo

The GIF demo is showing exactly what I'd like to have, but when I'm running the package using CTRL + ALT + o, I don't have the excepted result.

Here is an example file before sorting :

import 'core-js'

import { AppRegistry } from 'react-native'
import App from './src/App'
import { name as appName } from './app.json'

AppRegistry.registerComponent(appName, () => App);

And then after sorting :

import 'core-js'

import App from './src/App'
import { AppRegistry } from 'react-native'
import { name as appName } from './app.json'

AppRegistry.registerComponent(appName, () => App);

The local project import statement import App from './src/App' is coming before the external library import import { AppRegistry } from 'react-native' which is wrong as stated by eslint.

CTRL + ALT + o shouldn't have change the order of imports, it could have added an empty line between the external and local libraries imports.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.