Skip to content

Commit

Permalink
chore: Implement husky (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsacoyote authored Aug 9, 2024
1 parent 7aed822 commit ca91cdb
Show file tree
Hide file tree
Showing 10 changed files with 1,925 additions and 1,890 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ permissions:
checks: write
pull-requests: write

env:
HUSKY: 0
CI: true

jobs:
build:
name: Build
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release'
description: "Branch to release"
required: true
default: 'main'
default: "main"

env:
HUSKY: 0
CI: true
jobs:
release:
name: Release
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/secrets_scanner.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Leaked Secrets Scan
on: [pull_request]
env:
HUSKY: 0
CI: true
jobs:
TruffleHog:
runs-on: ubuntu-latest
Expand Down
74 changes: 68 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,71 @@
# Default
node_modules
# Logs

logs
*.log

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
\*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
\*.lcov

# Dependency directories

node_modules/
jspm_packages/

# TypeScript cache

\*.tsbuildinfo

# Optional npm cache directory

.npm

# npm and pnpm
__package_previews__
.store

privatePackages/store
pnpm-lock.yaml

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local
.env.*
!.env.example

# Finder (MacOS) folder config
.DS_Store

.history

# Build
bin
# bin build

# Workflow
junit.xml
bin
6 changes: 1 addition & 5 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit
npm run commitlint
npx --no-install commitlint --edit "$1"
6 changes: 6 additions & 0 deletions .husky/install.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Skip Husky install in production and CI
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
process.exit(0)
}
const husky = (await import('husky')).default
console.log(husky())
5 changes: 2 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
npx --no -- lint-staged

4 changes: 4 additions & 0 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"*.{js,ts,vue}":
- eslint --max-warnings=0
"*.ts":
- tsc-files --noEmit
Loading

0 comments on commit ca91cdb

Please sign in to comment.