Skip to content

Commit b3fa801

Browse files
committed
feat: update authentication guard and ESLint configuration, upgrade React and ReactDOM
1 parent 50b7f2b commit b3fa801

File tree

5 files changed

+78
-75
lines changed

5 files changed

+78
-75
lines changed

backend/src/dashboard/dashboard.resolver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
} from './dto/user-input';
99
import { RequireRoles } from '../decorator/auth.decorator';
1010
import { UseGuards } from '@nestjs/common';
11-
import { GqlAuthGuard } from '../guard/gql-auth.guard';
11+
import { JWTAuthGuard } from 'src/guard/jwt-auth.guard';
1212

1313
@Resolver(() => User)
14-
@UseGuards(GqlAuthGuard)
14+
@UseGuards(JWTAuthGuard)
1515
export class DashboardResolver {
1616
constructor(private readonly dashboardService: DashboardService) {}
1717

dashboard/.eslintrc.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/* eslint-disable no-undef */
2+
module.exports = {
3+
root: true,
4+
parser: '@typescript-eslint/parser',
5+
parserOptions: {
6+
ecmaFeatures: {
7+
jsx: true
8+
},
9+
ecmaVersion: 2021,
10+
sourceType: 'module',
11+
project: './tsconfig.json'
12+
},
13+
env: {
14+
browser: true,
15+
es2021: true
16+
},
17+
extends: [
18+
'plugin:react/recommended',
19+
'airbnb-typescript',
20+
'plugin:react/jsx-runtime',
21+
'plugin:prettier/recommended'
22+
],
23+
plugins: ['@typescript-eslint', 'react'],
24+
settings: {
25+
react: {
26+
version: 'detect'
27+
}
28+
},
29+
rules: {
30+
'prettier/prettier': 'off',
31+
'react/jsx-filename-extension': 'off',
32+
'import/no-unresolved': 'off',
33+
'import/extensions': 'off',
34+
'react/display-name': 'off',
35+
'@typescript-eslint/comma-dangle': 'off',
36+
'import/prefer-default-export': 'off',
37+
'jsx-a11y/anchor-is-valid': 'off',
38+
'comma-dangle': 'off',
39+
'max-len': 'off',
40+
'no-console': 'off',
41+
'no-param-reassign': 'off',
42+
'no-plusplus': 'off',
43+
'no-return-assign': 'off',
44+
'object-curly-newline': 'off',
45+
'react/jsx-props-no-spreading': 'off',
46+
'react/react-in-jsx-scope': 'off',
47+
'react/require-default-props': 'off',
48+
'typescript-eslint/no-unused-vars': 'off',
49+
'import/no-extraneous-dependencies': 'off',
50+
'react/no-unescaped-entities': 'off',
51+
'react/forbid-prop-types': 'off',
52+
'react/jsx-max-props-per-line': [
53+
1,
54+
{
55+
maximum: 2,
56+
when: 'multiline'
57+
}
58+
],
59+
indent: 'off',
60+
'@typescript-eslint/indent': [0],
61+
'no-use-before-define': 'off',
62+
'@typescript-eslint/no-use-before-define': ['off'],
63+
'@typescript-eslint/no-unused-vars': ['off'],
64+
'@typescript-eslint/no-shadow': ['off'],
65+
'@typescript-eslint/dot-notation': ['off'],
66+
'react/prop-types': ['off'],
67+
'@typescript-eslint/naming-convention': ['off']
68+
}
69+
};

dashboard/.eslintrc.json

Lines changed: 0 additions & 69 deletions
This file was deleted.

dashboard/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"nprogress": "0.2.0",
2424
"numeral": "2.0.6",
2525
"prop-types": "15.8.1",
26-
"react": "17.0.2",
26+
"react": "^18.3.1",
2727
"react-custom-scrollbars-2": "4.4.0",
28-
"react-dom": "17.0.2",
28+
"react-dom": "^18.3.1",
2929
"react-helmet-async": "1.3.0",
3030
"react-router": "6.3.0",
3131
"react-router-dom": "6.3.0",
@@ -41,8 +41,8 @@
4141
"start": "react-scripts start",
4242
"build": "react-scripts build",
4343
"eject": "react-scripts eject",
44-
"lint": "eslint .",
45-
"lint:fix": "eslint --fix",
44+
"lint": "eslint . --ext .ts,.tsx",
45+
"lint:fix": "eslint . --ext .ts,.tsx --fix",
4646
"format": "prettier --write \"./**/*.{ts,tsx,js,jsx,json}\" --config ./.prettierrc"
4747
},
4848
"browserslist": {

dashboard/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"baseUrl": ".",
44
"target": "es6",
55
"lib": ["dom", "dom.iterable", "esnext"],
6+
"paths": {
7+
"src/*": ["./src/*"]
8+
},
69
"allowJs": true,
710
"skipLibCheck": true,
811
"esModuleInterop": true,

0 commit comments

Comments
 (0)