forked from tangled.org/core
this repo has no description

add prettier configuration

This also removes the Zed Prettier configuration, because AFAICT, it
never actually worked, and will not work with how we install Prettier
now. :(

Signed-off-by: Winter <winter@winter.cafe>

+13
.prettierignore
···
···
+
flake.lock
+
+
# for now, we don't want these formatted, but let's consider it in the future?
+
*.json
+
*.md
+
*.yml
+
*.yaml
+
*.jsonc
+
*.json
+
+
# causes Go template plugin errors: https://github.com/NiklasPor/prettier-plugin-go-template/issues/120
+
appview/pages/templates/layouts/repobase.html
+
appview/pages/templates/repo/tags.html
+12
.prettierrc.json
···
···
+
{
+
"overrides": [
+
{
+
"files": ["*.html"],
+
"options": {
+
"parser": "go-template"
+
}
+
}
+
],
+
"bracketSameLine": true,
+
"htmlWhitespaceSensitivity": "ignore"
+
}
-16
.zed/settings.json
···
-
// Folder-specific settings
-
//
-
// For a full list of overridable settings, and general information on folder-specific settings,
-
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
-
{
-
"languages": {
-
"HTML": {
-
"prettier": {
-
"format_on_save": false,
-
"allowed": true,
-
"parser": "go-template",
-
"plugins": ["prettier-plugin-go-template"]
-
}
-
}
-
}
-
}
···
+6
flake.nix
···
pkgsCross-gnu64-pkgsStatic-knot = crossPackages.knot;
pkgsCross-gnu64-pkgsStatic-knot-unwrapped = crossPackages.knot-unwrapped;
pkgsCross-gnu64-pkgsStatic-spindle = crossPackages.spindle;
});
defaultPackage = forAllSystems (system: self.packages.${system}.appview);
formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra);
···
pkgs.redis
pkgs.coreutils # for those of us who are on systems that use busybox (alpine)
packages'.lexgen
];
shellHook = ''
mkdir -p appview/pages/static
···
pkgsCross-gnu64-pkgsStatic-knot = crossPackages.knot;
pkgsCross-gnu64-pkgsStatic-knot-unwrapped = crossPackages.knot-unwrapped;
pkgsCross-gnu64-pkgsStatic-spindle = crossPackages.spindle;
+
+
prettier-wrapper = pkgs.runCommandLocal "prettier-wrapper" {nativeBuildInputs = [pkgs.makeWrapper];} ''
+
mkdir -p "$out/bin"
+
makeWrapper ${pkgs.prettier}/bin/prettier "$out/bin/prettier" --add-flags "--plugin=${pkgs.prettier-plugin-go-template}/lib/node_modules/prettier-plugin-go-template/lib/index.js"
+
'';
});
defaultPackage = forAllSystems (system: self.packages.${system}.appview);
formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra);
···
pkgs.redis
pkgs.coreutils # for those of us who are on systems that use busybox (alpine)
packages'.lexgen
+
packages'.prettier-wrapper
];
shellHook = ''
mkdir -p appview/pages/static