Remove unnecessary default parameter values from function signatures (#12617)

* Fix remaining no-useless-default-assignment lint warnings

* Promote no-useless-default-assignment lint rule to error
This commit is contained in:
Tom Moor
2026-06-07 15:46:01 -04:00
committed by GitHub
parent ac6b680cdb
commit 9b8acf3efb
11 changed files with 11 additions and 10 deletions
+1
View File
@@ -110,6 +110,7 @@
"typescript/consistent-type-imports": "error", "typescript/consistent-type-imports": "error",
"typescript/restrict-template-expressions": "error", "typescript/restrict-template-expressions": "error",
"typescript/no-floating-promises": "error", "typescript/no-floating-promises": "error",
"typescript/no-useless-default-assignment": "error",
"no-unused-vars": [ "no-unused-vars": [
"error", "error",
{ {
+1 -1
View File
@@ -15,7 +15,7 @@ export default function DesktopEventHandler() {
const hasDisabledUpdateMessage = useRef(false); const hasDisabledUpdateMessage = useRef(false);
useEffect(() => { useEffect(() => {
Desktop.bridge?.redirect((path: string, replace = false) => { Desktop.bridge?.redirect((path: string, replace: boolean) => {
if (replace) { if (replace) {
history.replace(path); history.replace(path);
} else { } else {
+1 -1
View File
@@ -44,7 +44,7 @@ type Props = {
const FilterOptions = ({ const FilterOptions = ({
options, options,
selectedKeys = [], selectedKeys,
className, className,
onSelect, onSelect,
showFilter, showFilter,
@@ -23,7 +23,7 @@ const SidebarButton = observer(
React.forwardRef<HTMLButtonElement, SidebarButtonProps>( React.forwardRef<HTMLButtonElement, SidebarButtonProps>(
function SidebarButton_( function SidebarButton_(
{ {
position = "top", position,
showMoreMenu, showMoreMenu,
image, image,
title, title,
+1 -1
View File
@@ -25,7 +25,7 @@ type Props = Omit<
const EmojiMenu = (props: Props) => { const EmojiMenu = (props: Props) => {
const { emojis } = useStores(); const { emojis } = useStores();
const { search = "" } = props; const { search } = props;
useEffect(() => { useEffect(() => {
if (search) { if (search) {
+1 -1
View File
@@ -400,7 +400,7 @@ function SuggestionsMenu<T extends MenuItem>(props: Props<T>) {
}; };
const filtered = React.useMemo(() => { const filtered = React.useMemo(() => {
const { embeds = [], search = "", uploadFile, filterable = true } = props; const { embeds = [], search, uploadFile, filterable = true } = props;
let items: (EmbedDescriptor | MenuItem)[] = [...props.items]; let items: (EmbedDescriptor | MenuItem)[] = [...props.items];
const embedItems: EmbedDescriptor[] = []; const embedItems: EmbedDescriptor[] = [];
+1 -1
View File
@@ -49,7 +49,7 @@ const canonicalOrigin = canonicalUrl
: window.location.origin; : window.location.origin;
type PathParams = { type PathParams = {
shareId: string; shareId?: string;
collectionSlug?: string; collectionSlug?: string;
documentSlug?: string; documentSlug?: string;
}; };
+1 -1
View File
@@ -24,7 +24,7 @@ async function documentMover(
ctx: APIContext, ctx: APIContext,
{ {
document, document,
collectionId = null, collectionId,
parentDocumentId = null, parentDocumentId = null,
// convert undefined to null so parentId comparison treats them as equal // convert undefined to null so parentId comparison treats them as equal
index, index,
+1 -1
View File
@@ -17,7 +17,7 @@ export function presentDCRClient(
baseUrl: string, baseUrl: string,
oauthClient: OAuthClient, oauthClient: OAuthClient,
{ {
includeRegistrationAccessToken = false, includeRegistrationAccessToken,
includeCredentials = false, includeCredentials = false,
}: { }: {
includeRegistrationAccessToken: boolean; includeRegistrationAccessToken: boolean;
@@ -26,7 +26,7 @@ export default abstract class ExportDocumentTreeTask extends ExportTask {
zip, zip,
pathInZip, pathInZip,
documentId, documentId,
format = FileOperationFormat.MarkdownZip, format,
includeAttachments, includeAttachments,
pathMap, pathMap,
}: { }: {
+1 -1
View File
@@ -29,7 +29,7 @@ router.post(
auth(), auth(),
validate(T.CreateTestUsersSchema), validate(T.CreateTestUsersSchema),
async (ctx: APIContext<T.CreateTestUsersReq>) => { async (ctx: APIContext<T.CreateTestUsersReq>) => {
const { count = 10 } = ctx.input.body; const { count } = ctx.input.body;
const invites = Array(Math.min(count, 100)) const invites = Array(Math.min(count, 100))
.fill(0) .fill(0)
.map(() => { .map(() => {