build: npm and Deno workspace with core's gates
Same lint, format and complexity gates as core, plus a lint rule that keeps core a types-only import in plugin sources. Runtime suites are chosen from each package's engines, so declaring a runtime is what puts a package under its test. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
10 files changed
+3103
No files matched your search
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
# Pre-commit gate. Auto-fixes formatting and lint on staged TypeScript, re-stages it, then enforces lint
|
||||
# and the complexity gate. Enabled by the `prepare` script (`git config core.hooksPath .githooks`).
|
||||
set -e
|
||||
|
||||
staged=$(git diff --cached --name-only --diff-filter=ACM -- 'packages/*.ts' 'test/*.ts')
|
||||
if [ -n "$staged" ]; then
|
||||
echo "$staged" | xargs npx prettier --write
|
||||
echo "$staged" | xargs npx eslint --fix
|
||||
echo "$staged" | xargs git add
|
||||
fi
|
||||
|
||||
npm run lint
|
||||
npm run complexity:check
|
||||
Reference in new issue
Block a user