diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a5252940..693d0545 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -12,15 +12,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
+
+ - name: Install dependencies
+ run: npm install
- - name: Format
- run: npm run prettier
+ - name: Check formatting rules
+ run: npx prettier . --check
- - name: lint
+ - name: Check code-quality rules
run: npm run lint
- - name: typescript
- run: npm run typescript
+ - name: Check typescript type validity
+ run: npm run ts-lint
- - name: build
+ - name: Build the web client
run: npm run build --if-present
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 36af2198..c37466e2 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
-npx lint-staged
+npx lint-staged
\ No newline at end of file
diff --git a/.prettier.json b/.prettier.json
deleted file mode 100644
index 831df287..00000000
--- a/.prettier.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "trailingComma": "es5",
- "bracketSpacing": true,
- "printWidth": 80,
- "tabWidth": 2,
- "singleQuote": true,
- "arrowParens": "always"
-}
diff --git a/.prettierignore b/.prettierignore
index ab57381f..ef59e210 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,3 +1,5 @@
node_modules
build
dist
+.github
+public
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1 @@
+{}
diff --git a/next.config.js b/next.config.js
index 767719fc..658404ac 100644
--- a/next.config.js
+++ b/next.config.js
@@ -1,4 +1,4 @@
/** @type {import('next').NextConfig} */
-const nextConfig = {}
+const nextConfig = {};
-module.exports = nextConfig
+module.exports = nextConfig;
diff --git a/package.json b/package.json
index c3ecf34b..387e7181 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
+ "ts-lint": "tsc -noEmit -incremental",
"postinstall": "node ./node_modules/@axa-fr/react-oidc/bin/copy-service-worker-files.mjs public",
"prepare": "husky install"
},
@@ -39,6 +40,7 @@
},
"lint-staged": {
"*.{js,ts,jsx,tsx}": "eslint --cache --fix",
- "*.{js,ts,jsx,tsx,css,md}": "prettier --write"
+ "*.{js,ts,jsx,tsx,css,md}": "prettier --write",
+ "*.{ts, tsx}": "tsc-files --noEmit"
}
}
diff --git a/postcss.config.js b/postcss.config.js
index 90d9fffc..a47ef4f9 100644
--- a/postcss.config.js
+++ b/postcss.config.js
@@ -2,4 +2,4 @@ module.exports = {
plugins: {
autoprefixer: {},
},
-}
+};
diff --git a/src/app/dashboard/jobmonitor/[id]/page.tsx b/src/app/dashboard/jobmonitor/[id]/page.tsx
index e7193c50..01b7137e 100644
--- a/src/app/dashboard/jobmonitor/[id]/page.tsx
+++ b/src/app/dashboard/jobmonitor/[id]/page.tsx
@@ -1,7 +1,3 @@
-export default function Page({
- params
-}: {
- params: {id: string}
-}) {
- return
Hello, Job Monitoring {params.id} Page!
- }
\ No newline at end of file
+export default function Page({ params }: { params: { id: string } }) {
+ return Hello, Job Monitoring {params.id} Page!
;
+}
diff --git a/src/app/dashboard/jobmonitor/error.tsx b/src/app/dashboard/jobmonitor/error.tsx
index 9b59d8e8..68cea11a 100644
--- a/src/app/dashboard/jobmonitor/error.tsx
+++ b/src/app/dashboard/jobmonitor/error.tsx
@@ -1,24 +1,22 @@
-'use client'
-
-import { useEffect } from 'react'
-
+"use client";
+
+import { useEffect } from "react";
+
export default function Error({
error,
reset,
}: {
- error: Error
- reset: () => void
+ error: Error;
+ reset: () => void;
}) {
useEffect(() => {
- console.error(error)
- }, [error])
-
+ console.error(error);
+ }, [error]);
+
return (
Something went wrong!
-
+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/app/dashboard/jobmonitor/layout.tsx b/src/app/dashboard/jobmonitor/layout.tsx
index b2876931..1f26a53c 100644
--- a/src/app/dashboard/jobmonitor/layout.tsx
+++ b/src/app/dashboard/jobmonitor/layout.tsx
@@ -1,7 +1,7 @@
export default function JobMonitorLayout({
children,
}: {
- children: React.ReactNode
+ children: React.ReactNode;
}) {
- return
-}
\ No newline at end of file
+ return ;
+}
diff --git a/src/app/dashboard/jobmonitor/page.tsx b/src/app/dashboard/jobmonitor/page.tsx
index d98be5be..4f9a4c3e 100644
--- a/src/app/dashboard/jobmonitor/page.tsx
+++ b/src/app/dashboard/jobmonitor/page.tsx
@@ -1,4 +1,4 @@
-import { JobDataGrid } from "@/app/components/JobDataGrid";
+import { JobDataGrid } from "@/components/JobDataGrid";
export default async function Page() {
return (
diff --git a/src/app/dashboard/layout.tsx b/src/app/dashboard/layout.tsx
index e21f8237..9a8e9f58 100644
--- a/src/app/dashboard/layout.tsx
+++ b/src/app/dashboard/layout.tsx
@@ -1,20 +1,17 @@
-import React from 'react';
-import DashboardAppBar from '../components/DashboardAppBar';
-import { OIDCSecure } from '../components/OIDCUtils';
-
+import React from "react";
+import DashboardAppBar from "@/components/DashboardAppBar";
+import { OIDCSecure } from "@/components/OIDCUtils";
export default function DashboardLayout({
children,
}: {
- children: React.ReactNode
+ children: React.ReactNode;
}) {
return (
-
-
-
- {children}
-
-
-
+
+
+ {children}
+
+
);
-}
\ No newline at end of file
+}
diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx
index 631767e4..f171f6c0 100644
--- a/src/app/dashboard/page.tsx
+++ b/src/app/dashboard/page.tsx
@@ -1,9 +1,7 @@
export default function Page() {
- return (
-
-
- Hello User
-
-
- );
+ return (
+
+ Hello User
+
+ );
}
diff --git a/src/app/error.tsx b/src/app/error.tsx
index ba399e69..830a08fb 100644
--- a/src/app/error.tsx
+++ b/src/app/error.tsx
@@ -1,18 +1,16 @@
-'use client'
-
+"use client";
+
export default function Error({
error,
reset,
}: {
- error: Error
- reset: () => void
+ error: Error;
+ reset: () => void;
}) {
return (
Something went wrong!
-
+
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx
index 08bbecea..7e65847a 100644
--- a/src/app/global-error.tsx
+++ b/src/app/global-error.tsx
@@ -1,11 +1,11 @@
-'use client'
-
+"use client";
+
export default function GlobalError({
error,
reset,
}: {
- error: Error
- reset: () => void
+ error: Error;
+ reset: () => void;
}) {
return (
@@ -14,5 +14,5 @@ export default function GlobalError({