From 31eebd8dab9cef878abe4ef176c88caf68a41dbb Mon Sep 17 00:00:00 2001 From: Arnie Date: Fri, 25 Oct 2024 23:47:55 +0200 Subject: [PATCH] Implement shared eslint config through devenv --- .gitignore | 1 + flake.nix | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 8e0ed5c..bc74af3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ /app/frontend/.pnp /app/frontend/.pnp.js /app/frontend/.dependency-graph +/app/frontend/eslint.shared.mjs # testing /app/frontend/coverage diff --git a/flake.nix b/flake.nix index 5bcbfba..764679d 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,10 @@ inherit version; pname = "cv"; src = ./app/frontend; + preBuild = '' + cp ${nix.lib.eslint-config-file} ./eslint.shared.mjs + npm run check + ''; npmInstallFlags = "--no-audit --no-progress --no-fund"; npmDepsHash = "sha256-p4rTpy0t8aajbubvtF1TA83/FFqvfKEOPBb5T0ZRfQY="; npmPackFlags = [ "--ignore-scripts" ]; @@ -82,6 +86,11 @@ pkgs.go pkgs.nodejs_22 ]; + + enterShell = '' + cp ${nix.lib.eslint-config-file} ./app/frontend/eslint.shared.mjs + ''; + scripts = { # Override golangci-lint for vscode, because the extension incorrectly assumes usage of global binaries is preferred golangci-lint = {