Skip to content

Commit

Permalink
eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuqi-Du committed Nov 28, 2023
1 parent b82a154 commit 2620d4c
Show file tree
Hide file tree
Showing 16 changed files with 4,928 additions and 4,901 deletions.
47 changes: 27 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
name: Test
on:
push:
pull_request:
permissions:
contents: read

jobs:
test-ecommerce:
test-discord-bot:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [16]
os: [ubuntu-20.04]
name: Ecommerce Sample App
name: Discord Bot Sample App
steps:
## Set up Stargate
- name: disable and stop mono-xsp4.service
Expand All @@ -26,33 +27,34 @@ jobs:
- name: Set up JSON API
run: |
chmod +x bin/start_json_api.sh
bin/start_json_api.sh -t v2.1 -j v1
bin/start_json_api.sh
working-directory: stargate-mongoose
- name: Wait for services
run: |
while ! nc -z localhost 8080; do sleep 1; done
while ! nc -z localhost 8181; do sleep 1; done
while ! nc -z localhost 8081; do sleep 1; done
working-directory: stargate-mongoose
## Set up and run ecommerce sample app tests
## Set up and run discord bot sample app tests
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
- name: Setup node
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3.1.1
with:
node-version: ${{ matrix.node }}

- run: npm install
working-directory: netlify-functions-ecommerce
working-directory: discord-bot
- run: npm run lint
working-directory: discord-bot
- run: npm test
working-directory: netlify-functions-ecommerce

test-photography:
working-directory: discord-bot
test-ecommerce:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [16]
os: [ubuntu-20.04]
name: Photography Sample App
name: Ecommerce Sample App
steps:
## Set up Stargate
- name: disable and stop mono-xsp4.service
Expand All @@ -66,11 +68,11 @@ jobs:
- name: Set up JSON API
run: |
chmod +x bin/start_json_api.sh
bin/start_json_api.sh -t v2.1 -j v1
bin/start_json_api.sh
working-directory: stargate-mongoose
- name: Wait for services
run: |
while ! nc -z localhost 8080; do sleep 1; done
while ! nc -z localhost 8181; do sleep 1; done
while ! nc -z localhost 8081; do sleep 1; done
working-directory: stargate-mongoose
## Set up and run ecommerce sample app tests
Expand All @@ -81,19 +83,20 @@ jobs:
node-version: ${{ matrix.node }}

- run: npm install
working-directory: photography-site-demo.js
working-directory: netlify-functions-ecommerce
- run: npm run lint
working-directory: netlify-functions-ecommerce
- run: npm test
working-directory: photography-site-demo.js

working-directory: netlify-functions-ecommerce

test-typescript-app:
test-photography:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [16]
os: [ubuntu-20.04]
name: Typescript Sample App
name: Photography Sample App
steps:
## Set up Stargate
- name: disable and stop mono-xsp4.service
Expand Down Expand Up @@ -122,6 +125,10 @@ jobs:
node-version: ${{ matrix.node }}

- run: npm install
working-directory: typescript-express-reviews.js
working-directory: photography-site-demo.js
- run: npm run lint
working-directory: photography-site-demo.js
- run: npm test
working-directory: typescript-express-reviews.js
working-directory: photography-site-demo.js


14 changes: 14 additions & 0 deletions photography-site-demo.js/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

module.exports = {
extends: [
'@masteringjs'
],
parserOptions: {
ecmaVersion: 2020
},
env: {
node: true,
es6: true
}
};
3 changes: 2 additions & 1 deletion photography-site-demo.js/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict';
//use nodemon to start app.js in package.json
const express = require('express');
const expressLayouts = require('express-ejs-layouts');
Expand Down Expand Up @@ -29,7 +30,7 @@ app.use(fileUpload());
app.set('layout', './layouts/main');
app.set('view engine', 'ejs');

const routes = require('./server/routes/photoRoutes.js')
const routes = require('./server/routes/photoRoutes.js');
app.use('/', routes);
const cors = require('cors');
app.use(cors());
Expand Down
8 changes: 5 additions & 3 deletions photography-site-demo.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"test": "mocha ./tests/*.test.js",
"seed": "env NODE_ENV=development node ./server/models/seed",
"start": "nodemon app.js"
"start": "nodemon app.js",
"lint": "eslint ."
},
"keywords": [],
"author": "",
Expand All @@ -24,8 +25,9 @@
"express-session": "^1.17.2",
"mongoose": "^7.4.0",
"python-shell": "^5.0.0",
"stargate-mongoose": "0.3.0"

"stargate-mongoose": "0.3.0",
"eslint": "8.54.0",
"@masteringjs/eslint-config": "0.0.1"
},
"devDependencies": {
"mocha": "10.2.0",
Expand Down
Loading

0 comments on commit 2620d4c

Please sign in to comment.