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

Linting #232

Merged
merged 31 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c158381
Backend build script
gsproston-scottlogic Sep 4, 2023
72fe1b3
Basic typescript-eslint
gsproston-scottlogic Sep 4, 2023
a31843f
Stricter eslint ts
gsproston-scottlogic Sep 4, 2023
1666ecf
Backend prettier
gsproston-scottlogic Sep 4, 2023
6f0bf57
More eslint rules
gsproston-scottlogic Sep 4, 2023
9395f09
Linted app.ts
gsproston-scottlogic Sep 4, 2023
d8997ea
Linted defence.ts
gsproston-scottlogic Sep 4, 2023
0ad25cf
Linted email.ts
gsproston-scottlogic Sep 4, 2023
4f40941
Linted langchain.ts
gsproston-scottlogic Sep 4, 2023
099404f
Linted openai.ts
gsproston-scottlogic Sep 4, 2023
6f09a37
Linted router.ts
gsproston-scottlogic Sep 4, 2023
31f2302
Linted defence test
gsproston-scottlogic Sep 4, 2023
1753363
Linted langchain test
gsproston-scottlogic Sep 4, 2023
93c785b
Linted remaining tests
gsproston-scottlogic Sep 4, 2023
e943f9a
Ignoring some files when linting
gsproston-scottlogic Sep 4, 2023
60ae128
Added linting and formatting checks to CI
gsproston-scottlogic Sep 4, 2023
82e8e22
Excluding build files from testing
gsproston-scottlogic Sep 4, 2023
25cc529
WIP: frontend linting
gsproston-scottlogic Sep 5, 2023
5f993b0
Linted DefenceConfiguration
gsproston-scottlogic Sep 5, 2023
4f04ae8
Fixed defence toggle
gsproston-scottlogic Sep 5, 2023
93addf3
Better void calls
gsproston-scottlogic Sep 5, 2023
0ce58e8
Frontend linting
gsproston-scottlogic Sep 5, 2023
6341e79
Frontend formatting
gsproston-scottlogic Sep 5, 2023
ae255d2
Added frontend CI job
gsproston-scottlogic Sep 5, 2023
5c2107e
Not building frontend node_modules
gsproston-scottlogic Sep 5, 2023
f5b8775
Linted backend more
gsproston-scottlogic Sep 5, 2023
dfa7119
Frontend prettier
gsproston-scottlogic Sep 5, 2023
a8e3ac5
Fixed bug
gsproston-scottlogic Sep 5, 2023
5e924b3
Better checking for req body params
gsproston-scottlogic Sep 5, 2023
9f75205
Using PHASE_NAMES
gsproston-scottlogic Sep 5, 2023
7400810
Merge dev into 229
gsproston-scottlogic Sep 6, 2023
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
29 changes: 29 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,34 @@ jobs:
cache: 'npm'
cache-dependency-path: './backend/package-lock.json'
- run: npm ci
- run: npx eslint .
- run: npx prettier . --check
- run: npm run build --if-present
- run: npm test


build-test-frontend:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

defaults:
run:
working-directory: ./frontend
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- run: npm ci
- run: npx eslint .
- run: npx prettier . --check
- run: npm run build --if-present
# - run: npm test
29 changes: 29 additions & 0 deletions backend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:@typescript-eslint/strict-type-checked",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
plugins: ["@typescript-eslint"],
root: true,
ignorePatterns: ["build", "coverage", "node_modules", "jest.config.js"],
rules: {
"@typescript-eslint/init-declarations": "error",
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: false,
},
],

"func-style": ["error", "declaration"],
"prefer-template": "error",
},
};
4 changes: 4 additions & 0 deletions backend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
coverage

node_modules
7 changes: 4 additions & 3 deletions backend/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
modulePathIgnorePatterns: ["build", "coverage", "node_modules"],
preset: "ts-jest",
testEnvironment: "node",
};
Loading