Skip to content

Commit

Permalink
chore: added lint-staged (#1360)
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamorosi authored Mar 10, 2023
1 parent c5e8b57 commit ce50659
Show file tree
Hide file tree
Showing 13 changed files with 759 additions and 667 deletions.
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

0 comments on commit ce50659

Please sign in to comment.