# Do we use eslint sort-imports?

**URL:** <https://discuss.elastic.co/t/do-we-use-eslint-sort-imports/145629>\
**Category:** Kibana\
**Created:** [August 23, 2018, 2:05am UTC](https://discuss.elastic.co/t/do-we-use-eslint-sort-imports/145629 "2018-08-23T02:05:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![whoami](https://avatars.discourse-cdn.com/v4/letter/w/a9a28c/32.png) [@whoami](https://discuss.elastic.co/u/whoami)\
**Post date:** [August 23, 2018, 2:05am UTC](https://discuss.elastic.co/t/do-we-use-eslint-sort-imports/145629/1 "2018-08-23T02:05:15Z")

</div>

> **[sort-imports - Rules](https://eslint.org/docs/rules/sort-imports)**
>
> A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.

doesn't kibana use sort-imports? why I tidy my plugin code by vscode, the import statement is different from kibana source code, for example:

in kibana source code:

```auto
import {a, b} from c;

```

in my plugin code, vscode will tidy it as :

```auto
import {
    a,
    b
} from c;

```

I want my plugin keep the same style with kibana source, what should I do

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [August 23, 2018, 3:05pm UTC](https://discuss.elastic.co/t/do-we-use-eslint-sort-imports/145629/2 "2018-08-23T15:05:44Z")

</div>

You probably don't have any kind of custom formatting set up in your editor and that's the default behavior, or maybe you have some custom rule that is giving you that result.

We have a custom eslint config we use with [prettier](https://github.com/prettier/prettier) to handle our formatting. The config package is `@elastic/eslint-config-kibana` and you can find the source [here](https://github.com/elastic/kibana/tree/master/packages/eslint-config-kibana). I believe you'll have that by default if you're using the plugin generator (which you can find [here](https://github.com/elastic/kibana/tree/master/packages/kbn-plugin-generator)). Once you have that, and have configured eslint to use prettier, you just need to configure VScode to use eslint for handle the formatting. There's a bunch of docs and instructions online for how to do all those.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 20, 2018, 3:05pm UTC](https://discuss.elastic.co/t/do-we-use-eslint-sort-imports/145629/3 "2018-09-20T15:05:52Z")

</div>

Closed on September 20, 2018, 3:05pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
