Skip to content

Commit

Permalink
Add CI lint, husky fixing (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwilliams authored Dec 4, 2024
1 parent 62cc01a commit f9dd9f6
Show file tree
Hide file tree
Showing 7 changed files with 346 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ jobs:
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm run build

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- run: pnpm install
- run: pnpm run lint
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Built files
dist
*.tgz
.eslintcache

# Node packages
node_modules
Expand Down
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: ["dist", "eslint.config.mjs", "demo"],
},
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
{
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"changeset": "changeset",
"build": "rm -rf dist && tsc",
"lint": "eslint .",
"release": "pnpm run build && changeset publish"
"release": "pnpm run build && changeset publish",
"prepare": "husky install"
},
"files": [
"dist"
Expand Down Expand Up @@ -51,8 +52,13 @@
"eslint": "^9.15.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"husky": ">=7",
"lint-staged": ">=10",
"prettier": "^3.3.3",
"typescript": "^5.6.3",
"typescript-eslint": "^8.15.0"
},
"lint-staged": {
"*.{j,t}s": "eslint --cache --fix"
}
}
Loading

0 comments on commit f9dd9f6

Please sign in to comment.