chore: add Typescript linting

This commit is contained in:
dec0dOS 2023-10-04 19:30:01 +01:00
parent 5c69694505
commit 70c580474c
5 changed files with 22 additions and 26 deletions

View file

@ -1,10 +0,0 @@
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"],
"exclude": ["node_modules", "**/node_modules/*"],
"typeAcquisition": {
"exclude": ["dotenv", "harmony-reflect"]
}
}

View file

@ -31,6 +31,7 @@
"eslint-plugin-react-refresh": "^0.4.3",
"rimraf": "^5.0.5",
"source-map-explorer": "^2.5.3",
"typescript": "^5.2.2",
"vite": "^4.4.10"
},
"scripts": {
@ -39,6 +40,7 @@
"serve": "vite preview",
"clean": "rimraf build",
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"typecheck": "tsc --pretty --noEmit -p tsconfig.json",
"analyze": "source-map-explorer 'build/static/js/*.js'"
},
"homepage": "/app",

1
frontend/src/types.d.ts vendored Normal file
View file

@ -0,0 +1 @@
declare module "*.png";

19
frontend/tsconfig.json Normal file
View file

@ -0,0 +1,19 @@
{
"compilerOptions": {
"rootDir": ".",
"baseUrl": "src",
"allowJs": true,
"checkJs": true,
"noEmit": true,
"skipLibCheck": true,
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ESNext",
"lib": ["ESNext", "dom"],
"strict": true,
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"jsx": "preserve"
},
"include": ["src"]
}

View file

@ -1,22 +1,6 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// import { join, parse, resolve } from "path";
// import * as url from "url";
// const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
// function entryPoints(...paths) {
// const entries = paths.map(parse).map((entry) => {
// const { dir, base, name } = entry;
// const key = join(dir, name);
// const path = resolve(__dirname, dir, base);
// return [key, path];
// });
// const config = Object.fromEntries(entries);
// return config;
// }
export default defineConfig({
base: "/app",
server: {