Skip to content

Commit fd5ca11

Browse files
authored
Merge pull request #58 from AnthonyLzq/feature/lintingGha
feature/lintingGha
2 parents 47bb152 + b14f012 commit fd5ca11

File tree

24 files changed

+409
-208
lines changed

24 files changed

+409
-208
lines changed

.eslintrc

+12-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
"error",
4141
"always"
4242
],
43-
"object-shorthand": ["error", "always"],
43+
"object-shorthand": [
44+
"error",
45+
"always"
46+
],
4447
"prefer-const": "error",
4548
"prettier/prettier": [
4649
"error",
@@ -59,6 +62,13 @@
5962
"error",
6063
"as-needed"
6164
],
62-
"spaced-comment": ["error", "always"]
65+
"spaced-comment": [
66+
"error",
67+
"always"
68+
],
69+
"curly": [
70+
"error",
71+
"multi"
72+
]
6373
}
6474
}

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ By doing this your prompt will ask you the following questions:
4141
- `Select your license [1...7]:`, the license you have chosen for the project.
4242
- `License year (current year):`, the year where your license starts, current year as default.
4343
- `Will this project use GraphQL? [y/n]:`, yes or no question, only **y** or **n** is accepted. This is not case sensitive.
44-
- `Will this project be deployed with Heroku? [y/n]:`, yes or no question, only **y** or **n** is accepted. This is not case sensitive.
45-
- `Would you want to have a basic suit of tests with Jest? [y/n]:`, yes or no question, only **y** or **n** is accepted. This is not case sensitive.
46-
- `Would you want to have a basic GitHub Action for the suit of tests? [y/n]:`, yes or no question, only **y** or **n** is accepted. This is not case sensitive.
44+
- `Will this project be deployed with Heroku? [y/n]:`.
45+
- `Would you want to have a basic suit of tests with Jest? [y/n]:`.
46+
- `Would you want to have a basic GitHub Action for the suit of tests and linting? [y/n]:`.
4747

4848
The second option you have is by passing flags in one single command. If you need help, please run:
4949

example/express-graphql/.eslintrc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"env": {
33
"node": true,
4-
"jest/globals": true
4+
"jest": true
55
},
66
"root": true,
77
"parser": "@typescript-eslint/parser",
@@ -91,6 +91,10 @@
9191
"spaced-comment": [
9292
"error",
9393
"always"
94+
],
95+
"curly": [
96+
"error",
97+
"multi"
9498
]
9599
}
96100
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint - example/express-graphql
2+
3+
on: [push]
4+
5+
jobs:
6+
run-linters:
7+
name: Run linters
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Check out Git repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16.x
20+
21+
- name: Install Node.js dependencies
22+
run: npm ci
23+
24+
- name: Revert changes into the package-lock.json file
25+
run: git checkout -- package-lock.json
26+
27+
- name: Run linters
28+
uses: wearerequired/lint-action@v1
29+
with:
30+
auto_fix: true
31+
eslint: true
32+
eslint_extensions: js

example/express-graphql/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"license": "MIT",
1818
"dependencies": {
1919
"@graphql-tools/schema": "^8.5.0",
20-
"@sinclair/typebox": "^0.24.11",
20+
"@sinclair/typebox": "^0.24.16",
2121
"ajv": "^8.11.0",
2222
"ajv-formats": "^2.1.1",
2323
"apollo-server-core": "^3.9.0",
@@ -27,7 +27,7 @@
2727
"express-pino-logger": "^7.0.0",
2828
"graphql": "^16.5.0",
2929
"http-errors": "^2.0.0",
30-
"mongoose": "^6.4.3",
30+
"mongoose": "^6.4.4",
3131
"pino-pretty": "^8.1.0",
3232
"swagger-ui-express": "^4.4.0"
3333
},

example/express-graphql/yarn.lock

+44-44
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
"@babel/highlight" "^7.18.6"
102102

103103
"@babel/compat-data@^7.18.6":
104-
version "7.18.6"
105-
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.6.tgz#8b37d24e88e8e21c499d4328db80577d8882fa53"
106-
integrity sha512-tzulrgDT0QD6U7BJ4TKVk2SDDg7wlP39P9yAx1RfLy7vP/7rsDRlWVfbWxElslu56+r7QOhB2NSDsabYYruoZQ==
104+
version "7.18.8"
105+
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.18.8.tgz#2483f565faca607b8535590e84e7de323f27764d"
106+
integrity sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ==
107107

108108
"@babel/core@^7.11.6", "@babel/core@^7.12.3":
109109
version "7.18.6"
@@ -126,7 +126,7 @@
126126
json5 "^2.2.1"
127127
semver "^6.3.0"
128128

