Skip to content

Commit ce50659

Browse files
authored
chore: added lint-staged (#1360)
1 parent c5e8b57 commit ce50659

File tree

13 files changed

+759
-667
lines changed

13 files changed

+759
-667
lines changed

Diff for: .husky/pre-commit

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run lint-fix -ws
5-
cd examples/sam && npm run lint-fix
6-
cd ../..
7-
cd examples/cdk && npm run lint-fix
8-
cd ../..
4+
npx lint-staged

Diff for: docs/snippets/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"lint": "eslint --ext .ts --no-error-on-unmatched-pattern logger tracer metrics parameters",
1515
"lint-fix": "eslint --fix --ext .ts --no-error-on-unmatched-pattern logger tracer metrics parameters"
1616
},
17+
"lint-staged": {
18+
"*.ts": "npm run lint-fix"
19+
},
1720
"license": "MIT-0",
1821
"repository": {
1922
"type": "git",
@@ -31,4 +34,4 @@
3134
"@aws-sdk/util-dynamodb": "^3.245.0",
3235
"axios": "^1.2.4"
3336
}
34-
}
37+
}

Diff for: examples/cdk/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
"version": "npm i -D @aws-lambda-powertools/logger@latest @aws-lambda-powertools/tracer@latest @aws-lambda-powertools/metrics@latest && git add package*",
2424
"cdk": "cdk"
2525
},
26+
"lint-staged": {
27+
"*.ts": "npm run lint-fix"
28+
},
2629
"devDependencies": {
2730
"@aws-lambda-powertools/logger": "^1.5.1",
2831
"@aws-lambda-powertools/metrics": "^1.5.1",
@@ -51,4 +54,4 @@
5154
"phin": "^3.7.0",
5255
"source-map-support": "^0.5.21"
5356
}
54-
}
57+
}

Diff for: examples/sam/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"test:e2e": "echo 'To be implemented ...'",
1919
"version": "npm install @aws-lambda-powertools/logger@latest @aws-lambda-powertools/tracer@latest @aws-lambda-powertools/metrics@latest && git add package.json"
2020
},
21+
"lint-staged": {
22+
"*.ts": "npm run lint-fix"
23+
},
2124
"devDependencies": {
2225
"@types/aws-lambda": "^8.10.109",
2326
"@types/jest": "^29.2.4",
@@ -43,4 +46,4 @@
4346
"@middy/core": "^3.6.2",
4447
"phin": "^3.7.0"
4548
}
46-
}
49+
}

Diff for: layers/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"test:unit": "jest --group=unit",
1717
"test:e2e": "RUNTIME=nodejs14x jest --group=e2e"
1818
},
19+
"lint-staged": {
20+
"*.ts": "npm run lint-fix"
21+
},
1922
"repository": {
2023
"type": "git",
2124
"url": "git+https://github.com/awslabs/aws-lambda-powertools-typescript.git"

0 commit comments

Comments
 (0)