diff --git a/eslint.config.mjs b/eslint.config.mjs index 2072d7bcf..efbb22aff 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -35,6 +35,18 @@ export default defineConfig([ rules: { ...reactRefresh.configs.recommended.rules, ...reactHooks.configs.flat.recommended.rules, + // Allow route files to export `Route = createFileRoute(...)(...)` + // alongside their component, and allow shared constants in + // component files. The TanStack helpers aren't real React HOCs, + // but listing them here matches our project convention of + // co-locating the component with the route definition. + 'react-refresh/only-export-components': [ + 'error', + { + allowConstantExport: true, + extraHOCs: ['createFileRoute', 'createRootRouteWithContext'], + }, + ], }, }, { diff --git a/package.json b/package.json index f085cd28f..92be8ead3 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "electron": "41.5.1", "eslint": "^9.39.4", "eslint-plugin-react-hooks": "~7.1.1", - "eslint-plugin-react-refresh": "^0.4.19", + "eslint-plugin-react-refresh": "^0.5.2", "globals": "^17.6.0", "husky": "^9.1.7", "icon-gen": "^5.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2fb527a09..2f125689e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -334,8 +334,8 @@ importers: specifier: ~7.1.1 version: 7.1.1(eslint@9.39.4(jiti@2.7.0)) eslint-plugin-react-refresh: - specifier: ^0.4.19 - version: 0.4.26(eslint@9.39.4(jiti@2.7.0)) + specifier: ^0.5.2 + version: 0.5.2(eslint@9.39.4(jiti@2.7.0)) globals: specifier: ^17.6.0 version: 17.6.0 @@ -4796,10 +4796,10 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 || ^10.0.0 - eslint-plugin-react-refresh@0.4.26: - resolution: {integrity: sha512-1RETEylht2O6FM/MvgnyvT+8K21wLqDNg4qD51Zj3guhjt433XbnnkVttHMyaVyAFD03QSV4LPS5iE3VQmO7XQ==} + eslint-plugin-react-refresh@0.5.2: + resolution: {integrity: sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA==} peerDependencies: - eslint: '>=8.40' + eslint: ^9 || ^10 eslint-scope@5.1.1: resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} @@ -13238,7 +13238,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-react-refresh@0.4.26(eslint@9.39.4(jiti@2.7.0)): + eslint-plugin-react-refresh@0.5.2(eslint@9.39.4(jiti@2.7.0)): dependencies: eslint: 9.39.4(jiti@2.7.0) diff --git a/renderer/src/common/components/ui/pagination-constants.ts b/renderer/src/common/components/ui/pagination-constants.ts new file mode 100644 index 000000000..75ce90e33 --- /dev/null +++ b/renderer/src/common/components/ui/pagination-constants.ts @@ -0,0 +1 @@ +export const DEFAULT_PAGE_SIZE_OPTIONS = [12, 24, 50, 100] as const diff --git a/renderer/src/common/components/ui/pagination.tsx b/renderer/src/common/components/ui/pagination.tsx index 7c19f825e..156eb0c06 100644 --- a/renderer/src/common/components/ui/pagination.tsx +++ b/renderer/src/common/components/ui/pagination.tsx @@ -14,8 +14,7 @@ import { SelectTrigger, SelectValue, } from '@/common/components/ui/select' - -export const DEFAULT_PAGE_SIZE_OPTIONS = [12, 24, 50, 100] as const +import { DEFAULT_PAGE_SIZE_OPTIONS } from './pagination-constants' type PaginationProps = { page: number diff --git a/renderer/src/features/skills/lib/registry-pagination.ts b/renderer/src/features/skills/lib/registry-pagination.ts index 604f3f37e..d850e4bd5 100644 --- a/renderer/src/features/skills/lib/registry-pagination.ts +++ b/renderer/src/features/skills/lib/registry-pagination.ts @@ -1,4 +1,4 @@ -import { DEFAULT_PAGE_SIZE_OPTIONS } from '@/common/components/ui/pagination' +import { DEFAULT_PAGE_SIZE_OPTIONS } from '@/common/components/ui/pagination-constants' export const REGISTRY_PAGE_SIZE_OPTIONS = DEFAULT_PAGE_SIZE_OPTIONS export const DEFAULT_REGISTRY_PAGE_SIZE: (typeof REGISTRY_PAGE_SIZE_OPTIONS)[number] = 24