Skip to content

Database diagrams editor that allows you to visualize and design your DB with a single query.

add husky

Guy Ben-Aharon8213e8e1ca7d
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100644
index 00000000..83a8446f
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1 @@
+npm run lint:fix
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 1440a3cd..138dc28f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -66,6 +66,7 @@
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
+ "husky": "^9.1.5",
"postcss": "^8.4.40",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.7",
@@ -6221,6 +6222,22 @@
"integrity": "sha512-9gux8QhvjRO/erSnDPv28noDZcPZmYE7e1vFsBLKLlRlKDSqNJYebj6Qz1TGd5lsRV+X+xYyjCKjuZdABinWjA==",
"license": "MIT"
},
+ "node_modules/husky": {
+ "version": "9.1.5",
+ "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.5.tgz",
+ "integrity": "sha512-rowAVRUBfI0b4+niA4SJMhfQwc107VLkBUgEYYAOQAbqDCnra1nYh83hF/MDmhYs9t9n1E3DuKOrs2LYNC+0Ag==",
+ "dev": true,
+ "license": "MIT",
+ "bin": {
+ "husky": "bin.js"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/typicode"
+ }
+ },
"node_modules/hyphenate-style-name": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.1.0.tgz",
diff --git a/package.json b/package.json
index 81f5a980..b480ce1a 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,8 @@
"build": "npm run lint && tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "npm run lint -- --fix",
- "preview": "vite preview"
+ "preview": "vite preview",
+ "prepare": "husky"
},
"dependencies": {
"@ai-sdk/openai": "^0.0.51",
@@ -69,6 +70,7 @@
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
+ "husky": "^9.1.5",
"postcss": "^8.4.40",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.7",
diff --git a/src/dialogs/create-diagram-dialog/create-diagram-dialog.tsx b/src/dialogs/create-diagram-dialog/create-diagram-dialog.tsx
index 1879e35c..bcf5afcd 100644
--- a/src/dialogs/create-diagram-dialog/create-diagram-dialog.tsx
+++ b/src/dialogs/create-diagram-dialog/create-diagram-dialog.tsx
@@ -151,7 +151,7 @@ export const CreateDiagramDialog: React.FC<CreateDiagramDialogProps> = ({
}, []);
const renderExamplesOption = useCallback(
- () => (
+ () =>(
<div
className="flex w-32 h-32 bg-pink-50 rounded-md items-center text-center flex-col py-3 border border-pink-600 cursor-pointer"
onClick={() => window.open('/examples')}