daidodo / format-imports-vscode

Format imports and exports for JavaScript and TypeScript in VS Code.
https://marketplace.visualstudio.com/items?itemName=dozerg.tsimportsorter
MIT License
62 stars 5 forks source link

Support ESLint object-curly-spacing rule for formatting #68

Closed cmlenz closed 2 years ago

cmlenz commented 2 years ago

I have ESLint set up to not have spaces inside curlies, using the object-curly-spacing rule as follows:

rules: {
  'object-curly-spacing': ['warn', 'never'],
}

Since version 7.4.13 the import sorter extension will reformat my imports but put the spaces inside the curlies. For whatever reason, this works fine in 7.4.10.

It would be nice if the object-curly-spacing rule was honored by the import sorter extension.

This was originally raised in #67

daidodo commented 2 years ago

Thanks for the feedback!

In short-term, you can set bracketSpacing before next release:

{
  "bracketSpacing": false
}
cmlenz commented 2 years ago

Thanks @daidodo , that works, even though for some reason that option is offered by the VSCode auto complete or the settings UI.

Also, a big thank you for this extension in general, it's such an important part of my coding workflow, but you only ever really notice when it's not doing its magic :)

daidodo commented 2 years ago

Yes, auto-completion is part of the plugin as well.

I've released v7.4.14 to address this issue. With it you can remove the above bracketSpacing config. Please tell me if you have further questions. Thanks very much!