Improve eslint rules for unused vars

This commit is contained in:
Alex Gleason 2025-06-01 17:28:25 -05:00
parent 8bdff8da6d
commit 1fc548c7e9
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
4 changed files with 14 additions and 16 deletions

View File

@ -27,7 +27,14 @@ export default tseslint.config(
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true,
},
],
"custom/no-placeholder-comments": "error",
"no-warning-comments": [
"error",

View File

@ -73,7 +73,7 @@ export function NoteContent({
</Link>
);
}
} catch (e) {
} catch {
// If decoding fails, just render as text
parts.push(fullMatch);
}

View File

@ -1,7 +1,7 @@
// NOTE: This file is stable and usually should not be modified.
// It is important that all functionality in this file is preserved, and should only be modified if explicitly requested.
import React, { useEffect, useRef, useState } from 'react';
import React, { useRef, useState } from 'react';
import { Shield, Upload } from 'lucide-react';
import { Button } from '@/components/ui/button.tsx';
import { Input } from '@/components/ui/input.tsx';

View File

@ -15,13 +15,6 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement
}
const actionTypes = {
ADD_TOAST: "ADD_TOAST",
UPDATE_TOAST: "UPDATE_TOAST",
DISMISS_TOAST: "DISMISS_TOAST",
REMOVE_TOAST: "REMOVE_TOAST",
} as const
let count = 0
function genId() {
@ -29,23 +22,21 @@ function genId() {
return count.toString()
}
type ActionType = typeof actionTypes
type Action =
| {
type: ActionType["ADD_TOAST"]
type: "ADD_TOAST";
toast: ToasterToast
}
| {
type: ActionType["UPDATE_TOAST"]
type: "UPDATE_TOAST";
toast: Partial<ToasterToast>
}
| {
type: ActionType["DISMISS_TOAST"]
type: "DISMISS_TOAST";
toastId?: ToasterToast["id"]
}
| {
type: ActionType["REMOVE_TOAST"]
type: "REMOVE_TOAST";
toastId?: ToasterToast["id"]
}