diff --git a/lefthook.yaml b/lefthook.yaml index 7624dd8..bd9c6f3 100644 --- a/lefthook.yaml +++ b/lefthook.yaml @@ -3,11 +3,11 @@ pre-commit: commands: lint: glob: "*.{js,ts,jsx,tsx}" - run: pnpm lint:fix {staged_files} + run: pnpm lint:fix stage_fixed: true format: glob: "*.{js,ts,jsx,tsx}" - run: pnpm format:fix {staged_files} + run: pnpm format:fix stage_fixed: true typecheck: glob: "*.{ts,tsx}" diff --git a/lefthook.yml b/lefthook.yml deleted file mode 100644 index b2f1798..0000000 --- a/lefthook.yml +++ /dev/null @@ -1,14 +0,0 @@ -pre-commit: - commands: - check: - glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}" - # run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files} - run: pnpm biome format --write {staged_files} - stage_fixed: true - -pre-push: - parallel: true - commands: - check: - glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}" - run: npx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files} \ No newline at end of file diff --git a/scripts/hooks-logger.js b/scripts/hooks-logger.js index 9365392..cc1d7c2 100755 --- a/scripts/hooks-logger.js +++ b/scripts/hooks-logger.js @@ -23,20 +23,13 @@ const formatCommand = (cmd) => { // Display a header for the command console.log( - '\n' + - chalk.gray( - '╔═════════════════════════════════════════════════════════════════════════════╗' - ) + `\n${chalk.gray('╔═════════════════════════════════════════════════════════════════════════════╗')}` ) console.log( - chalk.gray('║ ') + - chalk.white.bold(`LEFTHOOK: ${formatCommand(command)}`) + - chalk.gray(' ║') + `${chalk.gray('║ ')}${chalk.white.bold(`LEFTHOOK: ${formatCommand(command)}`)}${chalk.gray(' ║')}` ) console.log( - chalk.gray( - '╚═════════════════════════════════════════════════════════════════════════════╝\n' - ) + `${chalk.gray('╚═════════════════════════════════════════════════════════════════════════════╝\n')}` ) // If we have files, display them @@ -66,16 +59,12 @@ try { // Show success message console.log( - '\n' + - chalk.green.bold('✓ SUCCESS') + - chalk.green(` ${formatCommand(command)} completed successfully`) + `\n${chalk.green.bold('✓ SUCCESS')}${chalk.green(` ${formatCommand(command)} completed successfully`)}` ) } catch (error) { // Show error message console.log( - '\n' + - chalk.red.bold('✗ ERROR') + - chalk.red(` ${formatCommand(command)} failed`) + `\n${chalk.red.bold('✗ ERROR')}${chalk.red(` ${formatCommand(command)} failed`)}` ) process.exit(1) }