mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
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:
@@ -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",
|
||||
{
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -25,7 +25,7 @@ type Props = Omit<
|
||||
|
||||
const EmojiMenu = (props: Props) => {
|
||||
const { emojis } = useStores();
|
||||
const { search = "" } = props;
|
||||
const { search } = props;
|
||||
|
||||
useEffect(() => {
|
||||
if (search) {
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const canonicalOrigin = canonicalUrl
|
||||
: window.location.origin;
|
||||
|
||||
type PathParams = {
|
||||
shareId: string;
|
||||
shareId?: string;
|
||||
collectionSlug?: string;
|
||||
documentSlug?: string;
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
}: {
|
||||
|
||||
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user