Do we use eslint sort-imports?

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:

import {a, b} from c;

in my plugin code, vscode will tidy it as :

import {
} from c;

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

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 to handle our formatting. The config package is @elastic/eslint-config-kibana and you can find the source here. I believe you'll have that by default if you're using the plugin generator (which you can find here). 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.

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