Skip to content

chore(ci): added lint-staged as pre-commit hook #1360

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

Merged
merged 1 commit into from
Mar 10, 2023
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
6 changes: 1 addition & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-fix -ws
cd examples/sam && npm run lint-fix
cd ../..
cd examples/cdk && npm run lint-fix
cd ../..
npx lint-staged
5 changes: 4 additions & 1 deletion docs/snippets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
"lint": "eslint --ext .ts --no-error-on-unmatched-pattern logger tracer metrics parameters",
"lint-fix": "eslint --fix --ext .ts --no-error-on-unmatched-pattern logger tracer metrics parameters"
},
"lint-staged": {
"*.ts": "npm run lint-fix"
},
"license": "MIT-0",
"repository": {
"type": "git",
Expand All @@ -31,4 +34,4 @@
"@aws-sdk/util-dynamodb": "^3.245.0",
"axios": "^1.2.4"
}
}
}
5 changes: 4 additions & 1 deletion examples/cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"version": "npm i -D @aws-lambda-powertools/logger@latest @aws-lambda-powertools/tracer@latest @aws-lambda-powertools/metrics@latest && git add package*",
"cdk": "cdk"
},
"lint-staged": {
"*.ts": "npm run lint-fix"
},
"devDependencies": {
"@aws-lambda-powertools/logger": "^1.5.1",
"@aws-lambda-powertools/metrics": "^1.5.1",
Expand Down Expand Up @@ -51,4 +54,4 @@
"phin": "^3.7.0",
"source-map-support": "^0.5.21"
}
}
}
5 changes: 4 additions & 1 deletion examples/sam/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"test:e2e": "echo 'To be implemented ...'",
"version": "npm install @aws-lambda-powertools/logger@latest @aws-lambda-powertools/tracer@latest @aws-lambda-powertools/metrics@latest && git add package.json"
},
"lint-staged": {
"*.ts": "npm run lint-fix"
},
"devDependencies": {
"@types/aws-lambda": "^8.10.109",
"@types/jest": "^29.2.4",
Expand All @@ -43,4 +46,4 @@
"@middy/core": "^3.6.2",
"phin": "^3.7.0"
}
}
}
3 changes: 3 additions & 0 deletions layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"test:unit": "jest --group=unit",
"test:e2e": "RUNTIME=nodejs14x jest --group=e2e"
},
"lint-staged": {
"*.ts": "npm run lint-fix"
},
"repository": {
"type": "git",
"url": "git+https://github.com/awslabs/aws-lambda-powertools-typescript.git"
Expand Down
Loading