diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..99317ac --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn lint-staged +yarn build +yarn build:vite diff --git a/package.json b/package.json index 059106c..f53369b 100644 --- a/package.json +++ b/package.json @@ -19,16 +19,24 @@ "format": "npm run format:prettier", "format:prettier": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --write" }, + "lint-staged": { + "*.{cjs,html,js,json,md,ts}": [ + "prettier --write", + "git add" + ] + }, "dependencies": { "lit": "^2.2.7" }, "devDependencies": { - "prettier": "^2.7.1", - "vite": "^3.0.0", "esbuild": "^0.15.8", "fast-glob": "^3.2.12", + "husky": "^8.0.1", + "lint-staged": "^13.0.3", + "prettier": "^2.7.1", "tslib": "^2.4.0", - "typescript": "^4.8.3" + "typescript": "^4.8.3", + "vite": "^3.0.0" }, "workspaces": [ "src/components/*", diff --git a/src/components/icon-control-bar/icon-control-bar.ts b/src/components/icon-control-bar/icon-control-bar.ts index 0b1d5f7..f1681f1 100644 --- a/src/components/icon-control-bar/icon-control-bar.ts +++ b/src/components/icon-control-bar/icon-control-bar.ts @@ -32,7 +32,7 @@ export class IconControlBar extends LitElement { @property({type: Boolean}) active = false @property({type: Boolean}) longPress = false @property({type: Boolean}) isNameShown = false - @state({}) timer!: NodeJS.Timeout + @state({}) timer!: number @query('.more-info-icon') moreInfoIcon!: HTMLDivElement @query('.icon-button') iconBtn!: HTMLDivElement