File tree Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "env" : {
3+ "es2021" : true
4+ },
5+ "extends" : [" eslint:recommended" ],
6+ "parserOptions" : {
7+ "ecmaVersion" : " latest" ,
8+ "sourceType" : " module"
9+ },
10+ "rules" : {}
11+ }
Original file line number Diff line number Diff line change 1+ name : validate
2+ on :
3+ # run on push but only for the main branch
4+ push :
5+ branches :
6+ - main
7+ # run for every pull request
8+ pull_request : {}
9+ jobs :
10+ main :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : ⬇️ Checkout repo
14+ uses : actions/checkout@v3
15+ with :
16+ fetch-depth : 0
17+
18+ - name : ⎔ Setup node
19+ uses : actions/setup-node@v3
20+ with :
21+ node-version : 18
22+
23+ - name : 🧹 Check code formatting with Prettier
24+ run : find . -name package.json -maxdepth 2 -type f -execdir npm run format:check ';'
25+
26+ - name : 👕 Lint Node.js code with ESLint
27+ run : find . -name package.json -maxdepth 2 -type f -execdir npm run lint ';'
Original file line number Diff line number Diff line change 77 "scripts" : {
88 "test" : " echo \" Error: no test specified\" && exit 1" ,
99 "start" : " node server/server.js" ,
10- "format" : " npx prettier --write **.js"
10+ "format" : " npx prettier --write **.{js,md}" ,
11+ "format:check" : " npx prettier --check **.{js,md}" ,
12+ "lint" : " npx eslint server/*.js --env=node && npx eslint client/*.js --env=browser"
1113 },
1214 "license" : " Apache-2.0" ,
1315 "dependencies" : {
Original file line number Diff line number Diff line change 77 "scripts" : {
88 "test" : " echo \" Error: no test specified\" && exit 1" ,
99 "start" : " node server/server.js" ,
10- "format" : " npx prettier --write **.js"
10+ "format" : " npx prettier --write **.{js,md}" ,
11+ "format:check" : " npx prettier --check **.{js,md}" ,
12+ "lint" : " npx eslint server/*.js --env=node && npx eslint client/*.js --env=browser"
1113 },
1214 "license" : " Apache-2.0" ,
1315 "dependencies" : {
You can’t perform that action at this time.
0 commit comments