feat: Add editorconfig

If prettier is called via treefmt-nix it does not source .editorconfig files
per default, hence the integration is enabled explicitly.
This commit is contained in:
dfh 2024-08-02 20:11:16 +00:00
parent 2f18806425
commit 26dbc30f4c
2 changed files with 27 additions and 2 deletions

17
.editorconfig Normal file
View file

@ -0,0 +1,17 @@
root = true
[*]
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
indent_style = tabs
[*.nix]
indent_size = 2
indent_style = space
[*.md]
indent_size = 2
trim_trailing_whitespace = false

View file

@ -3,7 +3,10 @@ _: {
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
# Files not to format. # Files not to format.
settings.global.excludes = [ "LICENSE" ]; settings.global.excludes = [
".editorconfig"
"LICENSE"
];
# nix # nix
programs.nixfmt.enable = true; # As of 2024-07-30 this is nixfmt-rfc-style. programs.nixfmt.enable = true; # As of 2024-07-30 this is nixfmt-rfc-style.
@ -11,5 +14,10 @@ _: {
programs.deadnix.enable = true; programs.deadnix.enable = true;
# markdown # markdown
programs.prettier.enable = true; programs.prettier = {
enable = true;
settings = {
editorconfig = true;
};
};
} }