svelte-intellij icon indicating copy to clipboard operation
svelte-intellij copied to clipboard

EditorConfig options specific to IntelliJ are not applied in svelte components

Open fehnomenal opened this issue 4 years ago • 0 comments

I tried to overwrite IntelliJ's default formatting options with a .editorconfig file. It works for the default options (like indent_size) but not for IntelliJ specific one (prefixed with ij_).

A little example:

# .editorconfig
root = true

[*]
indent_size = 2
indent_style = space


[{*.js, *.svelte}]
indent_size = 4

ij_javascript_force_semicolon_style = true
ij_javascript_use_semicolon_after_statement = true

ij_javascript_force_quote_style = true
ij_javascript_use_double_quotes = false
ij_javascript_spaces_within_imports = true
// util.js
export const utilityFunction = () => 34;
<!-- Component.js -->
<script>
    import {utilityFunction} from "util";

    const abc = utilityFunction()
</script>

<span>
    {abc}
</span>

I would expect the following changes after formatting the component file:

--- a/JsComponent.svelte
+++ b/JsComponent.svelte
@@ -1,7 +1,7 @@
 <script>
-    import {utilityFunction} from "util";
+    import { utilityFunction } from 'util';
 
-    const abc = utilityFunction()
+    const abc = utilityFunction();
 </script>
 
 <span>

These changes happen after configuring the code style in IntelliJ for JavaScript. So it seems that these additional options are ignored in the custom svelte HTML language.

fehnomenal avatar Nov 28 '20 11:11 fehnomenal