diff --git a/src/templates/basic.ts b/src/templates/basic.ts index 7d077e353..169e0e067 100644 --- a/src/templates/basic.ts +++ b/src/templates/basic.ts @@ -27,7 +27,7 @@ const basicTemplate: Template = { build: 'tsdx build', test: 'tsdx test', lint: 'tsdx lint', - prepare: 'tsdx build', + prepare: 'husky install && tsdx build', size: 'size-limit', analyze: 'size-limit --why', }, @@ -44,11 +44,6 @@ const basicTemplate: Template = { }, ], */ - husky: { - hooks: { - 'pre-commit': 'tsdx lint', - }, - }, prettier: { printWidth: 80, semi: true, diff --git a/templates/basic/.husky/.gitignore b/templates/basic/.husky/.gitignore new file mode 100644 index 000000000..31354ec13 --- /dev/null +++ b/templates/basic/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/templates/basic/.husky/pre-commit b/templates/basic/.husky/pre-commit new file mode 100755 index 000000000..f07b61935 --- /dev/null +++ b/templates/basic/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install tsdx lint diff --git a/templates/react-with-storybook/.husky/.gitignore b/templates/react-with-storybook/.husky/.gitignore new file mode 100644 index 000000000..31354ec13 --- /dev/null +++ b/templates/react-with-storybook/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/templates/react-with-storybook/.husky/pre-commit b/templates/react-with-storybook/.husky/pre-commit new file mode 100755 index 000000000..f07b61935 --- /dev/null +++ b/templates/react-with-storybook/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install tsdx lint diff --git a/templates/react/.husky/.gitignore b/templates/react/.husky/.gitignore new file mode 100644 index 000000000..31354ec13 --- /dev/null +++ b/templates/react/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/templates/react/.husky/pre-commit b/templates/react/.husky/pre-commit new file mode 100755 index 000000000..f07b61935 --- /dev/null +++ b/templates/react/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install tsdx lint