Update linting rules and replace @ts-ignore with @ts-expect-error (#6636)

* Update linting rules and replace @ts-ignore with @ts-expect-error

* Add release notes for PR #6636

* Fix TypeScript linting issue by adding @ts-ignore for electron types in server start message

* Change category to Maintenance and update linting rules

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Matiss Janis Aboltins
2026-01-13 22:53:14 +01:00
committed by GitHub
parent 5d82435700
commit 0c3a515e29
13 changed files with 22 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import type {
// loot-core types
import type { InitConfig } from 'loot-core/server/main';
// oxlint-disable-next-line typescript/ban-ts-comment
// @ts-ignore: bundle not available until we build it
import * as bundle from './app/bundle.api.js';
import * as injected from './injected';

View File

@@ -1,3 +1,4 @@
// oxlint-disable-next-line typescript/ban-ts-comment
// @ts-ignore: bundle not available until we build it
import * as bundle from './app/bundle.api.js';

View File

@@ -1841,7 +1841,7 @@ class AccountInternal extends PureComponent<
<View style={{ flex: 1 }}>
<TransactionList
headerContent={undefined}
// @ts-ignore TODO
// @ts-expect-error - fix me
tableRef={this.table}
account={account}
transactions={transactions}

View File

@@ -43,7 +43,7 @@ export const PayeeFilter = ({ value, op, onChange }: PayeeFilterProps) => {
multi && coercedValue.length > 0 ? undefined : t('nothing');
return (
// @ts-ignore: typing is not playing nicely with the union type of AutocompleteProps.
// @ts-expect-error: typing is not playing nicely with the union type of AutocompleteProps.
<PayeeAutocomplete
type={multi ? 'multi' : 'single'}
showInactivePayees

View File

@@ -76,9 +76,9 @@ async function saveDiffAndApply(diff, changes, onChange, learnCategories) {
const remoteDiff = await saveDiff(diff, learnCategories);
onChange(
// TODO:
// @ts-ignore testing
// @ts-expect-error - fix me
applyTransactionDiff(changes.newTransaction, remoteDiff),
// @ts-ignore testing
// @ts-expect-error - fix me
applyChanges(remoteDiff, changes.data),
);
}

View File

@@ -209,7 +209,7 @@ function LiveTransactionTable(props: LiveTransactionTableProps) {
{...props}
transactions={transactions}
loadMoreTransactions={vi.fn()}
// @ts-ignore TODO:
// @ts-expect-error TODO: fix me
commonPayees={[]}
payees={payees}
addNotification={console.log}

View File

@@ -30,8 +30,9 @@ module.exports = {
!value.includes('\u2019') &&
!value.includes('\u201C') &&
!value.includes('\u201D')
)
) {
return;
}
let rawText = context.getSourceCode().getText(node);
const originalRawText = rawText;

View File

@@ -381,7 +381,6 @@ describe('CategoryTemplateContext', () => {
amount: 1000,
from: '2023-11',
month: '2023-12',
//@ts-ignore this is what the template expects
repeat: 3,
directive: 'template',
priority: 1,

View File

@@ -4,7 +4,7 @@ import * as jspb from 'google-protobuf';
if (typeof globalThis !== 'undefined') {
// Add a basic require polyfill for CommonJS modules
if (typeof globalThis.require === 'undefined') {
// @ts-ignore - we're creating a minimal require implementation
// @ts-expect-error - we're creating a minimal require implementation
globalThis.require = (moduleId: string) => {
switch (moduleId) {
case 'google-protobuf':
@@ -21,7 +21,6 @@ if (typeof globalThis !== 'undefined') {
// Also set on global for compatibility
if (typeof global !== 'undefined') {
if (typeof global.require === 'undefined') {
// @ts-ignore - assigning minimal require implementation to global
global.require = globalThis.require;
}
}

View File

@@ -261,13 +261,13 @@ export function getRecurringDescription(
export function recurConfigToRSchedule(config) {
const base: IRuleOptions = {
start: monthUtils.parseDate(config.start),
// @ts-ignore: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
// @ts-expect-error: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
frequency: config.frequency.toUpperCase(),
byHourOfDay: [12],
};
if (config.interval) {
// @ts-ignore: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
// @ts-expect-error: issues with https://gitlab.com/john.carroll.p/rschedule/-/issues/86
base.interval = config.interval;
}

View File

@@ -163,6 +163,7 @@ function parseHTTPSConfig(value: string) {
function sendServerStartedMessage() {
// Signify to any parent process that the server has started. Used in electron desktop app
// oxlint-disable-next-line typescript/ban-ts-comment
// @ts-ignore-error electron types
process.parentPort?.postMessage({ type: 'server-started' });
console.log(