Skip to content

Commit 288d918

Browse files
committed
Clean up dev environment
1 parent 94e4bfc commit 288d918

File tree

13 files changed

+1821
-1032
lines changed

13 files changed

+1821
-1032
lines changed

.eslintignore

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
node_modules/**/*
2-
coverage/**/*
3-
dist/**/*
4-
.github/**/*
1+
**/node_modules/**/*
2+
**/coverage/**/*
3+
**/dist/**/*
4+
**/build/**/*
5+
**/.github/**/*
6+
**/.webpack/**/*
7+
**/.serverless/**/*

.eslintrc.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"parser": "@typescript-eslint/parser",
3+
"env": {
4+
"node": true,
5+
"jest/globals": true
6+
},
37
"parserOptions": {
48
"ecmaVersion": 2020,
59
"sourceType": "module"
@@ -9,7 +13,11 @@
913
"prettier/@typescript-eslint",
1014
"plugin:prettier/recommended"
1115
],
16+
"plugins": ["jest"],
1217
"rules": {
13-
"strict": 2
18+
"strict": "error",
19+
"@typescript-eslint/no-explicit-any": "error",
20+
"@typescript-eslint/explicit-function-return-type": "error",
21+
"no-undef": "error"
1422
}
1523
}

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

.huskyrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.lintstagedrc.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.npmignore copy

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
tests
2+
coverage
3+
jest.config.ts
4+
5+
.github
6+
7+
*.md
8+
9+
.eslintignore
10+
.eslintrc.json
11+
.prettierignore
12+
.prettierrc.json
13+
.husky
14+
15+
yarn-error.log
16+
17+
src
18+
!dist/src
19+
20+
webpack.config.ts
21+
tsconfig.json

.prettierignore

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
node_modules
2-
coverage
3-
.*ignore
4-
yarn*
5-
dist
6-
.github
1+
**/node_modules
2+
**/coverage
3+
**/.*ignore
4+
**/yarn*
5+
**/dist
6+
**/build
7+
**/.github
8+
**/.webpack
9+
**/.serverless
10+
**/.husky
11+
**/*.sql
12+
**/.env*

package.json

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,46 @@
2121
"postversion": "git push && git push --tags"
2222
},
2323
"devDependencies": {
24-
"@types/aws-lambda": "^8.10.66",
24+
"@shallot/aws": "^1.0.6",
25+
"@types/aws-lambda": "^8.10.76",
2526
"@types/content-type": "^1.1.3",
2627
"@types/http-errors": "^1.8.0",
27-
"@types/jest": "^26.0.15",
28-
"@types/node": "^14.14.2",
29-
"@types/webpack": "^4.41.25",
30-
"@types/webpack-node-externals": "^2.5.0",
31-
"@typescript-eslint/eslint-plugin": "^4.5.0",
32-
"@typescript-eslint/parser": "^4.5.0",
33-
"eslint": "^7.12.0",
34-
"eslint-config-prettier": "^6.14.0",
28+
"@types/jest": "^26.0.23",
29+
"@types/node": "^15.0.1",
30+
"@types/webpack": "^5.28.0",
31+
"@types/webpack-node-externals": "^2.5.1",
32+
"@typescript-eslint/eslint-plugin": "^4.11.0",
33+
"@typescript-eslint/parser": "^4.11.0",
34+
"eslint": "^7.10.0",
35+
"eslint-config-prettier": "^7.1.0",
36+
"eslint-plugin-jest": "^24.3.4",
3537
"eslint-plugin-prettier": "^3.1.4",
36-
"husky": "^4.3.0",
37-
"jest": "^26.6.1",
38-
"lint-staged": "^10.4.2",
39-
"prettier": "^2.1.2",
40-
"shallot": "^1.2.1",
41-
"ts-jest": "^26.4.3",
42-
"ts-loader": "^8.0.11",
43-
"ts-node": "^9.0.0",
44-
"typescript": "^4.0.3",
45-
"webpack": "^5.9.0",
46-
"webpack-cli": "^4.2.0",
47-
"webpack-node-externals": "^2.5.2",
38+
"husky": "^6.0.0",
39+
"jest": "^26.6.3",
40+
"lint-staged": "^10.5.4",
41+
"prettier": "https://github.com/prettier/prettier",
42+
"ts-jest": "^26.5.5",
43+
"ts-loader": "^9.1.1",
44+
"ts-node": "^9.1.1",
45+
"typescript": "^4.1.3",
46+
"webpack": "^5.36.1",
47+
"webpack-cli": "^4.6.0",
48+
"webpack-node-externals": "^3.0.0",
4849
"yarn": "^1.22.10"
4950
},
5051
"dependencies": {
5152
"content-type": "^1.0.4",
5253
"http-errors": "^1.8.0"
54+
},
55+
"lint-staged": {
56+
"**/*.ts": [
57+
"eslint --ext .ts,.js --fix"
58+
],
59+
"**/*.js": [
60+
"eslint --ext .ts,.js --fix"
61+
],
62+
"*": [
63+
"prettier --no-error-on-unmatched-pattern --write"
64+
]
5365
}
5466
}

src/aws/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* https://github.com/middyjs/middy/tree/master/packages/http-json-body-parser
44
*/
55

6-
import type { ShallotMiddlewareWithOptions } from 'shallot/dist/aws/core';
6+
import type { ShallotAWSMiddlewareWithOptions } from '@shallot/aws';
77
import type { APIGatewayEvent } from 'aws-lambda';
88

99
import ContentType from 'content-type';
@@ -30,12 +30,13 @@ const isJSONContentType = (requestHeaders: APIGatewayEvent['headers']): boolean
3030
*
3131
* @param config optional object to pass config options
3232
*/
33-
const ShallotAWSHttpJsonBodyParser: ShallotMiddlewareWithOptions<
33+
const ShallotAWSHttpJsonBodyParser: ShallotAWSMiddlewareWithOptions<
3434
APIGatewayEvent,
3535
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3636
any,
3737
TShallotJSONBodyParserOptions
3838
> = (config) => ({
39+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
3940
before: async (request) => {
4041
if (request.event.headers != null && isJSONContentType(request.event.headers)) {
4142
try {

0 commit comments

Comments
 (0)