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 #26

Merged
merged 1 commit into from
Sep 28, 2024
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
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm lint:staged
pnpm test:changed
1 change: 1 addition & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,md}\"",
"lint": "turbo run lint",
"lint:fix": "turbo run lint:fix",
"lint:staged": "turbo run lint:staged --filter=[HEAD^1]",
"prepare": "husky",
"test": "turbo run test",
"test:changed": "turbo run test:changed --filter=[HEAD^1]",
"test:coverage": "turbo run test:coverage",
"typecheck": "turbo run typecheck"
},
"devDependencies": {
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"turbo": "^2.0.14",
"vitest": "^2.0.5"
Expand All @@ -40,4 +45,4 @@
"engines": {
"node": ">=20"
}
}
}
3 changes: 3 additions & 0 deletions packages/cache/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,mjs,cjs,ts,tsx}": ["pnpm lint:files"]
}
4 changes: 4 additions & 0 deletions packages/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
"clean": "rm '/tmp/@figmarine' -rf",
"dev": "tsc-watch --onSuccess \"tsup --env.NODE_ENV production\"",
"lint": "eslint .",
"lint:files": "eslint --",
"lint:fix": "eslint . --fix",
"lint:staged": "lint-staged",
"test": "vitest run",
"test:changed": "vitest run --changed HEAD~1",
"test:coverage": "vitest --coverage run",
"test:dev": "vitest dev",
"typecheck": "tsc --noEmit"
Expand All @@ -44,6 +47,7 @@
"@types/node": "^22.5.0",
"@vitest/coverage-istanbul": "^2.1.1",
"@vitest/coverage-v8": "^2.1.1",
"lint-staged": "^15.2.10",
"lockfile": "^1.0.4",
"memfs": "^4.11.1",
"tsc-watch": "^6.2.0",
Expand Down
3 changes: 3 additions & 0 deletions packages/cuttings/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,mjs,cjs,ts,tsx}": ["pnpm lint:files"]
}
4 changes: 4 additions & 0 deletions packages/cuttings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@
"dev": "tsc-watch --onSuccess \"tsup --env.NODE_ENV production\"",
"dev:debug": "tsc-watch --onSuccess \"tsup --entry src/debug.ts --entry src/index.ts --env.NODE_ENV development\"",
"lint": "eslint .",
"lint:files": "eslint --",
"lint:fix": "eslint . --fix",
"lint:staged": "lint-staged",
"test": "vitest run",
"test:changed": "vitest run --changed HEAD~1",
"test:coverage": "vitest --coverage run",
"test:dev": "vitest dev",
"typecheck": "tsc --noEmit"
Expand All @@ -48,6 +51,7 @@
"@vitest/coverage-istanbul": "^2.1.1",
"@vitest/coverage-v8": "^2.1.1",
"axios": "^1.7.4",
"lint-staged": "^15.2.10",
"memfs": "^4.11.1",
"tsc-watch": "^6.2.0",
"tsup": "^8.2.4",
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-plugin-figma/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,mjs,cjs,ts,tsx}": ["pnpm lint:files"]
}
4 changes: 4 additions & 0 deletions packages/eslint-plugin-figma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
"docs:dev": "echo 'TODO",
"docs:serve": "echo 'TODO",
"lint": "eslint .",
"lint:files": "eslint --",
"lint:fix": "eslint . --fix",
"lint:staged": "lint-staged",
"test": "vitest run",
"test:changed": "vitest run --changed HEAD~1",
"test:coverage": "vitest --coverage run",
"test:dev": "vitest dev",
"typecheck": "tsc --noEmit"
Expand All @@ -51,6 +54,7 @@
"@vitest/coverage-istanbul": "^2.1.1",
"@vitest/coverage-v8": "^2.1.1",
"eslint-plugin-eslint-plugin": "^6.2.0",
"lint-staged": "^15.2.10",
"tsc-watch": "^6.2.0",
"tsup": "^8.2.4",
"typescript": "latest",
Expand Down
3 changes: 3 additions & 0 deletions packages/logger/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,mjs,cjs,ts,tsx}": ["pnpm lint:files"]
}
4 changes: 4 additions & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
"build": "tsc && tsup --env.NODE_ENV production",
"dev": "tsc-watch --onSuccess \"tsup --env.NODE_ENV production\"",
"lint": "eslint .",
"lint:files": "eslint --",
"lint:fix": "eslint . --fix",
"lint:staged": "lint-staged",
"test": "vitest run",
"test:changed": "vitest run --changed HEAD~1",
"test:coverage": "vitest --coverage run",
"test:dev": "vitest dev",
"typecheck": "tsc --noEmit"
Expand All @@ -40,6 +43,7 @@
"@types/node": "^22.5.0",
"@vitest/coverage-istanbul": "^2.1.1",
"@vitest/coverage-v8": "^2.1.1",
"lint-staged": "^15.2.10",
"tsc-watch": "^6.2.0",
"tsup": "^8.2.4",
"typescript": "latest",
Expand Down
3 changes: 3 additions & 0 deletions packages/rest/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{js,jsx,mjs,cjs,ts,tsx}": ["pnpm lint:files"]
}
4 changes: 4 additions & 0 deletions packages/rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
"docs:dev": "echo 'TODO: vitepress dev docs --port 1227'",
"docs:serve": "echo 'TODO: vitepress serve docs'",
"lint": "eslint .",
"lint:files": "eslint --",
"lint:fix": "eslint . --fix",
"lint:staged": "lint-staged",
"test": "vitest run",
"test:changed": "vitest run --changed HEAD~1",
"test:coverage": "vitest --coverage run",
"test:dev": "vitest dev",
"typecheck": "tsc --noEmit"
Expand Down Expand Up @@ -61,6 +64,7 @@
"@vitest/coverage-istanbul": "^2.1.1",
"@vitest/coverage-v8": "^2.1.1",
"cacheable": "^0.8.0",
"lint-staged": "^15.2.10",
"memfs": "^4.11.1",
"mocked-env": "^1.3.5",
"nock": "^13.5.5",
Expand Down
Loading