mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
4fcdb0fea0
[Prettier][1] is an up-to date code formatter for JavaScript ecosystem. For settings we rely on [EditorConfig][2] for things like tab style and size (with added bonus that the code editor with an EditorConfig plugin does some automated code formatting on file save for you). Unfortunately, Prettier's Glob handling isn't great: 1. `*.{ts,js,json}` has no effect 2. Similarly, in a list of globs `*.ts,*.js,*.json` only the first glob has an effect, the rest are ignored. That's why the file looks the way it does. The only other setting we change is line width. [Lukas][3] suggested we use 100 instead of 80, because that's what Rustfmt is using. [1]: https://prettier.io [2]: https://editorconfig.org [3]: https://github.com/Veykril
19 lines
261 B
INI
19 lines
261 B
INI
# https://EditorConfig.org
|
|
root = true
|
|
|
|
[*]
|
|
charset = utf-8
|
|
trim_trailing_whitespace = true
|
|
end_of_line = lf
|
|
insert_final_newline = true
|
|
indent_style = space
|
|
|
|
[*.{rs,toml}]
|
|
indent_size = 4
|
|
|
|
[*.ts]
|
|
indent_size = 4
|
|
[*.js]
|
|
indent_size = 4
|
|
[*.json]
|
|
indent_size = 4
|