Skip to content

Commit

Permalink
hotfix(linter): fix ts config
Browse files Browse the repository at this point in the history
Signed-off-by: Mael-RABOT <[email protected]>
  • Loading branch information
Mael-RABOT committed Dec 2, 2024
1 parent 3b00608 commit db2d2b8
Show file tree
Hide file tree
Showing 19 changed files with 74 additions and 83 deletions.
20 changes: 10 additions & 10 deletions client_web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import { ContextManager } from "./Context/ContextManager.tsx";
import { uri } from './Config/uri.ts';
import { ContextManager } from "./Context/ContextManager";
import { uri } from './Config/uri';

import Home from './Pages/Home';
import NotFound from './Pages/NotFound';
import Layout from './components/Layout/Layout.tsx';
import Login from './Pages/Auth/Forms/Login.tsx';
import Register from './Pages/Auth/Forms/Register.tsx';
import Layout from './components/Layout/Layout';
import Login from './Pages/Auth/Forms/Login';
import Register from './Pages/Auth/Forms/Register';

import LinkedinCallback from "./Pages/Auth/Callback/LinkedinCallback.tsx";
import SpotifyCallback from './Pages/Auth/Callback/SpotifyCallback.tsx';
import MicrosoftCallback from './Pages/Auth/Callback/MicrosoftCallback.tsx';
import DiscordCallback from './Pages/Auth/Callback/DiscordCallback.tsx';
import LinkedinCallback from "./Pages/Auth/Callback/LinkedinCallback";
import SpotifyCallback from './Pages/Auth/Callback/SpotifyCallback';
import MicrosoftCallback from './Pages/Auth/Callback/MicrosoftCallback';
import DiscordCallback from './Pages/Auth/Callback/DiscordCallback';

import Dashboard from './Pages/Dashboard/Dashboard.tsx';
import Dashboard from './Pages/Dashboard/Dashboard';

