mirror of
https://github.com/Dvorinka/excalidraw-full.git
synced 2026-06-04 22:32:55 +00:00
refactor(frontend): improve type safety and migrate to ESLint 9
Migrate the frontend to ESLint 9, add `eslint.config.mjs`, and replace various `any` types with more specific or safer alternatives across the codebase. - Update `package.json` with new ESLint and TypeScript-ESLint dependencies - Replace `any` with `Record<string, unknown>` or specific types in `TemplatePicker`, `Editor`, and `FileBrowser` - Improve error handling in `TeamSettings` and `Templates` using type guards - Add explicit type imports for Excalidraw elements in `Editor.tsx` - Refactor `Modal.tsx` for cleaner conditional logic - Add `check` script to `package.json` for type checking
This commit is contained in:
@@ -273,7 +273,12 @@ export const FileBrowser: React.FC = () => {
|
||||
<select
|
||||
className={styles.filterSelect}
|
||||
value={visibilityFilter}
|
||||
onChange={(e) => setVisibilityFilter(e.target.value as any)}
|
||||
onChange={(e) => {
|
||||
const v = e.target.value;
|
||||
if (v === 'all' || v === 'private' || v === 'team' || v === 'public-link') {
|
||||
setVisibilityFilter(v);
|
||||
}
|
||||
}}
|
||||
aria-label="Filter by visibility"
|
||||
title="Filter by visibility"
|
||||
>
|
||||
@@ -287,8 +292,12 @@ export const FileBrowser: React.FC = () => {
|
||||
value={`${sortBy}-${sortOrder}`}
|
||||
onChange={(e) => {
|
||||
const [sb, so] = e.target.value.split('-');
|
||||
setSortBy(sb as any);
|
||||
setSortOrder(so as any);
|
||||
if (sb === 'name' || sb === 'updated' || sb === 'created') {
|
||||
setSortBy(sb);
|
||||
}
|
||||
if (so === 'asc' || so === 'desc') {
|
||||
setSortOrder(so);
|
||||
}
|
||||
}}
|
||||
aria-label="Sort drawings"
|
||||
title="Sort drawings"
|
||||
|
||||
Reference in New Issue
Block a user