mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 06:03:01 -05:00
Lint: simplify ESLint config and add oxlint configuration (#6443)
* Simplify ESLint config and add oxlint configuration - Switch from typescript-eslint recommended to base config - Remove redundant TypeScript-specific rules that are handled by base config - Add oxlint configuration with appropriate rules - Simplify globals configuration using globals package - Add coverage directory to ESLint ignores - Clean up various TypeScript rule configurations * Add release notes for PR #6443 * [autofix.ci] apply automated fixes * Refactor release note generator and update CLI argument parsing - Adjusted the release note generator to fix string formatting. - Refactored CLI argument parsing in migrate/cli.ts to use parseSync for improved clarity and consistency. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a0850eab17
commit
05735eb55d
117
.oxlintrc.json
117
.oxlintrc.json
@@ -1,6 +1,17 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"plugins": ["react", "typescript", "import", "jsx-a11y"],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"jest": true,
|
||||
"node": true
|
||||
},
|
||||
"globals": {
|
||||
"vi": "readonly",
|
||||
"backend": "readonly",
|
||||
"importScripts": "readonly",
|
||||
"FS": "readonly" // TODO: remove this
|
||||
},
|
||||
"rules": {
|
||||
// TODO fix all these and re-enable
|
||||
"jsx-a11y/click-events-have-key-events": "off",
|
||||
@@ -11,7 +22,45 @@
|
||||
"no-var": "warn",
|
||||
|
||||
// JSX A11y rules
|
||||
"jsx-a11y/no-autofocus": ["warn", { "ignoreNonDOM": true }],
|
||||
"jsx-a11y/no-autofocus": [
|
||||
"warn",
|
||||
{
|
||||
"ignoreNonDOM": true
|
||||
}
|
||||
],
|
||||
|
||||
// Typescript rules
|
||||
"typescript/ban-ts-comment": [
|
||||
"warn",
|
||||
{
|
||||
// TODO: remove this
|
||||
"ts-ignore": "allow-with-description"
|
||||
}
|
||||
],
|
||||
"typescript/consistent-type-definitions": ["warn", "type"],
|
||||
"typescript/consistent-type-imports": [
|
||||
"warn",
|
||||
{
|
||||
"prefer": "type-imports",
|
||||
"fixStyle": "inline-type-imports"
|
||||
}
|
||||
],
|
||||
"typescript/no-explicit-any": "warn",
|
||||
"typescript/no-restricted-types": [
|
||||
"warn",
|
||||
{
|
||||
"types": {
|
||||
// forbid FC as superfluous
|
||||
"FunctionComponent": {
|
||||
"message": "Type the props argument and let TS infer or use ComponentType for a component prop"
|
||||
},
|
||||
"FC": {
|
||||
"message": "Type the props argument and let TS infer or use ComponentType for a component prop"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typescript/no-var-requires": "warn",
|
||||
|
||||
// Import rules
|
||||
"import/first": "error",
|
||||
@@ -65,6 +114,14 @@
|
||||
"react/style-prop-object": "warn",
|
||||
|
||||
// ESLint rules
|
||||
"eslint/default-case": [
|
||||
"warn",
|
||||
{
|
||||
"commentPattern": "^no default$"
|
||||
}
|
||||
],
|
||||
"eslint/no-array-constructor": "warn",
|
||||
// "eslint/no-empty-function": "warn", // TODO: enable this
|
||||
"eslint/no-redeclare": "warn",
|
||||
"eslint/no-regex-spaces": "warn",
|
||||
"eslint/no-restricted-globals": [
|
||||
@@ -175,7 +232,10 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"eslint/no-useless-constructor": "warn",
|
||||
"eslint/no-undef": "warn",
|
||||
"eslint/no-unused-expressions": "warn"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
@@ -230,7 +290,6 @@
|
||||
"react/exhaustive-deps": "off"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"files": [
|
||||
"packages/api/migrations/*",
|
||||
@@ -241,6 +300,58 @@
|
||||
"rules": {
|
||||
"import/no-default-export": "off"
|
||||
}
|
||||
},
|
||||
// TODO: enable these
|
||||
{
|
||||
"files": [
|
||||
"packages/api/**",
|
||||
"packages/component-library/**",
|
||||
"packages/crdt/**",
|
||||
"packages/desktop-electron/**",
|
||||
"packages/desktop-client/vite.config.mts",
|
||||
"packages/loot-core/**",
|
||||
"packages/sync-server/**"
|
||||
],
|
||||
"rules": {
|
||||
"typescript/consistent-type-imports": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"packages/api/**",
|
||||
"packages/component-library/**",
|
||||
"packages/loot-core/src/server/**",
|
||||
"packages/loot-core/src/types/**",
|
||||
"packages/sync-server/**",
|
||||
"packages/loot-core/typings/window.ts"
|
||||
],
|
||||
"rules": {
|
||||
"typescript/consistent-type-definitions": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"packages/desktop-client/src/components/budget/envelope/budgetsummary/BudgetMonthMenu.tsx",
|
||||
"packages/desktop-client/src/components/budget/tracking/budgetsummary/BudgetMonthMenu.tsx",
|
||||
"packages/desktop-client/src/components/HelpMenu.tsx",
|
||||
"packages/desktop-client/src/components/mobile/budget/CategoryGroupActionMenu.tsx",
|
||||
"packages/desktop-client/src/components/modals/SelectLinkedAccountsModal.tsx",
|
||||
"packages/desktop-client/src/components/reports/Overview.tsx",
|
||||
"packages/desktop-client/src/components/reports/reports/CustomReport.tsx",
|
||||
"packages/desktop-client/src/components/reports/reports/CustomReportListCards.tsx",
|
||||
"packages/desktop-client/src/components/reports/reports/MissingReportCard.tsx",
|
||||
"packages/desktop-client/src/components/reports/util.ts",
|
||||
"packages/desktop-client/src/components/sidebar/Account.tsx",
|
||||
"packages/desktop-client/src/hooks/useSplitsExpanded.tsx",
|
||||
"packages/loot-core/src/server/budget/category-template-context.ts",
|
||||
"packages/loot-core/src/server/budget/schedule-template.ts",
|
||||
"packages/loot-core/src/server/importers/ynab5.ts",
|
||||
"packages/loot-core/src/server/rules/action.ts",
|
||||
"packages/loot-core/src/shared/schedules.ts"
|
||||
],
|
||||
"rules": {
|
||||
"eslint/default-case": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user