const App = () => {
return (
Expand Down
6 changes: 3 additions & 3 deletions client_web/src/Context/CombinedProviders.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode } from 'react';
import { UserProvider } from './Scopes/UserContext.tsx';
import { ThemeProvider } from './Scopes/ThemeContext.tsx';
import { AuthProvider } from './Scopes/AuthContext.tsx';
import { UserProvider } from './Scopes/UserContext';
import { ThemeProvider } from './Scopes/ThemeContext';
import { AuthProvider } from './Scopes/AuthContext';

const providers = [
UserProvider,
Expand Down
6 changes: 3 additions & 3 deletions client_web/src/Context/ContextHooks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext } from 'react';
import { UserContext } from './Scopes/UserContext.tsx';
import { ThemeContext } from './Scopes/ThemeContext.tsx';
import { AuthContext } from './Scopes/AuthContext.tsx';
import { UserContext } from './Scopes/UserContext';
import { ThemeContext } from './Scopes/ThemeContext';
import { AuthContext } from './Scopes/AuthContext';

export const useUser = () => {
const context = useContext(UserContext);
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/Context/Scopes/AuthContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext, useState, ReactNode, useContext } from 'react';

interface AuthContextType {
export interface AuthContextType {
isAuthenticated: boolean;
jsonWebToken: string;
setIsAuthenticated: (isAuthenticated: boolean) => void;
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/Context/Scopes/ThemeContext.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createContext, useState, useEffect, ReactNode } from 'react';
import Cookies from 'js-cookie';

type ThemeContextType = {
export type ThemeContextType = {
theme: 'light' | 'dark';
setTheme: (theme: 'light' | 'dark') => void;
};
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/Context/Scopes/UserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface User {
name: string;
}

interface UserContextType {
export interface UserContextType {
user: User | null;
setUser: (user: User | null) => void;
}
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/Pages/Auth/Callback/MicrosoftCallback.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import { PublicClientApplication } from '@azure/msal-browser';
import { uri } from '../../../Config/uri.ts';
import { uri } from '../../../Config/uri';

const MicrosoftCallback = () => {
const navigate = useNavigate();
Expand Down
4 changes: 2 additions & 2 deletions client_web/src/Pages/Auth/Forms/Login.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Form, Input, Button, Card, Divider} from 'antd';
import {Form, Input, Button, Card } from 'antd';
import { Link } from 'react-router-dom';
import OAuthButtons from '../../../components/auth/OAuthButtons.tsx';
import OAuthButtons from '../../../components/auth/OAuthButtons';

const Login = () => {
const onFinish = (values: { email: string, password: string }) => {
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/Pages/Auth/Forms/Register.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Form, Input, Button, Card } from 'antd';
import { Link } from 'react-router-dom';
import OAuthButtons from '../../../components/auth/OAuthButtons.tsx';
import OAuthButtons from '../../../components/auth/OAuthButtons';

const Register = () => {
const onFinish = (values: unknown) => {
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/Pages/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC } from "react";
import { Row, Col, Card, Typography, Space } from "antd";
import { RobotOutlined, BarChartOutlined, SettingOutlined } from "@ant-design/icons";
import Security from "../../components/Security.tsx";
import Security from "../../components/Security";

const { Title } = Typography;

Expand Down
2 changes: 1 addition & 1 deletion client_web/src/components/Layout/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Layout } from 'antd';
import { useTheme } from '../../Context/ContextHooks.ts';
import { useTheme } from '../../Context/ContextHooks';
import React from "react";

const { Footer } = Layout;
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/components/Layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Layout, Menu } from 'antd';
import { Link } from 'react-router-dom';
import { useTheme } from '../../Context/ContextHooks.ts';
import { useTheme } from '../../Context/ContextHooks';
import React from "react";

const { Header: AntHeader } = Layout;
Expand Down
4 changes: 2 additions & 2 deletions client_web/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useLocation } from 'react-router-dom';
import Header from './Header.tsx';
import AppFooter from './Footer.tsx';
import Header from './Header';
import AppFooter from './Footer';
import React from "react";

interface LayoutProps {
Expand Down
10 changes: 5 additions & 5 deletions client_web/src/components/auth/OAuthButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import GoogleAuth from './Buttons/GoogleAuth.tsx';
import MicrosoftAuth from './Buttons/MicrosoftAuth.tsx';
import LinkedinAuth from './Buttons/LinkedinAuth.tsx';
import SpotifyAuth from './Buttons/SpotifyAuth.tsx';
import DiscordAuth from './Buttons/DiscordAuth.tsx';
import GoogleAuth from './Buttons/GoogleAuth';
import MicrosoftAuth from './Buttons/MicrosoftAuth';
import LinkedinAuth from './Buttons/LinkedinAuth';
import SpotifyAuth from './Buttons/SpotifyAuth';
import DiscordAuth from './Buttons/DiscordAuth';
import { Divider } from 'antd';

interface OAuthButtonsProps {
Expand Down
2 changes: 1 addition & 1 deletion client_web/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import App from "./App.tsx";
import App from "./App";

createRoot(document.getElementById('root')!).render(
<StrictMode>
Expand Down
27 changes: 8 additions & 19 deletions client_web/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"composite": true,
"outDir": "./dist/app",
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
"jsx": "react-jsx"
},
"include": ["src"]
"include": [
"src",
"src/app"
]
}
17 changes: 17 additions & 0 deletions client_web/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true,
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force"
}
}
19 changes: 6 additions & 13 deletions client_web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
],
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"],
"@Config/*": ["src/Config/*"]
},
"suppress": [
2307
]
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
"target": "es2015",
"noEmit": true,
"jsx": "react-jsx",
"esModuleInterop": true,
},
"include": ["src"]
}
26 changes: 9 additions & 17 deletions client_web/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,16 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "Bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
"composite": true,
"outDir": "./dist/node",
"noEmit": true
},
"include": ["vite.config.ts"]
"include": [
"src/app",
"vite.config.ts",
"src/node"
]
}

0 comments on commit db2d2b8

Please sign in to comment.