Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(general): added linting/formatting configurations #5

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "@commitlint/cz-commitlint"
}
3 changes: 3 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pnpm exec commitlint --edit "$1"
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

pnpm exec lint-staged
24 changes: 24 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# $2 contains the source of the commit message.
# It can be message, template, merge, squash, or commit (for git commit --amend)
if [ "$2" = "commit" ]; then
echo "Skipping prepare-commit-msg hook due to amend."
exit 0
fi

# Testing if message already present
if [ "$2" = "message" ]; then
if [ -n "$1" ]; then
echo "Skipping prepare-commit-msg: message set to \"$(cat "$1")\" "
exit 0
fi
fi

# If we're in the middle of an interactive rebase, GIT_SEQUENCE_EDITOR will be set.
# We'll skip the hook in this case as well.
if [ -n "$GIT_SEQUENCE_EDITOR" ]; then
echo "Skipping prepare-commit-msg hook due to rebase."
exit 0
fi

exec < /dev/tty && pnpm exec cz --hook || true
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{json,ts,js,mjs,mts}": ["pnpm exec biome ci"]
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "biomejs.biome",
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
27 changes: 27 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
"organizeImports": {
"enabled": false
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"indentWidth": 2,
"indentStyle": "space"
},
"javascript": {
"formatter": {
"semicolons": "asNeeded",
"trailingComma": "es5"
}
}
}
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] }
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
preset: "ts-jest",
testEnvironment: "node",
}
63 changes: 33 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
{
"name": "@formula-monks/kurt",
"description": "A wrapper for AI SDKs, for building LLM-agnostic structured AI applications",
"license": "MIT",
"version": "1.0.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"test": "jest",
"build": "tsc",
"prepack": "pnpm run build"
},
"prettier": {
"semi": false
},
"dependencies": {
"@google-cloud/vertexai": "1.1.0",
"openai": "^4.40.0",
"zod": "^3.23.5",
"zod-to-json-schema": "^3.23.0"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
"type-fest": "^4.18.1",
"typescript": "^5.4.5"
}
"name": "@formula-monks/kurt",
"description": "A wrapper for AI SDKs, for building LLM-agnostic structured AI applications",
"license": "MIT",
"version": "1.0.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": ["dist"],
"scripts": {
"test": "jest",
"build": "tsc",
"prepack": "pnpm run build",
"prepare": "husky"
},
"dependencies": {
"@google-cloud/vertexai": "1.1.0",
"openai": "^4.40.0",
"zod": "^3.23.5",
"zod-to-json-schema": "^3.23.0"
},
"devDependencies": {
"@biomejs/biome": "^1.7.3",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/cz-commitlint": "^19.2.0",
"@jest/globals": "^29.7.0",
"commitizen": "^4.3.0",
"husky": "^9.0.11",
"jest": "^29.7.0",
"lint-staged": "^15.2.2",
"ts-jest": "^29.1.2",
"type-fest": "^4.18.1",
"typescript": "^5.4.5"
}
}
Loading
Loading