feat: enhance ESLint configuration and improve component error handling

- Updated ESLint configuration to include support for `.mjs` and `.cjs` file types, adding necessary global variables for Node.js and browser environments.
- Introduced a new `vite-env.d.ts` file to define environment variables for Vite, improving type safety.
- Refactored error handling in `file-browser-dialog.tsx`, `description-image-dropzone.tsx`, and `feature-image-upload.tsx` to omit error parameters, simplifying the catch blocks.
- Removed unused bug report button functionality from the sidebar, streamlining the component structure.
- Adjusted various components to improve code readability and maintainability, including updates to type imports and component props.

These changes aim to enhance the development experience by improving linting support and simplifying error handling across components.
This commit is contained in:
Kacper
2025-12-21 23:08:08 +01:00
parent 43c93fe19a
commit 26236d3d5b
40 changed files with 2013 additions and 2587 deletions

View File

@@ -5,6 +5,18 @@ import tsParser from "@typescript-eslint/parser";
const eslintConfig = defineConfig([
js.configs.recommended,
{
files: ["**/*.mjs", "**/*.cjs"],
languageOptions: {
globals: {
console: "readonly",
process: "readonly",
require: "readonly",
__dirname: "readonly",
__filename: "readonly",
},
},
},
{
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
@@ -13,6 +25,70 @@ const eslintConfig = defineConfig([
ecmaVersion: "latest",
sourceType: "module",
},
globals: {
// Browser/DOM APIs
window: "readonly",
document: "readonly",
navigator: "readonly",
Navigator: "readonly",
localStorage: "readonly",
sessionStorage: "readonly",
fetch: "readonly",
WebSocket: "readonly",
File: "readonly",
FileList: "readonly",
FileReader: "readonly",
Blob: "readonly",
atob: "readonly",
crypto: "readonly",
prompt: "readonly",
confirm: "readonly",
getComputedStyle: "readonly",
requestAnimationFrame: "readonly",
// DOM Element Types
HTMLElement: "readonly",
HTMLInputElement: "readonly",
HTMLDivElement: "readonly",
HTMLButtonElement: "readonly",
HTMLSpanElement: "readonly",
HTMLTextAreaElement: "readonly",
HTMLHeadingElement: "readonly",
HTMLParagraphElement: "readonly",
HTMLImageElement: "readonly",
Element: "readonly",
// Event Types
Event: "readonly",
KeyboardEvent: "readonly",
DragEvent: "readonly",
PointerEvent: "readonly",
CustomEvent: "readonly",
ClipboardEvent: "readonly",
WheelEvent: "readonly",
DataTransfer: "readonly",
// Web APIs
ResizeObserver: "readonly",
AbortSignal: "readonly",
Audio: "readonly",
ScrollBehavior: "readonly",
// Timers
setTimeout: "readonly",
setInterval: "readonly",
clearTimeout: "readonly",
clearInterval: "readonly",
// Node.js (for scripts and Electron)
process: "readonly",
require: "readonly",
__dirname: "readonly",
__filename: "readonly",
NodeJS: "readonly",
// React
React: "readonly",
JSX: "readonly",
// Electron
Electron: "readonly",
// Console
console: "readonly",
},
},
plugins: {
"@typescript-eslint": ts,