129-
"@babel/generator@^7.18.6", "@babel/generator@^7.7.2":
129+
"@babel/generator@^7.18.6", "@babel/generator@^7.18.7", "@babel/generator@^7.7.2":
130130
version "7.18.7"
131131
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.7.tgz#2aa78da3c05aadfc82dbac16c99552fc802284bd"
132132
integrity sha512-shck+7VLlY72a2w9c3zYWuE1pwOKEiQHV7GTUbSnhyl5eu3i04t30tBY82ZRWrDfo3gkakCFtevExnxbkf2a3A==
@@ -173,18 +173,18 @@
173173
"@babel/types" "^7.18.6"
174174

175175
"@babel/helper-module-transforms@^7.18.6":
176-
version "7.18.6"
177-
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.6.tgz#57e3ca669e273d55c3cda55e6ebf552f37f483c8"
178-
integrity sha512-L//phhB4al5uucwzlimruukHB3jRd5JGClwRMD/ROrVjXfLqovYnvQrK/JK36WYyVwGGO7OD3kMyVTjx+WVPhw==
176+
version "7.18.8"
177+
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.8.tgz#4f8408afead0188cfa48672f9d0e5787b61778c8"
178+
integrity sha512-che3jvZwIcZxrwh63VfnFTUzcAM9v/lznYkkRxIBGMPt1SudOKHAEec0SIRCfiuIzTcF7VGj/CaTT6gY4eWxvA==
179179
dependencies:
180180
"@babel/helper-environment-visitor" "^7.18.6"
181181
"@babel/helper-module-imports" "^7.18.6"
182182
"@babel/helper-simple-access" "^7.18.6"
183183
"@babel/helper-split-export-declaration" "^7.18.6"
184184
"@babel/helper-validator-identifier" "^7.18.6"
185185
"@babel/template" "^7.18.6"
186-
"@babel/traverse" "^7.18.6"
187-
"@babel/types" "^7.18.6"
186+
"@babel/traverse" "^7.18.8"
187+
"@babel/types" "^7.18.8"
188188

189189
"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.8.0":
190190
version "7.18.6"
@@ -233,10 +233,10 @@
233233
chalk "^2.0.0"
234234
js-tokens "^4.0.0"
235235

236-
"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.6":
237-
version "7.18.6"
238-
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.6.tgz#845338edecad65ebffef058d3be851f1d28a63bc"
239-
integrity sha512-uQVSa9jJUe/G/304lXspfWVpKpK4euFLgGiMQFOCpM/bgcAdeoHwi/OQz23O9GK2osz26ZiXRRV9aV+Yl1O8tw==
236+
"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.18.6", "@babel/parser@^7.18.8":
237+
version "7.18.8"
238+
resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.8.tgz#822146080ac9c62dac0823bb3489622e0bc1cbdf"
239+
integrity sha512-RSKRfYX20dyH+elbJK2uqAkVyucL+xXzhqlMD5/ZXx+dAAwpyB7HsvnHe/ZUGOF+xLr5Wx9/JoXVTj6BQE2/oA==
240240

241241
"@babel/plugin-syntax-async-generators@^7.8.4":
242242
version "7.8.4"
@@ -338,26 +338,26 @@
338338
"@babel/parser" "^7.18.6"
339339
"@babel/types" "^7.18.6"
340340

341-
"@babel/traverse@^7.18.6", "@babel/traverse@^7.7.2":
342-
version "7.18.6"
343-
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.6.tgz#a228562d2f46e89258efa4ddd0416942e2fd671d"
344-
integrity sha512-zS/OKyqmD7lslOtFqbscH6gMLFYOfG1YPqCKfAW5KrTeolKqvB8UelR49Fpr6y93kYkW2Ik00mT1LOGiAGvizw==
341+
"@babel/traverse@^7.18.6", "@babel/traverse@^7.18.8", "@babel/traverse@^7.7.2":
342+
version "7.18.8"
343+
resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.8.tgz#f095e62ab46abf1da35e5a2011f43aee72d8d5b0"
344+
integrity sha512-UNg/AcSySJYR/+mIcJQDCv00T+AqRO7j/ZEJLzpaYtgM48rMg5MnkJgyNqkzo88+p4tfRvZJCEiwwfG6h4jkRg==
345345
dependencies:
346346
"@babel/code-frame" "^7.18.6"
347-
"@babel/generator" "^7.18.6"
347+
"@babel/generator" "^7.18.7"
348348
"@babel/helper-environment-visitor" "^7.18.6"
349349
"@babel/helper-function-name" "^7.18.6"
350350
"@babel/helper-hoist-variables" "^7.18.6"
351351
"@babel/helper-split-export-declaration" "^7.18.6"
352-
"@babel/parser" "^7.18.6"
353-
"@babel/types" "^7.18.6"
352+
"@babel/parser" "^7.18.8"
353+
"@babel/types" "^7.18.8"
354354
debug "^4.1.0"
355355
globals "^11.1.0"
356356

