Skip to content

Commit

Permalink
chore: setup lefthook (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger authored Nov 18, 2023
1 parent 54a562a commit 1008f36
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 33 deletions.
5 changes: 5 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,jsx,tsx,json}"
run: biome check --apply {staged_files}
44 changes: 11 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,14 @@
"capabilities": {
"untrustedWorkspaces": {
"supported": "limited",
"restrictedConfigurations": [
"biome.lspBin"
]
"restrictedConfigurations": ["biome.lspBin"]
}
},
"contributes": {
"languages": [
{
"id": "biome_syntax_tree",
"extensions": [
".rast"
]
"extensions": [".rast"]
}
],
"grammars": [
Expand Down Expand Up @@ -82,32 +78,18 @@
"biome_lsp.trace.server": {
"type": "string",
"scope": "window",
"enum": [
"off",
"messages",
"verbose"
],
"enumDescriptions": [
"No traces",
"Error only",
"Full log"
],
"enum": ["off", "messages", "verbose"],
"enumDescriptions": ["No traces", "Error only", "Full log"],
"default": "off",
"description": "Traces the communication between VS Code and the language server."
},
"biome.lspBin": {
"type": [
"string",
"null"
],
"type": ["string", "null"],
"default": null,
"markdownDescription": "The biome lsp server executable. If the path is relative, the workspace folder will be used as base path"
},
"biome.rename": {
"type": [
"boolean",
"null"
],
"type": ["boolean", "null"],
"default": null,
"markdownDescription": "Enable/Disable Biome handling renames in the workspace. (Experimental)"
},
Expand All @@ -119,14 +101,8 @@
}
}
},
"categories": [
"Formatters",
"Linters"
],
"keywords": [
"Formatter",
"Linter"
],
"categories": ["Formatters", "Linters"],
"keywords": ["Formatter", "Linter"],
"license": "MIT",
"scripts": {
"compile": "esbuild src/main.ts --bundle --outfile=out/main.js --external:vscode --format=cjs --platform=node --target=node14",
Expand All @@ -138,7 +114,8 @@
"check": "biome check .",
"check:apply": "biome check . --apply-unsafe",
"pack:dev": "pnpm run compile && pnpm run package && pnpm run install-extension",
"tsc": "tsc"
"tsc": "tsc",
"prepare": "lefthook install"
},
"devDependencies": {
"@biomejs/biome": "^1.2.2",
Expand All @@ -148,6 +125,7 @@
"@types/vscode": "^1.80.0",
"@vscode/vsce": "^2.20.1",
"esbuild": "^0.19.2",
"lefthook": "^1.5.2",
"typescript": "^5.1.6"
},
"dependencies": {
Expand Down
82 changes: 82 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1008f36

Please sign in to comment.