Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add husky and lint-staged for pre-commit hooks (prettier) #969

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/api/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cd apps/api
pnpm lint-staged
11 changes: 8 additions & 3 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"start": "nodemon --exec ts-node src/index.ts",
"start:production": "tsc && node dist/src/index.js",
"format": "prettier --write \"src/**/*.(js|ts)\"",
"flyio": "node dist/src/index.js",
"start:dev": "nodemon --exec ts-node src/index.ts",
"build": "tsc && pnpm sentry:sourcemaps",
Expand All @@ -22,7 +21,8 @@
"run-example": "npx ts-node src/example.ts",
"deploy:fly": "flyctl deploy --build-secret SENTRY_AUTH_TOKEN=$(dotenv -p SENTRY_AUTH_TOKEN) --depot=false",
"deploy:fly:staging": "fly deploy -c fly.staging.toml --depot=false",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org caleb-peffer --project firecrawl-scraper-js ./dist && sentry-cli sourcemaps upload --org caleb-peffer --project firecrawl-scraper-js ./dist"
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org caleb-peffer --project firecrawl-scraper-js ./dist && sentry-cli sourcemaps upload --org caleb-peffer --project firecrawl-scraper-js ./dist",
"prepare": "cd ../.. && husky apps/api/.husky"
},
"author": "",
"license": "ISC",
Expand All @@ -39,8 +39,10 @@
"@types/pdf-parse": "^1.1.4",
"body-parser": "^1.20.1",
"express": "^4.18.2",
"husky": "^8.0.0",
"jest": "^29.6.3",
"jest-fetch-mock": "^3.0.3",
"lint-staged": "^15.2.11",
"mammoth": "^1.7.2",
"nodemon": "^2.0.20",
"prettier": "^3.4.2",
Expand Down Expand Up @@ -132,5 +134,8 @@
"*.json",
"temp"
]
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json}": "prettier --write"
}
}
}
Loading