Add ESLint plugin to Vite configuration for improved linting support
This commit is contained in:
29
apps/frontend/eslint.config.ts
Normal file
29
apps/frontend/eslint.config.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import js from '@eslint/js';
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
export default tseslint.config(
|
||||
{
|
||||
// Ignore files and directories
|
||||
ignores: ['dist', 'node_modules', 'app/generated'],
|
||||
},
|
||||
js.configs.recommended,
|
||||
...tseslint.configs.recommended,
|
||||
{
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020,
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.node,
|
||||
},
|
||||
parserOptions: {
|
||||
project: ['./tsconfig.json', './tsconfig.node.json'],
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
// Add custom rules here
|
||||
'no-console': 'warn',
|
||||
},
|
||||
}
|
||||
);
|
||||
@@ -7,6 +7,7 @@
|
||||
"dev": "react-router dev",
|
||||
"start": "react-router-serve ./build/server/index.js",
|
||||
"typecheck": "react-router typegen && tsc",
|
||||
"lint": "eslint .",
|
||||
"test": "echo \"No tests specified\" && exit 0",
|
||||
"generate:openapi": "typed-openapi ../api/swagger.json --tanstack tanstack-client.ts -o ./app/generated/api-client/api-client.ts"
|
||||
},
|
||||
@@ -16,6 +17,7 @@
|
||||
"@react-router/serve": "^7.9.2",
|
||||
"@tanstack/react-query": "^5.90.12",
|
||||
"axios": "^1.13.2",
|
||||
"globals": "^16.5.0",
|
||||
"isbot": "^5.1.31",
|
||||
"radix-ui": "^1.4.3",
|
||||
"react": "^19.1.1",
|
||||
@@ -23,16 +25,22 @@
|
||||
"react-router": "^7.9.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.2",
|
||||
"@react-router/dev": "^7.9.2",
|
||||
"@tailwindcss/vite": "^4.1.13",
|
||||
"@types/node": "^22",
|
||||
"@types/react": "^19.1.13",
|
||||
"@types/react-dom": "^19.1.9",
|
||||
"dotenv": "^17.2.3",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^7.0.1",
|
||||
"tailwindcss": "^4.1.13",
|
||||
"typed-openapi": "^2.2.3",
|
||||
"typescript": "^5.9.2",
|
||||
"typescript-eslint": "^8.50.0",
|
||||
"vite": "^7.1.7",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
"vite-tsconfig-paths": "^5.1.4"
|
||||
}
|
||||
}
|
||||
1834
apps/frontend/pnpm-lock.yaml
generated
1834
apps/frontend/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,17 @@ import { reactRouter } from '@react-router/dev/vite';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||
// @ts-expect-error vite-plugin-eslint has no types
|
||||
import eslint from 'vite-plugin-eslint';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
reactRouter(),
|
||||
tsconfigPaths(),
|
||||
eslint({
|
||||
failOnError: false,
|
||||
}),
|
||||
],
|
||||
appType: 'spa',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user