diff options
Diffstat (limited to 'FrontEnd')
-rw-r--r-- | FrontEnd/.eslintignore | 2 | ||||
-rw-r--r-- | FrontEnd/.eslintrc.cjs (renamed from FrontEnd/.eslintrc.js) | 12 | ||||
-rw-r--r-- | FrontEnd/cspell.json | 4 | ||||
-rw-r--r-- | FrontEnd/package.json | 22 | ||||
-rw-r--r-- | FrontEnd/src/i18next.d.ts | 19 | ||||
-rw-r--r-- | FrontEnd/src/sw.ts | 2 | ||||
-rw-r--r-- | FrontEnd/src/vite-env.d.ts | 1 | ||||
-rw-r--r-- | FrontEnd/tsconfig.json | 16 | ||||
-rw-r--r-- | FrontEnd/vite.config.js | 5 |
9 files changed, 44 insertions, 39 deletions
diff --git a/FrontEnd/.eslintignore b/FrontEnd/.eslintignore index f4f28252..21ea71eb 100644 --- a/FrontEnd/.eslintignore +++ b/FrontEnd/.eslintignore @@ -1,6 +1,6 @@ .yarn
node_modules
dist
-.eslintrc.js
+.eslintrc.cjs
postcss.config.js
vite.config.js
diff --git a/FrontEnd/.eslintrc.js b/FrontEnd/.eslintrc.cjs index 93b98978..62490975 100644 --- a/FrontEnd/.eslintrc.js +++ b/FrontEnd/.eslintrc.cjs @@ -1,7 +1,8 @@ module.exports = {
+ root: true,
env: {
browser: true,
- es2020: true,
+ es2022: true,
},
extends: [
"eslint:recommended",
@@ -12,17 +13,10 @@ module.exports = { "plugin:prettier/recommended",
"plugin:react-hooks/recommended",
],
- globals: {
- Atomics: "readonly",
- SharedArrayBuffer: "readonly",
- },
parser: "@typescript-eslint/parser",
parserOptions: {
+ tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
- ecmaFeatures: {
- jsx: true,
- },
- sourceType: "module",
},
plugins: ["react", "@typescript-eslint", "react-hooks"],
settings: {
diff --git a/FrontEnd/cspell.json b/FrontEnd/cspell.json new file mode 100644 index 00000000..3f746df6 --- /dev/null +++ b/FrontEnd/cspell.json @@ -0,0 +1,4 @@ +{ + "version": "0.2", + "ignorePaths": ["**/node_modules/**", "package-lock.json"] +} diff --git a/FrontEnd/package.json b/FrontEnd/package.json index 0a91d67d..6592fbeb 100644 --- a/FrontEnd/package.json +++ b/FrontEnd/package.json @@ -2,19 +2,20 @@ "name": "timeline",
"version": "0.4.0",
"private": true,
- "homepage": "https://timeline.crupest.life",
+ "homepage": "https://crupest.space",
"keywords": [],
"description": "Timeline app.",
+ "type": "module",
"dependencies": {
"@microsoft/signalr": "^6.0.7",
"@popperjs/core": "^2.11.5",
- "axios": "^0.27.0",
+ "axios": "^1.1.3",
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.9.1",
"classnames": "^2.3.1",
"color": "^4.2.3",
"core-js": "^3.23.4",
- "i18next": "^21.8.13",
+ "i18next": "^22.0.2",
"i18next-browser-languagedetector": "^6.1.4",
"js-base64": "^3.7.2",
"lodash": "^4.17.21",
@@ -24,9 +25,9 @@ "react": "^18.0.0",
"react-color": "^2.19.3",
"react-dom": "^18.2.0",
- "react-i18next": "^11.18.3",
+ "react-i18next": "^12.0.0",
"react-popper": "^2.3.0",
- "react-responsive": "^8.2.0",
+ "react-responsive": "^9.0.0",
"react-router-dom": "^6.3.0",
"react-transition-group": "^4.4.2",
"regenerator-runtime": "^0.13.9",
@@ -43,11 +44,12 @@ "start": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
- "typecheck": "tsc",
+ "type-check": "tsc",
"lint": "eslint src/ --ext .js --ext .jsx --ext .ts --ext .tsx",
"lint:fix": "eslint src/ --ext .js --ext .jsx --ext .ts --ext .tsx --fix"
},
"devDependencies": {
+ "@tsconfig/vite-react": "^1.0.1",
"@types/color": "^3.0.3",
"@types/lodash": "^4.14.181",
"@types/marked": "^4.0.3",
@@ -59,15 +61,15 @@ "@types/react-transition-group": "^4.4.5",
"@typescript-eslint/eslint-plugin": "^5.30.6",
"@typescript-eslint/parser": "^5.30.6",
- "@vitejs/plugin-react-refresh": "^1.3.6",
+ "@vitejs/plugin-react": "^2.1.0",
"eslint": "^8.19.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.30.1",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^2.7.1",
- "typescript": "^4.7.4",
- "vite": "^2.9.14",
- "vite-plugin-pwa": "^0.12.3"
+ "typescript": "^4.8.0",
+ "vite": "^3.1.8",
+ "vite-plugin-pwa": "^0.13.1"
}
}
\ No newline at end of file diff --git a/FrontEnd/src/i18next.d.ts b/FrontEnd/src/i18next.d.ts new file mode 100644 index 00000000..761b22f3 --- /dev/null +++ b/FrontEnd/src/i18next.d.ts @@ -0,0 +1,19 @@ +// import the original type declarations +import "react-i18next"; +// import all namespaces (for the default language, only) +import admin from "./locales/en/admin.json"; +import translation from "./locales/en/translation.json"; + +// react-i18next versions higher than 11.11.0 +declare module "i18next" { + // and extend them! + interface CustomTypeOptions { + // custom namespace type if you changed it + defaultNS: "translation"; + // custom resources type + resources: { + admin: typeof admin; + translation: typeof translation; + }; + } +} diff --git a/FrontEnd/src/sw.ts b/FrontEnd/src/sw.ts index 0130e345..a43ff9e5 100644 --- a/FrontEnd/src/sw.ts +++ b/FrontEnd/src/sw.ts @@ -1,5 +1,3 @@ -/// <reference no-default-lib="true"/> -/// <reference lib="esnext" /> /// <reference lib="webworker" /> import { precacheAndRoute, matchPrecache } from "workbox-precaching"; diff --git a/FrontEnd/src/vite-env.d.ts b/FrontEnd/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/FrontEnd/src/vite-env.d.ts @@ -0,0 +1 @@ +/// <reference types="vite/client" /> diff --git a/FrontEnd/tsconfig.json b/FrontEnd/tsconfig.json index 6b691e0e..967f9dd6 100644 --- a/FrontEnd/tsconfig.json +++ b/FrontEnd/tsconfig.json @@ -1,22 +1,10 @@ {
+ "extends": "@tsconfig/vite-react/tsconfig.json",
"compilerOptions": {
- "target": "ESNext",
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
- "skipLibCheck": true,
- "allowSyntheticDefaultImports": true,
- "strict": true,
- "forceConsistentCasingInFileNames": true,
- "module": "ESNext",
- "moduleResolution": "Node",
- "resolveJsonModule": true,
- "isolatedModules": true,
- "jsx": "react",
- "noEmit": true,
- "types": ["vite/client"],
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
- "include": ["./src"]
+ "include": ["src"]
}
diff --git a/FrontEnd/vite.config.js b/FrontEnd/vite.config.js index 64e0457f..b8d15dbd 100644 --- a/FrontEnd/vite.config.js +++ b/FrontEnd/vite.config.js @@ -2,18 +2,17 @@ * @type {import('vite').UserConfig}
*/
-import reactRefresh from "@vitejs/plugin-react-refresh";
import { VitePWA } from "vite-plugin-pwa";
import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [
- reactRefresh(),
+ react(),
VitePWA({
strategies: "injectManifest",
srcDir: "src",
filename: "sw.ts",
- base: "/",
manifest: false,
includeAssets: "**",
}),
|