feat(frontend): add eslint, typechecking
This commit is contained in:
parent
09656a2325
commit
9806d0b8fa
15
frontend/eslint.config.ts
Normal file
15
frontend/eslint.config.ts
Normal 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',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
5594
frontend/package-lock.json
generated
5594
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -5,8 +5,10 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rsbuild build",
|
"build": "rsbuild build",
|
||||||
"dev": "rsbuild dev --open",
|
"dev": "rsbuild dev",
|
||||||
"preview": "rsbuild preview"
|
"preview": "rsbuild preview",
|
||||||
|
"lint": "eslint",
|
||||||
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "19.1.1",
|
"react": "19.1.1",
|
||||||
@ -14,9 +16,14 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rsbuild/core": "1.4.15",
|
"@rsbuild/core": "1.4.15",
|
||||||
|
"@rsbuild/plugin-eslint": "1.1.2",
|
||||||
"@rsbuild/plugin-react": "1.3.5",
|
"@rsbuild/plugin-react": "1.3.5",
|
||||||
|
"@rsbuild/plugin-type-check": "1.2.4",
|
||||||
"@types/react": "19.1.9",
|
"@types/react": "19.1.9",
|
||||||
"@types/react-dom": "19.1.7",
|
"@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"
|
"typescript": "5.9.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,25 @@
|
|||||||
import { defineConfig } from '@rsbuild/core';
|
import { defineConfig } from '@rsbuild/core';
|
||||||
import { pluginReact } from '@rsbuild/plugin-react';
|
import { pluginReact } from '@rsbuild/plugin-react';
|
||||||
|
import { pluginEslint } from '@rsbuild/plugin-eslint';
|
||||||
|
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [pluginReact()],
|
plugins: [
|
||||||
|
pluginReact(),
|
||||||
|
pluginEslint({
|
||||||
|
eslintPluginOptions: {
|
||||||
|
configType: 'flat',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
pluginTypeCheck(),
|
||||||
|
],
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://localhost:3000',
|
||||||
|
changeOrigin: true,
|
||||||
|
pathRewrite: { '^/api': '' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
const App = () => {
|
const App = () => (
|
||||||
return (
|
|
||||||
<div>
|
<div>
|
||||||
<h1>Investments Control Frontend</h1>
|
<h1>Investments Control Frontend</h1>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|||||||
1
frontend/src/env.d.ts
vendored
1
frontend/src/env.d.ts
vendored
@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
declare module '*.svg?react' {
|
declare module '*.svg?react' {
|
||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
|
|
||||||
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
||||||
export default ReactComponent;
|
export default ReactComponent;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,5 +21,9 @@
|
|||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true
|
"noUnusedParameters": true
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": [
|
||||||
|
"src",
|
||||||
|
"eslint.config.ts",
|
||||||
|
"rsbuild.config.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user