feat(frontend): add eslint, typechecking

This commit is contained in:
Sergey Krylov 2025-08-10 16:55:23 +03:00
parent 09656a2325
commit 9806d0b8fa
7 changed files with 5649 additions and 11 deletions

15
frontend/eslint.config.ts Normal file
View File

@ -0,0 +1,15 @@
// @ts-expect-error fix package
import config from 'eslint-config-ksv741';
export default [
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
...config,
{
rules: {
'import/no-extraneous-dependencies': ['error', {
devDependencies: ['eslint.config.ts', 'rsbuild.config.ts'],
}],
'import/no-anonymous-default-export': 'off',
},
},
];

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,10 @@
"private": true,
"scripts": {
"build": "rsbuild build",
"dev": "rsbuild dev --open",
"preview": "rsbuild preview"
"dev": "rsbuild dev",
"preview": "rsbuild preview",
"lint": "eslint",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"react": "19.1.1",
@ -14,9 +16,14 @@
},
"devDependencies": {
"@rsbuild/core": "1.4.15",
"@rsbuild/plugin-eslint": "1.1.2",
"@rsbuild/plugin-react": "1.3.5",
"@rsbuild/plugin-type-check": "1.2.4",
"@types/react": "19.1.9",
"@types/react-dom": "19.1.7",
"@typescript-eslint/parser": "8.39.0",
"eslint": "9.33.0",
"eslint-config-ksv741": "0.2.0",
"typescript": "5.9.2"
}
}

View File

@ -1,6 +1,25 @@
import { defineConfig } from '@rsbuild/core';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginEslint } from '@rsbuild/plugin-eslint';
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
export default defineConfig({
plugins: [pluginReact()],
plugins: [
pluginReact(),
pluginEslint({
eslintPluginOptions: {
configType: 'flat',
},
}),
pluginTypeCheck(),
],
server: {
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
},
});

View File

@ -1,9 +1,7 @@
const App = () => {
return (
<div>
<h1>Investments Control Frontend</h1>
</div>
);
};
const App = () => (
<div>
<h1>Investments Control Frontend</h1>
</div>
);
export default App;

View File

@ -6,6 +6,7 @@
*/
declare module '*.svg?react' {
import type React from 'react';
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export default ReactComponent;
}

View File

@ -21,5 +21,9 @@
"noUnusedLocals": true,
"noUnusedParameters": true
},
"include": ["src"]
"include": [
"src",
"eslint.config.ts",
"rsbuild.config.ts"
]
}