Skip to content

Commit

Permalink
Remove unused args
Browse files Browse the repository at this point in the history
  • Loading branch information
jaas666 committed Nov 18, 2023
1 parent 855e727 commit 2ed0cc3
Show file tree
Hide file tree
Showing 76 changed files with 120 additions and 147 deletions.
4 changes: 2 additions & 2 deletions packages/desktop-client/craco.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (process.env.REVIEW_ID) {

module.exports = {
webpack: {
configure: (webpackConfig, { env, paths }) => {
configure: webpackConfig => {
webpackConfig.mode =
process.env.NODE_ENV === 'development' ? 'development' : 'production';

Expand Down Expand Up @@ -92,7 +92,7 @@ module.exports = {
return webpackConfig;
},
},
devServer: (devServerConfig, { env, paths, proxy, allowedHost }) => {
devServer: devServerConfig => {
devServerConfig.onBeforeSetupMiddleware = server => {
chokidar
.watch([
Expand Down
10 changes: 5 additions & 5 deletions packages/desktop-client/src/browser-preload.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ global.Actual = {
window.location.reload();
},

openFileDialog: async ({ filters = [], properties }) => {
openFileDialog: async ({ filters = [] }) => {
return new Promise(resolve => {
let createdElement = false;
// Attempt to reuse an already-created file input.
Expand Down Expand Up @@ -91,7 +91,7 @@ global.Actual = {
.uploadFile(filename, ev.target.result)
.then(() => resolve([filepath]));
};
reader.onerror = function (ev) {
reader.onerror = function () {
alert('Error reading file');
};
}
Expand All @@ -107,7 +107,7 @@ global.Actual = {
});
},

saveFile: (contents, defaultFilename, dialogTitle) => {
saveFile: (contents, defaultFilename) => {
const temp = document.createElement('a');
temp.style = 'display: none';
temp.download = defaultFilename;
Expand All @@ -121,9 +121,9 @@ global.Actual = {
openURLInBrowser: url => {
window.open(url, '_blank');
},
onEventFromMain: (type, handler) => {},
onEventFromMain: () => {},
applyAppUpdate: () => {},
updateAppMenu: isBudgetOpen => {},
updateAppMenu: () => {},

getServerSocket: async () => {
return worker;
Expand Down
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/FixedSizeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import View from './common/View';

const IS_SCROLLING_DEBOUNCE_INTERVAL = 150;

const defaultItemKey = (index, data) => index;
const defaultItemKey = index => index;

function ResizeObserver({ onResize, children }) {
let ref = useResizeObserver(onResize);
Expand Down Expand Up @@ -241,7 +241,7 @@ export default class FixedSizeList extends PureComponent {
}
};

onHeaderResize = rect => {
onHeaderResize = () => {
// this.setState({ headerHeight: rect.height });
};

Expand All @@ -268,7 +268,7 @@ export default class FixedSizeList extends PureComponent {
}

getItemOffset = index => index * this.props.itemSize;
getItemSize = index => this.props.itemSize;
getItemSize = () => this.props.itemSize;
getEstimatedTotalSize = () => this.props.itemSize * this.props.itemCount;

getOffsetForIndexAndAlignment = (index, align, scrollOffset) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/ManageRules.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function ManageRulesContent({
onSave: async newRule => {
let newRules = await loadRules();

setRules(rules => {
setRules(() => {
let newIdx = newRules.findIndex(rule => rule.id === newRule.id);
return newRules.slice(0, newIdx + 75);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/accounts/Account.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class AccountInternal extends PureComponent {
}
};

let onUndo = async ({ tables, messages, undoTag }) => {
let onUndo = async ({ tables, messages }) => {
await maybeRefetch(tables);

// If all the messages are dealing with transactions, find the
Expand Down Expand Up @@ -514,7 +514,7 @@ class AccountInternal extends PureComponent {
});
}
},
mappedData => {
() => {
return data;
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const getSchedulesTransform = memoizeOne((id, hasSearch) => {
};
});

function PreviewTransactions({ accountId, children }) {
function PreviewTransactions({ children }) {
let scheduleData = useCachedSchedules();

if (scheduleData == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function AccountCard({ account, updated, getBalanceQuery, onSelect }) {
);
}

function EmptyMessage({ onAdd }) {
function EmptyMessage() {
return (
<View style={{ flex: 1, padding: 30 }}>
<Text style={styles.text}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ class Budget extends Component {

return (
<SyncRefresh onSync={this.sync}>
{({ refreshing, onRefresh }) => (
{({ onRefresh }) => (
<BudgetTable
// This key forces the whole table rerender when the number
// format changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function BudgetCell({
});
}

function onAmountClick(e) {
function onAmountClick() {
onEdit?.(categoryId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function SidebarCategory({
>
<InputCell
value={category.name}
formatter={value => displayed}
formatter={() => displayed}
width="flex"
exposed={editing || temporary}
onUpdate={value => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function SidebarGroup({
dragPreview,
innerRef,
style,
borderColor = theme.tableBorder,
onEdit,
onSave,
onDelete,
Expand All @@ -62,7 +61,7 @@ function SidebarGroup({
userSelect: 'none',
WebkitUserSelect: 'none',
}}
onClick={e => {
onClick={() => {
onToggleCollapse(group.id);
}}
>
Expand Down Expand Up @@ -168,7 +167,7 @@ function SidebarGroup({
>
<InputCell
value={group.name}
formatter={value => displayed}
formatter={() => displayed}
width="flex"
exposed={editing}
onUpdate={value => {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/budget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ const RolloverBudgetSummary = memo<{ month: string }>(props => {
);
});

export default function BudgetWrapper(props) {
export default function BudgetWrapper() {
let startMonth = useSelector(state => state.prefs.local['budget.startMonth']);
let collapsedPrefs = useSelector(
state => state.prefs.local['budget.collapsed'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function BalanceTooltip({
onClose={tooltip.close}
>
<Menu
onMenuSelect={type => {
onMenuSelect={() => {
onBudgetAction(monthIndex, 'carryover', {
category: categoryId,
flag: !carryover,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export function BudgetSummary({
} = useRollover();

let [menuOpen, setMenuOpen] = useState(false);
function onMenuOpen(e) {
function onMenuOpen() {
setMenuOpen(true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function CoverTooltip({
categoryGroups={categoryGroups}
value={null}
openOnFocus={true}
onUpdate={id => {}}
onUpdate={() => {}}
onSelect={id => setCategory(id)}
inputProps={{
inputRef: node,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function TransferTooltip({
categoryGroups={categoryGroups}
value={null}
openOnFocus={true}
onUpdate={id => {}}
onUpdate={() => {}}
onSelect={id => setCategory(id)}
inputProps={{ onEnter: submit, placeholder: '(none)' }}
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-client/src/components/common/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default function Menu({
}}
onMouseEnter={() => setHoveredIndex(idx)}
onMouseLeave={() => setHoveredIndex(null)}
onClick={e =>
onClick={() =>
!item.disabled && onMenuSelect && onMenuSelect(item.name)
}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AmountInput extends PureComponent {
}
}

componentDidUpdate(prevProps, prevState) {
componentDidUpdate(prevProps, _prevState) {
if (!prevProps.focused && this.props.focused) {
this.focus();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/desktop-client/src/components/modals/EditRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function OpSelect({
);
}

function EditorButtons({ onAdd, onDelete, style }) {
function EditorButtons({ onAdd, onDelete }) {
return (
<>
{onDelete && (
Expand Down Expand Up @@ -309,7 +309,7 @@ let actionFields = [
'date',
'amount',
].map(field => [field, mapField(field)]);
function ActionEditor({ ops, action, editorStyle, onChange, onDelete, onAdd }) {
function ActionEditor({ action, editorStyle, onChange, onDelete, onAdd }) {
let { field, op, value, type, error, inputKey = 'initial' } = action;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function getFileType(filepath) {
return rawType;
}

function ParsedDate({ parseDateFormat, showParsed, dateFormat, date }) {
function ParsedDate({ parseDateFormat, dateFormat, date }) {
let parsed =
date &&
formatDate(
Expand Down Expand Up @@ -185,29 +185,29 @@ function getInitialMappings(transactions) {
}

let dateField = key(
fields.find(([name, value]) => name.toLowerCase().includes('date')) ||
fields.find(([name, value]) => value.match(/^\d+[-/]\d+[-/]\d+$/)),
fields.find(([name]) => name.toLowerCase().includes('date')) ||
fields.find(([value]) => value.match(/^\d+[-/]\d+[-/]\d+$/)),
);

let amountField = key(
fields.find(([name, value]) => name.toLowerCase().includes('amount')) ||
fields.find(([name, value]) => value.match(/^-?[.,\d]+$/)),
fields.find(([name]) => name.toLowerCase().includes('amount')) ||
fields.find(([value]) => value.match(/^-?[.,\d]+$/)),
);

let payeeField = key(
fields.find(([name, value]) => name !== dateField && name !== amountField),
fields.find(([name]) => name !== dateField && name !== amountField),
);

let notesField = key(
fields.find(
([name, value]) =>
([name]) =>
name !== dateField && name !== amountField && name !== payeeField,
),
);

let inOutField = key(
fields.find(
([name, value]) =>
([name]) =>
name !== dateField &&
name !== amountField &&
name !== payeeField &&
Expand Down Expand Up @@ -974,7 +974,7 @@ export default function ImportTransactions({ modalProps, options }) {
</View>
);
}}
renderItem={({ key, style, item, editing, focusedField }) => (
renderItem={({ key, style, item }) => (
<View key={key} style={style}>
<Transaction
transaction={item}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function SingleInput({
paddingBottom: 15,
}}
>
<Button onPointerUp={e => _onSubmit(value)}>{buttonText}</Button>
<Button onPointerUp={() => _onSubmit(value)}>{buttonText}</Button>
</View>
</>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function ManagePayeesWithData({ initialSelectedIds }) {
};
}, []);

async function onUndo({ tables, messages, meta, url }, scroll = false) {
async function onUndo({ tables, messages, meta }, _scroll = false) {
if (!tables.includes('payees') && !tables.includes('payee_mapping')) {
return;
}
Expand Down
1 change: 0 additions & 1 deletion packages/desktop-client/src/components/payees/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ const PayeeTable = forwardRef(
navigator,
categoryGroups,
highlightedRows,
ruleActions,
onUpdate,
onViewRules,
onCreateRule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default function CategorySelector({
<Checkbox
id={`form_${categoryGroup.id}`}
checked={allCategoriesInGroupSelected}
onChange={e => {
onChange={() => {
const selectedCategoriesExcludingGroupCategories =
selectedCategories.filter(
selectedCategory =>
Expand Down Expand Up @@ -118,7 +118,7 @@ export default function CategorySelector({
paddingLeft: 10,
}}
>
{categoryGroup.categories.map((category, index) => {
{categoryGroup.categories.map(category => {
const isChecked = selectedCategories.some(
selectedCategory => selectedCategory.id === category.id,
);
Expand All @@ -135,7 +135,7 @@ export default function CategorySelector({
<Checkbox
id={`form_${category.id}`}
checked={isChecked}
onChange={e => {
onChange={() => {
if (isChecked) {
setSelectedCategories(
selectedCategories.filter(
Expand Down
1 change: 0 additions & 1 deletion packages/desktop-client/src/components/reports/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ function Header({
onDeleteFilter,
onCondOpChange,
headerPrefixItems,
selectGraph,
}) {
let location = useLocation();
let path = location.pathname;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export function ReportSidebar({
allMonths,
graphType,
setGraphType,
setViewLegend,
typeDisabled,
setTypeDisabled,
groupBy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export function ReportSummary({
);
}

export function ReportLegend({ data, legend, groupBy }) {
export function ReportLegend({ legend, groupBy }) {
return (
<View
style={{
Expand Down
Loading

0 comments on commit 2ed0cc3

Please sign in to comment.