Cleanup unused Javascript (#3027)

* chore(js): be stricter about dead code warnings

* chore(js): remove dead code and unused exports

* rebase

* chore: remove unused files

* chore(deps): remove unused prop-types dep

* chore(js): remove unused function

* chore(deps): remove + check unused deps

* chore(js): remove unused exports. Closes #3036
This commit is contained in:
Gabe Kangas
2023-05-20 21:15:25 -07:00
committed by GitHub
parent 429289d508
commit e50b23d081
55 changed files with 1187 additions and 1071 deletions

View File

@@ -189,7 +189,7 @@ const AccessTokens = () => {
{
title: '',
key: 'delete',
render: (text, record) => (
render: (_, record) => (
<Space size="middle">
<Button onClick={() => handleDeleteToken(record.accessToken)} icon={<DeleteOutlined />} />
</Space>

View File

@@ -256,7 +256,7 @@ const Actions = () => {
});
}
async function handleDelete(action, index) {
async function handleDelete(index) {
const actionsData = [...actions];
actionsData.splice(index, 1);
@@ -269,7 +269,7 @@ const Actions = () => {
}
async function handleSave(
oldAction: ExternalAction | null,
_oldAction: ExternalAction | null,
oldActionIndex: number,
url: string,
html: string,
@@ -353,9 +353,9 @@ const Actions = () => {
{
title: '',
key: 'delete-edit',
render: (text, record, index) => (
render: (_, record, index) => (
<Space size="middle">
<Button onClick={() => handleDelete(record, index)} icon={<DeleteOutlined />} />
<Button onClick={() => handleDelete(index)} icon={<DeleteOutlined />} />
<Button onClick={() => handleEdit(record, index)} icon={<EditOutlined />} />
</Space>
),
@@ -374,7 +374,7 @@ const Actions = () => {
title: 'URL / Embed',
key: 'url',
dataIndex: 'url',
render: (text, record) => (record.html ? 'HTML embed' : record.url),
render: (_, record) => (record.html ? 'HTML embed' : record.url),
},
{
title: 'Icon',

View File

@@ -12,9 +12,10 @@ import {
STATUS_SUCCESS,
} from '../../../utils/input-statuses';
import { RESET_TIMEOUT } from '../../../utils/config-constants';
import { URL_CUSTOM_EMOJIS } from '../../../utils/constants';
import { AdminLayout } from '../../../components/layouts/AdminLayout';
const URL_CUSTOM_EMOJIS = `/api/emoji`;
const { Meta } = Card;
// Lazy loaded components

View File

@@ -2,9 +2,9 @@ import { Alert, Button, Col, Row, Typography } from 'antd';
import React, { ReactElement, useContext, useEffect, useState } from 'react';
import Link from 'next/link';
import Discord from '../../components/admin/notification/discord';
import Browser from '../../components/admin/notification/browser';
import Federation from '../../components/admin/notification/federation';
import { DiscordNotify as Discord } from '../../components/admin/notification/discord';
import { BrowserNotify as Browser } from '../../components/admin/notification/browser';
import { FediverseNotify as Federation } from '../../components/admin/notification/federation';
import {
TextFieldWithSubmit,
TEXTFIELD_TYPE_URL,

View File

@@ -195,7 +195,7 @@ const Webhooks = () => {
{
title: '',
key: 'delete',
render: (text, record) => (
render: (_, record) => (
<Space size="middle">
<Button onClick={() => handleDelete(record.id)} icon={<DeleteOutlined />} />
</Space>