Skip to content

Commit

Permalink
husky+lintstaged -> lefthook
Browse files Browse the repository at this point in the history
  • Loading branch information
r4ai committed Apr 9, 2024
1 parent 40651ca commit 5c3d8fc
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 38 deletions.
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

6 changes: 0 additions & 6 deletions .lintstagedrc.cjs

This file was deleted.

Binary file modified bun.lockb
Binary file not shown.
10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/lefthook.json

pre-commit:
parallel: true
commands:
biome:
glob: "*.{js,cjs,mjs,ts,jsx,tsx}"
run: |
bunx @biomejs/biome check --apply
git add {staged_files}
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,18 @@
"test": "vitest",
"check": "bunx @biomejs/biome check --apply .",
"build": "rm -rf dist && bun run ./build.ts",
"prepare": "husky install"
"prepack": "lefthook install"
},
"workspaces": [
"templates/*"
],
"devDependencies": {
"@biomejs/biome": "1.3.3",
"@biomejs/biome": "^1.6.4",
"@types/bun": "^1.0.12",
"bun-npm-package": "workspace:*",
"bun-types": "latest",
"husky": "^8.0.0",
"lint-staged": "^15.1.0",
"turbo": "^1.10.16",
"typescript": "^5.0.0",
"vitest": "^0.34.6"
},
"dependencies": {
"@inquirer/prompts": "^3.3.0"
}
"dependencies": {}
}
4 changes: 0 additions & 4 deletions templates/bun-npm-package/.husky/pre-commit

This file was deleted.

6 changes: 0 additions & 6 deletions templates/bun-npm-package/.lintstagedrc.cjs

This file was deleted.

Binary file removed templates/bun-npm-package/bun.lockb
Binary file not shown.
10 changes: 10 additions & 0 deletions templates/bun-npm-package/lefhook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/lefthook.json

pre-commit:
parallel: true
commands:
biome:
glob: "*.{js,cjs,mjs,ts,jsx,tsx}"
run: |
bunx @biomejs/biome check --apply
git add {staged_files}
11 changes: 5 additions & 6 deletions templates/bun-npm-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,19 @@
"build:esm": "tsc -p tsconfig.esm.json",
"prepublishOnly": "bun run build",
"check": "bunx @biomejs/biome check --apply .",
"prepare": "husky install"
"prepack": "lefthook install"
},
"peerDependencies": {},
"dependencies": {},
"devDependencies": {
"@biomejs/biome": "1.3.3",
"@biomejs/biome": "^1.6.4",
"@qnighy/dedent": "^0.1.1",
"bun-plugin-dts": "^0.2.1",
"bun-types": "^1.0.7",
"@types/bun": "^1.0.12",
"concurrently": "^8.2.2",
"husky": "^8.0.0",
"lint-staged": "^15.0.2",
"rimraf": "^5.0.5",
"typescript": "^5.0.0",
"vitest": "^0.34.6"
"vitest": "^0.34.6",
"lefthook": "^1.6.9"
}
}
2 changes: 1 addition & 1 deletion templates/bun-npm-package/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"jsx": "react-jsx",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"types": ["bun-types"]
"types": ["@types/bun"]
},
"include": ["src/**/*", "tests/**/*"]
}
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"allowJs": true,
"types": [
"bun-types" // add Bun global
]
"types": ["@types/bun"]
}
}

0 comments on commit 5c3d8fc

Please sign in to comment.