chore: replace Prettier with oxfmt and add oxlint (#6259)

* chore: replace Prettier with oxfmt and add oxlint

- Replace Prettier with oxfmt (Prettier-compatible formatter from OXC project)
- Add oxlint for fast linting alongside ESLint
- Add eslint-plugin-oxlint to disable ESLint rules covered by oxlint
- Update lint scripts to run oxfmt, oxlint, then eslint
- Update lint-staged configuration for pre-commit hooks
- Create .oxfmtrc.json and .oxlintrc.json configuration files
- Remove .prettierrc.json and .prettierignore
- Reformat codebase with oxfmt

* chore: update dependencies in yarn.lock

* chore: update oxlint configuration to disable additional rules

* chore: update oxfmt and oxlint configurations, enhance test readability
This commit is contained in:
Matiss Janis Aboltins
2025-12-04 19:55:10 +00:00
committed by GitHub
parent 76dadfa5fb
commit 879fd1b054
33 changed files with 1133 additions and 1692 deletions

View File

@@ -320,9 +320,9 @@ export const downloadBudget = createAppAsyncThunk(
const opts = {
hasExistingKey: Boolean(
error.meta &&
typeof error.meta === 'object' &&
'isMissingKey' in error.meta &&
error.meta.isMissingKey,
typeof error.meta === 'object' &&
'isMissingKey' in error.meta &&
error.meta.isMissingKey,
),
cloudFileId,
onSuccess: () => {

View File

@@ -132,7 +132,7 @@ function AppInner() {
initAll().catch(showErrorBoundary);
// Removed cloudFileId & t from dependencies to prevent hard crash when closing budget in Electron
// eslint-disable-next-line react-hooks/exhaustive-deps
// oxlint-disable-next-line react-hooks/exhaustive-deps
}, [dispatch, showErrorBoundary]);
useEffect(() => {

View File

@@ -70,7 +70,7 @@ export function MobileNavTabs() {
config: canceled ? config.wobbly : config.stiff,
});
},
[api, OPEN_FULL_Y],
[api],
);
const openDefault = useCallback(
@@ -82,7 +82,7 @@ export function MobileNavTabs() {
config: { ...config.stiff, velocity },
});
},
[api, OPEN_DEFAULT_Y],
[api],
);
const hide = useCallback(
@@ -94,7 +94,7 @@ export function MobileNavTabs() {
config: { ...config.stiff, velocity },
});
},
[api, HIDDEN_Y],
[api],
);
const navTabs = [

View File

@@ -381,7 +381,7 @@ function SelectedTransactionsFloatingActionBar({
const canMerge = useMemo(() => {
return Boolean(
twoTransactions &&
twoTransactions[0].amount === twoTransactions[1].amount,
twoTransactions[0].amount === twoTransactions[1].amount,
);
}, [twoTransactions]);

View File

@@ -95,8 +95,7 @@ export function CreateEncryptionKeyModal({
We will generate a key based on a password and use it to
encrypt from now on.{' '}
<strong>This requires a sync reset</strong> and all other
devices will have to revert to this version of your
data.{' '}
devices will have to revert to this version of your data.{' '}
</Trans>
<Link
variant="external"

View File

@@ -746,7 +746,6 @@ export function ImportTransactionsModal({
runImportPreview();
// intentionally exclude runImportPreview from dependencies to avoid infinite rerenders
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
filetype,
flipAmount,

View File

@@ -394,7 +394,6 @@ function CustomReportInner({ report: initialReport }: CustomReportInnerProps) {
run();
// omitted `conditions` and `conditionsOp` from dependencies to avoid infinite loops
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
interval,
dateRange,

View File

@@ -350,7 +350,6 @@ export function ScheduleEditModal({ id, transaction }: ScheduleEditModalProps) {
}
run();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useEffect(() => {

View File

@@ -138,7 +138,7 @@ export function SelectedTransactionsButton({
const canMerge = useMemo(() => {
return Boolean(
twoTransactions &&
twoTransactions[0].amount === twoTransactions[1].amount,
twoTransactions[0].amount === twoTransactions[1].amount,
);
}, [twoTransactions]);

View File

@@ -19,6 +19,5 @@ export function useEffectAfterMount(
return effect();
}
isFirstRender.current = false;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, deps);
}

View File

@@ -17,7 +17,6 @@ export function useQuery<Response = unknown>(
// Memo the resulting query. We don't care if the function
// that creates the query changes, only the resulting query.
// Safe to ignore the eslint warning here.
// eslint-disable-next-line react-hooks/exhaustive-deps
const query = useMemo(makeQuery, dependencies);
const [data, setData] = useState<ReadonlyArray<Response> | null>(null);