357-
"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.7", "@babel/types@^7.3.0", "@babel/types@^7.3.3":
358-
version "7.18.7"
359-
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.7.tgz#a4a2c910c15040ea52cdd1ddb1614a65c8041726"
360-
integrity sha512-QG3yxTcTIBoAcQmkCs+wAPYZhu7Dk9rXKacINfNbdJDNERTbLQbHGyVG8q/YGMPeCJRIhSY0+fTc5+xuh6WPSQ==
357+
"@babel/types@^7.0.0", "@babel/types@^7.18.6", "@babel/types@^7.18.7", "@babel/types@^7.18.8", "@babel/types@^7.3.0", "@babel/types@^7.3.3":
358+
version "7.18.8"
359+
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.8.tgz#c5af199951bf41ba4a6a9a6d0d8ad722b30cd42f"
360+
integrity sha512-qwpdsmraq0aJ3osLJRApsc2ouSJCdnMeZwB0DhbtHAtRpZNZCdlbRnHIgcRKzdE1g0iOGg644fzjOBcdOz9cPw==
361361
dependencies:
362362
"@babel/helper-validator-identifier" "^7.18.6"
363363
to-fast-properties "^2.0.0"
@@ -797,10 +797,10 @@
797797
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d"
798798
integrity sha512-AFBVi/iT4g20DHoujvMH1aEDn8fGJh4xsRGCP6d8RpLPMqsNPvW01Jcn0QysXTsg++/xj25NmJsGyH9xug/wKg==
799799

800-
"@sinclair/typebox@^0.24.11":
801-
version "0.24.11"
802-
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.11.tgz#e9f4aa5056e367ed419ff60c26808f385688b521"
803-
integrity sha512-oHAgeyktMgCNPu4+oDAlwgqcHYn8piH8Nw0OngLeu2HIJM7EFxzU4VrK8ACrgbXAiXWedXL4nrfMb+bALMWD6w==
800+
"@sinclair/typebox@^0.24.16":
801+
version "0.24.16"
802+
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.16.tgz#d911c31b9b604084c725385369a4f1de52382517"
803+
integrity sha512-aWqQhrghjG38ymiiIPDhH5M2skStc5CepTBC6m0tYIdKqm5CDDPf0niJ8gC2vrRkCW6tjmJnoMucrp2j+dJvkg==
804804

805805
"@sinonjs/commons@^1.7.0":
806806
version "1.8.3"
@@ -1785,9 +1785,9 @@ [email protected]:
17851785
node-int64 "^0.4.0"
17861786

17871787
bson@^4.6.2, bson@^4.6.3:
1788-
version "4.6.4"
1789-
resolved "https://registry.yarnpkg.com/bson/-/bson-4.6.4.tgz#e66d4a334f1ab230dfcfb9ec4ea9091476dd372e"
1790-
integrity sha512-TdQ3FzguAu5HKPPlr0kYQCyrYUYh8tFM+CMTpxjNzVzxeiJY00Rtuj3LXLHSgiGvmaWlZ8PE+4KyM2thqE38pQ==
1788+
version "4.6.5"
1789+
resolved "https://registry.yarnpkg.com/bson/-/bson-4.6.5.tgz#1a410148c20eef4e40d484878a037a7036e840fb"
1790+
integrity sha512-uqrgcjyOaZsHfz7ea8zLRCLe1u+QGUSzMZmvXqO24CDW7DWoW1qiN9folSwa7hSneTSgM2ykDIzF5kcQQ8cwNw==
17911791
dependencies:
17921792
buffer "^5.6.0"
17931793

@@ -1849,9 +1849,9 @@ camelcase@^6.2.0:
18491849
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==
18501850

18511851
caniuse-lite@^1.0.30001359:
1852-
version "1.0.30001363"
1853-
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001363.tgz#26bec2d606924ba318235944e1193304ea7c4f15"
1854-
integrity sha512-HpQhpzTGGPVMnCjIomjt+jvyUu8vNFo3TaDiZ/RcoTrlOq/5+tC8zHdsbgFB6MxmaY+jCpsH09aD80Bb4Ow3Sg==
1852+
version "1.0.30001364"
1853+
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001364.tgz#1e118f0e933ed2b79f8d461796b8ce45398014a0"
1854+
integrity sha512-9O0xzV3wVyX0SlegIQ6knz+okhBB5pE0PC40MNdwcipjwpxoUEHL24uJ+gG42cgklPjfO5ZjZPme9FTSN3QT2Q==
18551855

