Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_style = tab

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As currently we have YAML format for template issues that would be broken by a tab-indenting editor. It must use spaces, not tabs. The [*] block sets indent_style = tab for every file, but YAML syntax forbids tab indentation. Prettier already emits spaces for YAML regardless of useTabs, so the .editorconfig should mirror that with an override.

You might consider putting it at the end:

# YAML disallows tab indentation; Prettier emits spaces here too
[*.{yml,yaml}]
indent_style = space
indent_size = 2

indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
trim_trailing_whitespace = true
trim_trailing_whitespace = true
max_line_length = 120

It will mirror Prettier's printWidth.


[*.md]
trim_trailing_whitespace = false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed that package-lock.json has been reformatted. It is generated and owned by npm, which always writes it as 2-space JSON, therefore should not be reformatted.
The .editorconfig should match what npm (and .prettierignore) already do. You might want to consider adding something like this:

[package-lock.json]
indent_style = space
indent_size = 2

Loading