aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-08-01 21:32:11 -0700
committerJade Lovelace <lix@jade.fyi>2024-08-04 20:41:19 -0700
commit700762d8b24350bbe537258167244ec9c84fcae3 (patch)
treedcb865b7db415c65e93439f8f306b6288a389ea9
parent0f998056fabe314fb4bde296c0970805e086307e (diff)
manual: fix a syntax error in redirects.js that made it not do anything
lol lmao Let's put in a syntax checker in CI so we do not have to deal with this nonsense ever again. Change-Id: I0fe875e0cfc59ab1783087762e5bb07e09ded105
-rw-r--r--doc/manual/redirects.js2
-rw-r--r--flake.nix18
2 files changed, 19 insertions, 1 deletions
diff --git a/doc/manual/redirects.js b/doc/manual/redirects.js
index f270d31a4..7a61de643 100644
--- a/doc/manual/redirects.js
+++ b/doc/manual/redirects.js
@@ -345,7 +345,7 @@ const redirects = {
"linux": "uninstall.html#linux",
"macos": "uninstall.html#macos",
"uninstalling": "uninstall.html",
- }
+ },
"contributing/hacking.html": {
"nix-with-flakes": "#building-nix-with-flakes",
"classic-nix": "#building-nix",
diff --git a/flake.nix b/flake.nix
index 14fdf4147..64d16b588 100644
--- a/flake.nix
+++ b/flake.nix
@@ -292,6 +292,24 @@
werror = true;
};
+ # Although this might be nicer to do with pre-commit, that would
+ # require adding 12MB of nodejs to the dev shell, whereas building it
+ # in CI with Nix avoids that at a cost of slower feedback on rarely
+ # touched files.
+ jsSyntaxCheck =
+ let
+ nixpkgs = nixpkgsFor.x86_64-linux.native;
+ inherit (nixpkgs) pkgs;
+ docSources = lib.fileset.toSource {
+ root = ./doc;
+ fileset = lib.fileset.fileFilter (f: f.hasExt "js") ./doc;
+ };
+ in
+ pkgs.runCommand "js-syntax-check" { } ''
+ find ${docSources} -type f -print -exec ${pkgs.nodejs-slim}/bin/node --check '{}' ';'
+ touch $out
+ '';
+
# Make sure that nix-env still produces the exact same result
# on a particular version of Nixpkgs.
evalNixpkgs =