Update typescript configs
This commit is contained in:
parent
13db769a22
commit
bfd2ea2094
5 changed files with 53 additions and 31 deletions
|
@ -1,28 +1,32 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
// Enable latest features
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleDetection": "force",
|
||||
"jsx": "react-jsx",
|
||||
"allowJs": true,
|
||||
|
||||
// Bundler mode
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"noEmit": true,
|
||||
|
||||
// Best practices
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
|
||||
// Some stricter flags (disabled by default)
|
||||
"noUnusedLocals": false,
|
||||
"noUnusedParameters": false,
|
||||
"noPropertyAccessFromIndexSignature": false
|
||||
// Some stricter flags (enabled)
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
// Additional improvements
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"useDefineForClassFields": true,
|
||||
"types": ["bun-types"]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Route, BrowserRouter, Routes, useLocation } from 'react-router-dom';
|
||||
import { Route, BrowserRouter, Routes } from 'react-router-dom';
|
||||
import Home from './pages/Home';
|
||||
import './App.css';
|
||||
import '@revoltchat/ui/src/styles/dark.css';
|
||||
|
@ -9,10 +9,10 @@ import ServerDashboard from './pages/ServerDashboard/ServerDashboard';
|
|||
import localforage from 'localforage';
|
||||
import TexPage from './pages/Tex';
|
||||
|
||||
const API_URL = import.meta.env.VITE_API_URL?.toString()
|
||||
const API_URL = import.meta.env['VITE_API_URL']?.toString()
|
||||
|| 'http://localhost:9000';
|
||||
|
||||
const BOT_PREFIX = import.meta.env.VITE_BOT_PREFIX?.toString()
|
||||
const BOT_PREFIX = import.meta.env['VITE_BOT_PREFIX']?.toString()
|
||||
|| '/';
|
||||
|
||||
function App() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { FunctionComponent, useState } from "react";
|
||||
import { FunctionComponent } from "react";
|
||||
import './styles/CategorySelector.css';
|
||||
|
||||
const CategorySelector: FunctionComponent<{ keys: { id: string, name: string }[], selected: string, onChange: (key: string) => void }> = (props) => {
|
||||
|
|
|
@ -106,14 +106,14 @@ const ServerDashboard: FunctionComponent = () => {
|
|||
const server: Server = res.data.server;
|
||||
setServerInfo(server);
|
||||
|
||||
setPrefix(server.serverConfig?.prefix || '');
|
||||
setPrefixAllowSpace(!!server.serverConfig?.spaceAfterPrefix);
|
||||
setDmOnKick(!!server.serverConfig?.dmOnKick);
|
||||
setDmOnWarn(!!server.serverConfig?.dmOnWarn);
|
||||
setContact(server.serverConfig?.contact || '');
|
||||
setPrefix(server.serverConfig?.['prefix'] || '');
|
||||
setPrefixAllowSpace(!!server.serverConfig?.['spaceAfterPrefix']);
|
||||
setDmOnKick(!!server.serverConfig?.['dmOnKick']);
|
||||
setDmOnWarn(!!server.serverConfig?.['dmOnWarn']);
|
||||
setContact(server.serverConfig?.['contact'] || '');
|
||||
|
||||
setBotManagers(server.serverConfig?.botManagers ?? []);
|
||||
setModerators(server.serverConfig?.moderators ?? []);
|
||||
setBotManagers(server.serverConfig?.['botManagers'] ?? []);
|
||||
setModerators(server.serverConfig?.['moderators'] ?? []);
|
||||
|
||||
loadAutomodInfo(server);
|
||||
} catch(e: any) {
|
||||
|
|
|
@ -1,20 +1,38 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
// Enable latest features
|
||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": false,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"jsx": "react-jsx",
|
||||
"allowJs": true,
|
||||
|
||||
// Bundler mode
|
||||
"moduleResolution": "Node",
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
||||
// Best practices
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"noEmit": true,
|
||||
|
||||
// Some stricter flags (enabled)
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
|
||||
// Additional improvements
|
||||
"useDefineForClassFields": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
},
|
||||
"incremental": true
|
||||
},
|
||||
"include": ["./src"]
|
||||
"include": ["./src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue