Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code style checks #31

Merged
merged 6 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Code style checks

on: pull_request

jobs:
javascript:
name: JavaScript
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint:js
24 changes: 0 additions & 24 deletions .github/workflows/pull-request.yml

This file was deleted.

4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const routes = require('./app/routes');
const utils = require('./lib/utils');

// Set configuration variables
const port = parseInt(process.env.PORT) || config.port;
const port = parseInt(process.env.PORT, 10) || config.port;

// Initialise applications
const app = express();
Expand Down Expand Up @@ -53,7 +53,7 @@ const nunjucksConfig = {

nunjucksConfig.express = app;

let nunjucksAppEnv = nunjucks.configure(appViews, nunjucksConfig);
const nunjucksAppEnv = nunjucks.configure(appViews, nunjucksConfig);
nunjucksAppEnv.addGlobal('version', packageInfo.version);

// Add Nunjucks filters
Expand Down
2 changes: 1 addition & 1 deletion app/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ module.exports = {
// Automatically stores form data, and send to all views
useAutoStoreData: 'true',

}
};
17 changes: 6 additions & 11 deletions app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,12 @@ router.post('/install', (req, res) => {

if (install === 'Simple') {
res.redirect('/install/simple');
}
else if (install === 'Developer') {
} else if (install === 'Developer') {
res.redirect('/install/advanced');
}
else if (install === 'Download') {
} else if (install === 'Download') {
res.redirect('/install/download-zip');
}
else {
res.redirect('/install')
} else {
res.redirect('/install');
}
});

Expand All @@ -33,11 +30,9 @@ router.post('/install/mac', (req, res) => {

if (machine === 'Mac') {
res.redirect('/install/mac/terminal');
}
else if (machine === 'Windows') {
} else if (machine === 'Windows') {
res.redirect('/install/windows/terminal');
}
else res.redirect('/install/mac-or-windows')
} else res.redirect('/install/mac-or-windows');
});

router.get('/download', (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "jest --coverage=true",
"prewatch": "gulp build",
"watch": "gulp",
"lint:js": "eslint -c ./linters/.eslintrc.js app.js middleware/**/*.js lib/**/*.js app/*.js docs/*.js"
"lint:js": "eslint -c ./linters/.eslintrc.js app.js middleware/**/*.js lib/**/*.js app/*.js"
},
"author": "https://github.com/nhsuk/",
"license": "MIT",
Expand Down