-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk): biome setup for lint and formatting and precommit hook for…
… SDK
- Loading branch information
Showing
6 changed files
with
1,053 additions
and
890 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
# get dir | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
|
||
# nav to sdk dir | ||
SDK_DIR="$SCRIPT_DIR/../sdk" | ||
|
||
# when running pre-commit, files are passed as args | ||
# when running git hook, find ourselves | ||
if [ $# -eq 0 ]; then | ||
TS_FILES=$(git diff --cached --name-only --diff-filter=ACMR | grep "^sdk.*\.\(ts\|tsx\)$" || true) | ||
else | ||
TS_FILES="$@" | ||
fi | ||
|
||
if [ -n "$TS_FILES" ]; then | ||
echo "Running SDK checks..." | ||
cd "$SDK_DIR" | ||
|
||
# clean + build | ||
echo "Building SDK..." | ||
pnpm build:clean | ||
|
||
# precommit checks (Biome) | ||
echo "Running SDK checks..." | ||
pnpm precommit | ||
|
||
echo "SDK checks completed..." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": false | ||
}, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["dist", "tsconfig.json", "tsconfig.*.json"] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"formatWithErrors": false, | ||
"indentWidth": 2, | ||
"lineWidth": 80 | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "double", | ||
"trailingCommas": "all", | ||
"semicolons": "asNeeded" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.