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