18561856
chalk@^2.0.0, chalk@^2.4.2:
18571857
version "2.4.2"
@@ -2395,9 +2395,9 @@ [email protected]:
23952395
integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==
23962396

23972397
electron-to-chromium@^1.4.172:
2398-
version "1.4.182"
2399-
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.182.tgz#5d59214ebfe90b36f23e81cd226a42732cd8c677"
2400-
integrity sha512-OpEjTADzGoXABjqobGhpy0D2YsTncAax7IkER68ycc4adaq0dqEG9//9aenKPy7BGA90bqQdLac0dPp6uMkcSg==
2398+
version "1.4.185"
2399+
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.185.tgz#3432d7944f1c5fe20664bb45d9cced2151405ce2"
2400+
integrity sha512-9kV/isoOGpKkBt04yYNaSWIBn3187Q5VZRtoReq8oz5NY/A4XmU6cAoqgQlDp7kKJCZMRjWZ8nsQyxfpFHvfyw==
24012401

24022402
emittery@^0.10.2:
24032403
version "0.10.2"
@@ -4349,10 +4349,10 @@ [email protected]:
43494349
optionalDependencies:
43504350
saslprep "^1.0.3"
43514351

4352-
mongoose@^6.4.3:
4353-
version "6.4.3"
4354-
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-6.4.3.tgz#a44978adb987fb98c8339629e83e16e07e9cbdcd"
4355-
integrity sha512-JuEdgpDxYIqG+V85LzNn7LKIr73ixnKVbmEhJNSf3vF1+QmIfar5S0wfL/s3CSM3qs/p6J2vWirOle1INW5VCA==
4352+
mongoose@^6.4.4:
4353+
version "6.4.4"
4354+
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-6.4.4.tgz#4e22a36373d8a867ee8f73063d8b31f1e451316d"
4355+
integrity sha512-r6sp96veRNhNIWFtHHe4Lqak+ilgiExYnnMLhYTGdzjIMR90G1ayx0JKFVdHuC6dKNHGFX0ETJGbf36N8Romjg==
43564356
dependencies:
43574357
bson "^4.6.2"
43584358
kareem "2.4.1"
@@ -4417,9 +4417,9 @@ node-int64@^0.4.0:
44174417
integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==
44184418

44194419
node-releases@^2.0.5:
4420-
version "2.0.5"
4421-
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.5.tgz#280ed5bc3eba0d96ce44897d8aee478bfb3d9666"
4422-
integrity sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==
4420+
version "2.0.6"
4421+
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503"
4422+
integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==
44234423

44244424
nodemon@^2.0.19:
44254425
version "2.0.19"

example/express/.eslintrc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"env": {
33
"node": true,
4-
"jest/globals": true
4+
"jest": true
55
},
66
"root": true,
77
"parser": "@typescript-eslint/parser",
@@ -91,6 +91,10 @@
9191
"spaced-comment": [
9292
"error",
9393
"always"
94+
],
95+
"curly": [
96+
"error",
97+
"multi"
9498
]
9599
}
96100
}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint - example/express
2+
3+
on: [push]
4+
5+
jobs:
6+
run-linters:
7+
name: Run linters
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Check out Git repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16.x
20+
21+
- name: Install Node.js dependencies
22+
run: npm ci
23+
24+
- name: Revert changes into the package-lock.json file
25+
run: git checkout -- package-lock.json
26+
27+
- name: Run linters
28+
uses: wearerequired/lint-action@v1
29+
with:
30+
auto_fix: true
31+
eslint: true
32+
eslint_extensions: js

example/express/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
"author": "AnthonyLzq <[email protected]>",
1717
"license": "MIT",
1818
"dependencies": {
19-
"@sinclair/typebox": "^0.24.11",
19+
"@sinclair/typebox": "^0.24.16",
2020
"ajv": "^6",
2121
"cors": "^2.8.5",
2222
"express": "^4.18.1",
2323
"express-pino-logger": "^7.0.0",
2424
"http-errors": "^2.0.0",
25-
"mongoose": "^6.4.3",
25+
"mongoose": "^6.4.4",
2626
"pino-pretty": "^8.1.0",
2727
"swagger-ui-express": "^4.4.0"
2828
},

0 commit comments

Comments
 (0)