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

Add husky to format code automatically #346

Merged
Merged
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
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm dlx lint-staged
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false
}
7 changes: 7 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
'*.{js,ts,tsx,json,md,mdx,html,css,scss,yml}': 'prettier --write',
'*.sol': 'prettier --write --plugin=prettier-plugin-solidity',
'*.cairo': 'scarb fmt',
'*.prisma': 'prisma format',
'*.go': 'go fmt',
};
49 changes: 26 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
"prisma": {},
"scripts": {
"build": "turbo run build",
"build:website":"cd apps/website && pnpm run build",
"dev:website":"cd apps/website && pnpm run dev",
"build:mobile":"cd apps/mobile && pnpm run build",
"dev:mobile":"cd apps/mobile && pnpm run start",
"build:nostr_sdk":"cd packages/afk_nostr_sdk && pnpm run build",
"build:indexer-prisma":"cd packages/indexer-prisma && pnpm run build",
"build:prisma-db":"cd packages/prisma-db && pnpm pull && pnpm generate",
"build:backend":"cd apps/data-backend && pnpm run build",
"build:backend:all":"pnpm run build:prisma-db && pnpm run build:indexer-prisma && cd apps/data-backend && pnpm install && pnpm run build:all",
"run:backend":"cd apps/data-backend && pnpm run start",
"build:backend:prisma":"cd apps/data-backend && pnpm run prisma:setup",
"run:backend:prod":"cd apps/data-backend && pnpm run start:prod",
"build:website": "cd apps/website && pnpm run build",
"dev:website": "cd apps/website && pnpm run dev",
"build:mobile": "cd apps/mobile && pnpm run build",
"dev:mobile": "cd apps/mobile && pnpm run start",
"build:nostr_sdk": "cd packages/afk_nostr_sdk && pnpm run build",
"build:indexer-prisma": "cd packages/indexer-prisma && pnpm run build",
"build:prisma-db": "cd packages/prisma-db && pnpm pull && pnpm generate",
"build:backend": "cd apps/data-backend && pnpm run build",
"build:backend:all": "pnpm run build:prisma-db && pnpm run build:indexer-prisma && cd apps/data-backend && pnpm install && pnpm run build:all",
"run:backend": "cd apps/data-backend && pnpm run start",
"build:backend:prisma": "cd apps/data-backend && pnpm run prisma:setup",
"run:backend:prod": "cd apps/data-backend && pnpm run start:prod",
"build:nestjs-indexer": "cd apps/nestjs-indexer && pnpm run build",
"dev": "turbo run dev",
"web":"turbo run dev --filter=website",
"mobile":"turbo run start --filter=mobile",
"extension":"turbo run dev --filter=extensions",
"web": "turbo run dev --filter=website",
"mobile": "turbo run start --filter=mobile",
"extension": "turbo run dev --filter=extensions",
"lint": "turbo run lint",
"clean": "turbo run clean && rimraf node_modules",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
Expand All @@ -37,18 +37,22 @@
"generate": "turbo run generate",
"export-extension": "cd /apps/extensions && pnpm run build build && next export && cp -r extension/* out/",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate"
"contributors:generate": "all-contributors generate",
"prepare": "husky"
},
"dependencies": {
"@babel/core": "^7.20.0",
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
"@prisma/client":"^5.18.0",
"prettier":"^2.8.8",
"prisma":"5.18.0",
"tsup":"^8.0.2",
"turbo":"^1.13.2"
"@prisma/client": "^5.18.0",
"prettier": "^2.8.8",
"prisma": "5.18.0",
"tsup": "^8.0.2",
"turbo": "^1.13.2"
},
"devDependencies": {
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"prettier-plugin-solidity": "^1.4.1",
"prisma": "^5.18.0",
"tsup": "^8.0.2",
"typescript": "~5.3.3"
Expand All @@ -57,6 +61,5 @@
"node": ">=14.0.0"
},
"packageManager": "[email protected]",
"pnpm": {
}
"pnpm": {}
}
Loading