@dloizides/frontend-devtools 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/rules/enforce-function-style.js","../../src/rules/enforce-module-structure.js","../../src/rules/enforce-route-preload.js","../../src/rules/enforce-test-colocation.js","../../src/rules/enum-file-isolation.js","../../src/rules/i18n-interpolation.js","../../src/rules/i18n-param-names.js","../../src/rules/no-barrel-companion-file.js","../../src/rules/no-duplicate-nav-prefix.js","../../src/rules/no-duplicate-shared-patterns.js","../../src/rules/no-generated-models-barrel-value-import.js","../../src/rules/no-null-check.js","../../src/rules/no-optional-undefined.js","../../src/rules/no-product-imports-in-shared.js","../../src/rules/no-raw-color-literal.js","../../src/rules/prefer-const-enum.js","../../src/rules/require-stable-hook-args.js","../../src/rules/smart-max-lines.js","../../src/eslint/plugin.ts","../../src/eslint/legacy.ts"],"names":["readdirSync","sep","posix","dirname","basename","fs","path","rule","join","existsSync","normalizePath","isJSX","expressionReturnsJSX","blockReturnsJSX"],"mappings":";;;;;;;;;;;AAoBA,SAAS,MAAM,IAAA,EAAM;AACnB,EAAA,OAAO,IAAA,KAAS,IAAA,CAAK,IAAA,KAAS,YAAA,IAAgB,KAAK,IAAA,KAAS,aAAA,CAAA;AAC9D;AAEA,SAAS,qBAAqB,IAAA,EAAM;AAClC,EAAA,IAAI,CAAC,MAAM,OAAO,KAAA;AAClB,EAAA,IAAI,KAAA,CAAM,IAAI,CAAA,EAAG,OAAO,IAAA;AACxB,EAAA,IAAI,KAAK,IAAA,KAAS,uBAAA;AAChB,IAAA,OAAO,qBAAqB,IAAA,CAAK,UAAU,CAAA,IAAK,oBAAA,CAAqB,KAAK,SAAS,CAAA;AACrF,EAAA,IAAI,KAAK,IAAA,KAAS,mBAAA;AAChB,IAAA,OAAO,qBAAqB,IAAA,CAAK,IAAI,CAAA,IAAK,oBAAA,CAAqB,KAAK,KAAK,C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,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,EAAS,OAAA,EAAQ;AAAA,IAC/B,KAAA,EAAO,EAAE,CAAC,IAAI,GAAGA,KAAAA;AAAK,GACxB;AACF","file":"index.js","sourcesContent":["/**\r\n * Custom ESLint Plugin: Enforce Function Style & Ordering\r\n *\r\n * Two independent checks controlled by options:\r\n *\r\n * 1. **checkStyle** — Multi-statement functions must use `function` declarations,\r\n * not `const`-assigned arrow/function expressions. Single-expression arrows\r\n * are fine (concise one-liners). React components are exempt (enforced by\r\n * `react/function-component-definition`). Closures/callbacks are exempt.\r\n *\r\n * 2. **checkOrdering** — Module-level constants must appear before functions and\r\n * exports. Functions and exports may be freely interleaved.\r\n * Imports, type declarations, and re-exports are exempt.\r\n * This order is compatible with @typescript-eslint/no-use-before-define.\r\n */\r\n\r\n// ---------------------------------------------------------------------------\r\n// Helpers – JSX detection (borrowed from smart-max-lines for consistency)\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction isJSX(node) {\r\n return node && (node.type === 'JSXElement' || node.type === 'JSXFragment');\r\n}\r\n\r\nfunction expressionReturnsJSX(node) {\r\n if (!node) return false;\r\n if (isJSX(node)) return true;\r\n if (node.type === 'ConditionalExpression')\r\n return expressionReturnsJSX(node.consequent) || expressionReturnsJSX(node.alternate);\r\n if (node.type === 'LogicalExpression')\r\n return expressionReturnsJSX(node.left) || expressionReturnsJSX(node.right);\r\n if (node.type === 'ParenthesizedExpression')\r\n return expressionReturnsJSX(node.expression);\r\n return false;\r\n}\r\n\r\nfunction blockReturnsJSX(body) {\r\n if (!Array.isArray(body)) return false;\r\n for (const stmt of body) {\r\n if (stmt.type === 'ReturnStatement' && expressionReturnsJSX(stmt.argument))\r\n return true;\r\n if (stmt.type === 'IfStatement') {\r\n const check = (branch) => {\r\n if (!branch) return false;\r\n if (branch.type === 'BlockStatement') return blockReturnsJSX(branch.body);\r\n return branch.type === 'ReturnStatement' && expressionReturnsJSX(branch.argument);\r\n };\r\n if (check(stmt.consequent) || check(stmt.alternate)) return true;\r\n }\r\n if (stmt.type === 'SwitchStatement') {\r\n for (const c of stmt.cases)\r\n if (blockReturnsJSX(c.consequent)) return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction functionReturnsJSX(fnNode) {\r\n if (fnNode.type === 'ArrowFunctionExpression' && fnNode.body.type !== 'BlockStatement')\r\n return expressionReturnsJSX(fnNode.body);\r\n if (fnNode.body && fnNode.body.type === 'BlockStatement')\r\n return blockReturnsJSX(fnNode.body.body);\r\n return false;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Helpers – Statement classification for ordering\r\n// ---------------------------------------------------------------------------\r\n\r\n/** Exempt statement types that don't participate in ordering zones. */\r\nfunction isExemptStatement(stmt) {\r\n if (stmt.type === 'ImportDeclaration') return true;\r\n if (stmt.type === 'TSTypeAliasDeclaration') return true;\r\n if (stmt.type === 'TSInterfaceDeclaration') return true;\r\n if (stmt.type === 'TSEnumDeclaration') return true;\r\n if (stmt.type === 'ExportAllDeclaration') return true;\r\n // Type-only exports\r\n if (stmt.type === 'ExportNamedDeclaration' && stmt.exportKind === 'type') return true;\r\n // Re-exports (export { ... } from '...')\r\n if (stmt.type === 'ExportNamedDeclaration' && stmt.source) return true;\r\n // Empty export declarations (export {};)\r\n if (stmt.type === 'ExportNamedDeclaration' && !stmt.declaration && stmt.specifiers.length === 0)\r\n return true;\r\n return false;\r\n}\r\n\r\n/** Check if a VariableDeclaration's init is a function (arrow or function expression). */\r\nfunction hasFunctionInit(varDecl) {\r\n if (!varDecl.declarations || varDecl.declarations.length === 0) return false;\r\n const init = varDecl.declarations[0].init;\r\n if (!init) return false;\r\n return init.type === 'ArrowFunctionExpression' || init.type === 'FunctionExpression';\r\n}\r\n\r\n/**\r\n * Classify a top-level statement into a zone for ordering:\r\n * 1 = constant, 2 = function/export, 0 = exempt\r\n *\r\n * Expected file layout (compatible with no-use-before-define):\r\n * imports/types → constants → functions & exports (freely interleaved)\r\n */\r\nfunction classifyZone(stmt) {\r\n if (isExemptStatement(stmt)) return 0;\r\n\r\n // Exports → zone 2\r\n if (stmt.type === 'ExportNamedDeclaration' || stmt.type === 'ExportDefaultDeclaration')\r\n return 2;\r\n\r\n // Private function declarations → zone 2\r\n if (stmt.type === 'FunctionDeclaration') return 2;\r\n\r\n // Private variable declarations\r\n if (stmt.type === 'VariableDeclaration') {\r\n if (hasFunctionInit(stmt)) return 2; // function-valued → zone 2\r\n return 1; // plain constant → zone 1\r\n }\r\n\r\n // Everything else (expression statements, etc.) → exempt\r\n return 0;\r\n}\r\n\r\n/** Get a readable name from a statement for error messages. */\r\nfunction getStatementName(stmt) {\r\n if (stmt.type === 'ExportNamedDeclaration' && stmt.declaration) {\r\n const decl = stmt.declaration;\r\n if (decl.type === 'FunctionDeclaration' && decl.id) return decl.id.name;\r\n if (decl.type === 'VariableDeclaration' && decl.declarations[0]?.id)\r\n return decl.declarations[0].id.name;\r\n }\r\n if (stmt.type === 'ExportDefaultDeclaration') return 'default export';\r\n if (stmt.type === 'FunctionDeclaration' && stmt.id) return stmt.id.name;\r\n if (stmt.type === 'VariableDeclaration' && stmt.declarations[0]?.id)\r\n return stmt.declarations[0].id.name;\r\n return '(anonymous)';\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Helpers – Top-level detection\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Check if a VariableDeclarator is at the module top level.\r\n * A declarator is top-level if its VariableDeclaration parent is directly\r\n * under Program, or under an ExportNamedDeclaration that is under Program.\r\n */\r\nfunction isTopLevel(node) {\r\n const varDecl = node.parent; // VariableDeclaration\r\n if (!varDecl) return false;\r\n const container = varDecl.parent;\r\n if (!container) return false;\r\n if (container.type === 'Program') return true;\r\n if (container.type === 'ExportNamedDeclaration' && container.parent?.type === 'Program')\r\n return true;\r\n return false;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Rule definition\r\n// ---------------------------------------------------------------------------\r\n\r\nconst enforceFunctionStyleRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Enforce function declarations for multi-statement functions and ' +\r\n 'correct ordering of exports, private functions, and constants.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n checkStyle: {\r\n type: 'boolean',\r\n description: 'Flag const-assigned multi-statement functions (default true)',\r\n },\r\n checkOrdering: {\r\n type: 'boolean',\r\n description: 'Flag out-of-order module statements (default true)',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n useFunction:\r\n 'Use a function declaration (`function {{name}}`) instead of a ' +\r\n 'const-assigned arrow/function expression for multi-statement functions.',\r\n constantAfterCode:\r\n 'Module-level constant `{{name}}` should appear before functions and exports.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const checkStyle = options.checkStyle !== false;\r\n const checkOrdering = options.checkOrdering !== false;\r\n\r\n return {\r\n // -----------------------------------------------------------------\r\n // Check 1: Declaration style\r\n // -----------------------------------------------------------------\r\n ...(checkStyle\r\n ? {\r\n VariableDeclarator(node) {\r\n // Only care about top-level const-assigned functions\r\n if (!isTopLevel(node)) return;\r\n\r\n const init = node.init;\r\n if (!init) return;\r\n if (init.type !== 'ArrowFunctionExpression' && init.type !== 'FunctionExpression')\r\n return;\r\n\r\n // Allow single-expression arrows (concise body, no block)\r\n if (init.type === 'ArrowFunctionExpression' && init.body.type !== 'BlockStatement')\r\n return;\r\n\r\n // Allow React components (JSX return) — enforced separately\r\n if (functionReturnsJSX(init)) return;\r\n\r\n // Allow PascalCase names — likely React components (enforced\r\n // as arrow functions by react/function-component-definition).\r\n // Components returning null won't be caught by JSX check above.\r\n const name = node.id?.name ?? '(anonymous)';\r\n if (/^[A-Z]/.test(name)) return;\r\n\r\n // IIFEs like `const x = (() => {...})()` are implicitly exempt\r\n // because their init is a CallExpression, filtered by the type\r\n // check above.\r\n\r\n context.report({\r\n node,\r\n messageId: 'useFunction',\r\n data: { name },\r\n });\r\n },\r\n }\r\n : {}),\r\n\r\n // -----------------------------------------------------------------\r\n // Check 2: Ordering\r\n // -----------------------------------------------------------------\r\n ...(checkOrdering\r\n ? {\r\n 'Program:exit'(programNode) {\r\n let maxZoneSeen = 0;\r\n\r\n for (const stmt of programNode.body) {\r\n const zone = classifyZone(stmt);\r\n if (zone === 0) continue; // exempt — ignore\r\n\r\n if (zone < maxZoneSeen) {\r\n const name = getStatementName(stmt);\r\n const messageId = 'constantAfterCode';\r\n\r\n context.report({\r\n node: stmt,\r\n messageId,\r\n data: { name },\r\n });\r\n }\r\n\r\n if (zone > maxZoneSeen) maxZoneSeen = zone;\r\n }\r\n },\r\n }\r\n : {}),\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enforce-function-style': enforceFunctionStyleRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enforce Module Structure\r\n *\r\n * When a component/feature directory contains 4+ non-test source files,\r\n * this rule enforces a standard internal structure:\r\n *\r\n * hooks/ — Custom hooks (use*.ts)\r\n * components/ — Sub-components (non-index .tsx files)\r\n * utils/ — Pure helper functions (non-hook, non-component .ts files)\r\n * data/ — Static/mock data files (*Data.ts, *.data.ts)\r\n *\r\n * Files that may stay at the directory root:\r\n * index.tsx, index.ts, types.ts, constants.ts, schema.ts, columns.ts\r\n *\r\n * The rule also allows domain-specific subdirectories (e.g. filters/,\r\n * columnMenu/, pagination/) — files inside those are exempt because\r\n * they are already organized by concern.\r\n *\r\n * Special directory patterns exempt from sub-component checks:\r\n * sections/ — Feature page sections (.tsx files are the primary content)\r\n * forms/ — Form components (.tsx are the primary content)\r\n *\r\n * Threshold: only enforced when a directory has >= fileThreshold source\r\n * files (default 4). Simple components with 1-3 files are left alone.\r\n *\r\n * Examples:\r\n * BAD: DataGrid/useGridCallbacks.ts (hook at root, 8 siblings)\r\n * GOOD: DataGrid/hooks/useGridCallbacks.ts (hook in hooks/ subdir)\r\n *\r\n * BAD: sections/data.ts (data mixed with sections)\r\n * GOOD: data/gridData.ts (data in dedicated subdir)\r\n *\r\n * OK: sections/BasicGridSection.tsx (sections dir, .tsx exempt)\r\n * OK: TableNative/columnMenu/useColumnMenu.ts (domain subdir, exempt)\r\n * OK: Button/index.tsx (only 2 files, below threshold)\r\n */\r\n\r\nimport { readdirSync } from 'fs';\r\nimport { dirname, basename, sep, posix } from 'path';\r\n\r\nconst FILE_THRESHOLD_DEFAULT = 4;\r\n\r\n/** Exact file names allowed to stay at the root of a module directory. */\r\nconst ROOT_ALLOWED_BASENAMES = new Set([\r\n 'index.tsx',\r\n 'index.ts',\r\n 'types.ts',\r\n 'constants.ts',\r\n 'schema.ts',\r\n 'columns.ts',\r\n]);\r\n\r\n/**\r\n * File name patterns that are allowed at root.\r\n * - *Types.ts: type definition files (same purpose as types.ts)\r\n * - Files containing a single const enum are required by\r\n * enum-file-isolation to be standalone — don't force them into utils/.\r\n * We detect these by common naming patterns for enum files.\r\n */\r\nconst ROOT_ALLOWED_PATTERNS = [\r\n /^[a-zA-Z]+Types\\.ts$/, // alertTypes.ts, buttonTypes.ts, etc.\r\n];\r\n\r\n/**\r\n * Directory names where PascalCase .tsx files are the primary content\r\n * and should NOT be flagged as \"move to components/\".\r\n * Hooks, utils, and data files are still flagged in these directories.\r\n */\r\nconst COMPONENT_EXEMPT_DIRS = new Set([\r\n 'sections',\r\n 'forms',\r\n 'Forms',\r\n]);\r\n\r\n/**\r\n * Directory names that are collections of standalone files by design.\r\n * Files in these directories should not be reorganized into subdirs.\r\n * Example: shared/ contains type files and enums for multiple consumers.\r\n */\r\nconst FLAT_EXEMPT_DIRS = new Set([\r\n // Common (shared with SyncfusionThemeStudio)\r\n 'shared',\r\n 'presets',\r\n 'defaults',\r\n 'injectors',\r\n 'types',\r\n 'actions',\r\n 'icons',\r\n 'errors',\r\n 'interceptors',\r\n 'events',\r\n 'routes',\r\n 'utils',\r\n 'components',\r\n 'form-fields',\r\n // BaseClient-specific\r\n 'enums',\r\n 'testIds',\r\n 'constants',\r\n 'slices',\r\n 'schemas',\r\n 'locales',\r\n 'mutators',\r\n 'customHooks',\r\n 'swagger',\r\n 'models',\r\n 'handlers',\r\n 'menuHandlers',\r\n 'userHandlers',\r\n]);\r\n\r\n/**\r\n * Count non-test, non-directory source files in a directory (shallow).\r\n * Returns only .ts/.tsx files that are not tests or declarations.\r\n */\r\nfunction countSourceFiles(dirPath) {\r\n try {\r\n const entries = readdirSync(dirPath, { withFileTypes: true });\r\n return entries.filter((e) => {\r\n if (!e.isFile()) return false;\r\n const name = e.name;\r\n if (!name.endsWith('.ts') && !name.endsWith('.tsx')) return false;\r\n if (name.endsWith('.test.ts') || name.endsWith('.test.tsx')) return false;\r\n if (name.endsWith('.d.ts')) return false;\r\n return true;\r\n }).length;\r\n } catch {\r\n return 0;\r\n }\r\n}\r\n\r\n/**\r\n * Check whether the file is inside a non-root subdirectory of its\r\n * module directory (e.g. hooks/, components/, filters/, columnMenu/).\r\n * If so, it's already organized and should be exempt.\r\n */\r\nfunction isInsideSubdirectory(filePath, moduleRoot) {\r\n const rel = filePath\r\n .split(sep)\r\n .join(posix.sep)\r\n .slice(moduleRoot.split(sep).join(posix.sep).length + 1);\r\n // rel looks like \"hooks/useX.ts\" or \"index.tsx\"\r\n return rel.includes('/');\r\n}\r\n\r\n/**\r\n * Determine the \"module root\" — the nearest ancestor directory that\r\n * contains an index.ts or index.tsx file. This is the component or\r\n * page directory boundary.\r\n */\r\nfunction findModuleRoot(filePath) {\r\n let dir = dirname(filePath);\r\n const maxDepth = 10;\r\n for (let i = 0; i < maxDepth; i++) {\r\n try {\r\n const entries = readdirSync(dir);\r\n if (entries.includes('index.ts') || entries.includes('index.tsx'))\r\n return dir;\r\n } catch {\r\n return null;\r\n }\r\n const parent = dirname(dir);\r\n if (parent === dir) return null;\r\n dir = parent;\r\n }\r\n return null;\r\n}\r\n\r\nconst enforceModuleStructureRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Enforce standard module structure: hooks in hooks/, sub-components in components/, ' +\r\n 'utils in utils/, data in data/. Only applies when directory has 4+ source files.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n fileThreshold: {\r\n type: 'integer',\r\n minimum: 2,\r\n description:\r\n 'Minimum number of non-test source files before structure is enforced',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n hookAtRoot:\r\n 'Hook \"{{fileName}}\" should be in a hooks/ subdirectory. ' +\r\n 'Move to {{suggestedPath}}.',\r\n componentAtRoot:\r\n 'Sub-component \"{{fileName}}\" should be in a components/ subdirectory. ' +\r\n 'Move to {{suggestedPath}}.',\r\n utilAtRoot:\r\n 'Utility file \"{{fileName}}\" should be in a utils/ subdirectory. ' +\r\n 'Move to {{suggestedPath}}.',\r\n dataInSections:\r\n 'Data file \"{{fileName}}\" should be in a data/ subdirectory, ' +\r\n 'not mixed with section components. Move to {{suggestedPath}}.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const fileThreshold = options.fileThreshold ?? FILE_THRESHOLD_DEFAULT;\r\n\r\n return {\r\n Program() {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return;\r\n\r\n // Only check .ts/.tsx files\r\n if (!filePath.endsWith('.ts') && !filePath.endsWith('.tsx')) return;\r\n if (filePath.endsWith('.d.ts')) return;\r\n\r\n const fileName = basename(filePath);\r\n\r\n // Skip test files — they follow their source files\r\n if (fileName.endsWith('.test.ts') || fileName.endsWith('.test.tsx'))\r\n return;\r\n\r\n // Skip root-allowed files (exact matches and patterns)\r\n if (ROOT_ALLOWED_BASENAMES.has(fileName)) return;\r\n if (ROOT_ALLOWED_PATTERNS.some((p) => p.test(fileName))) return;\r\n\r\n const dir = dirname(filePath);\r\n const dirName = basename(dir);\r\n\r\n // Skip files in flat-exempt directories (shared/, presets/, etc.)\r\n if (FLAT_EXEMPT_DIRS.has(dirName)) return;\r\n\r\n // Find the module root (directory with index.ts/tsx)\r\n const moduleRoot = findModuleRoot(filePath);\r\n if (!moduleRoot) return;\r\n\r\n // If the file is already inside a subdirectory of the module root,\r\n // it's organized — skip\r\n if (isInsideSubdirectory(filePath, moduleRoot)) return;\r\n\r\n // Count source files in the module root to check threshold\r\n const sourceFileCount = countSourceFiles(moduleRoot);\r\n if (sourceFileCount < fileThreshold) return;\r\n\r\n // --- Classify the file and report ---\r\n\r\n const isHook =\r\n /^use[A-Z]/.test(fileName) &&\r\n (fileName.endsWith('.ts') || fileName.endsWith('.tsx'));\r\n\r\n const isComponent =\r\n fileName.endsWith('.tsx') && /^[A-Z]/.test(fileName);\r\n\r\n const isDataFile =\r\n /[Dd]ata\\.tsx?$/.test(fileName) ||\r\n /\\.data\\.tsx?$/.test(fileName);\r\n\r\n // Data files in sections/ directory → suggest data/ subdir\r\n if (isDataFile && dirName === 'sections') {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'dataInSections',\r\n data: {\r\n fileName,\r\n suggestedPath: `data/${fileName}`,\r\n },\r\n });\r\n return;\r\n }\r\n\r\n if (isHook) {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'hookAtRoot',\r\n data: {\r\n fileName,\r\n suggestedPath: `hooks/${fileName}`,\r\n },\r\n });\r\n return;\r\n }\r\n\r\n // In sections/ and forms/ dirs, .tsx files are the primary content\r\n // and should NOT be flagged as needing components/ subdir\r\n if (isComponent && !COMPONENT_EXEMPT_DIRS.has(dirName)) {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'componentAtRoot',\r\n data: {\r\n fileName,\r\n suggestedPath: `components/${fileName}`,\r\n },\r\n });\r\n return;\r\n }\r\n\r\n // Remaining .ts files that aren't root-allowed → utils\r\n // Skip .tsx files in exempt dirs (they're section/form components)\r\n if (fileName.endsWith('.ts') && !isDataFile) {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'utilAtRoot',\r\n data: {\r\n fileName,\r\n suggestedPath: `utils/${fileName}`,\r\n },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enforce-module-structure': enforceModuleStructureRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enforce Route Page Preloading\r\n *\r\n * Runs on a preloader file (e.g., src/config/routePreloader.ts) and ensures\r\n * every Expo Router route page in the configured directory has a matching\r\n * dynamic import() expression. This prevents developers from adding new\r\n * route pages without preloading them, which would cause slower navigation.\r\n *\r\n * Reports:\r\n * - missingPreload: route page file has no matching import() in the preloader\r\n * - stalePreload: import path does not match any route page file\r\n * - noImportsFound: preloader file has no dynamic import() expressions at all\r\n */\r\n\r\nimport fs from 'fs';\r\nimport path from 'path';\r\n\r\n/**\r\n * Recursively discover route page files in the given directory.\r\n *\r\n * A file qualifies as a route page if:\r\n * - It is a .tsx file\r\n * - It is NOT a _layout.tsx file\r\n * - It is NOT inside an excluded directory (e.g., __tests__)\r\n * - If it lives in a directory that already has an index.tsx, only index.tsx\r\n * itself counts (sibling .tsx files are sub-components, not route entries)\r\n * - Direct .tsx files whose name does NOT start with _ are also route pages\r\n */\r\nfunction discoverRoutePages(baseDir, options) {\r\n const {\r\n excludeFiles = ['_layout.tsx'],\r\n excludeDirs = ['__tests__'],\r\n rootIndexIsRedirect = true,\r\n } = options;\r\n\r\n const routePages = [];\r\n\r\n function walk(dir, relativePrefix) {\r\n let entries;\r\n try {\r\n entries = fs.readdirSync(dir, { withFileTypes: true });\r\n } catch {\r\n return;\r\n }\r\n\r\n for (const entry of entries) {\r\n const fullPath = path.join(dir, entry.name);\r\n const relativePath = path.join(relativePrefix, entry.name);\r\n\r\n if (entry.isDirectory()) {\r\n // Skip excluded directories\r\n if (excludeDirs.includes(entry.name)) continue;\r\n\r\n walk(fullPath, relativePath);\r\n continue;\r\n }\r\n\r\n // Only consider .tsx files\r\n if (!entry.name.endsWith('.tsx')) continue;\r\n\r\n // Skip excluded file names\r\n if (excludeFiles.includes(entry.name)) continue;\r\n\r\n // Skip files starting with _ (e.g., _layout.tsx already excluded above,\r\n // but also any other underscore-prefixed files)\r\n if (entry.name.startsWith('_')) continue;\r\n\r\n // Skip root index if configured as redirect\r\n const normalizedRelative = relativePath.replace(/\\\\/g, '/');\r\n if (rootIndexIsRedirect && normalizedRelative === 'index.tsx') continue;\r\n\r\n // Strip .tsx extension for the normalized path\r\n const withoutExt = normalizedRelative.replace(/\\.tsx$/, '');\r\n routePages.push(withoutExt);\r\n }\r\n }\r\n\r\n walk(baseDir, '');\r\n return routePages;\r\n}\r\n\r\n/**\r\n * Recursively collect all ImportExpression source paths within an AST subtree.\r\n */\r\nfunction collectImportPaths(node) {\r\n const paths = [];\r\n\r\n function walk(n) {\r\n if (!n || typeof n !== 'object') return;\r\n\r\n if (n.type === 'ImportExpression' && n.source?.type === 'Literal')\r\n paths.push({ value: n.source.value, node: n });\r\n\r\n for (const key of Object.keys(n)) {\r\n if (key === 'parent') continue;\r\n const child = n[key];\r\n if (Array.isArray(child))\r\n child.forEach(walk);\r\n else if (child?.type)\r\n walk(child);\r\n }\r\n }\r\n\r\n walk(node);\r\n return paths;\r\n}\r\n\r\n/**\r\n * Resolve a relative import path to an absolute normalized form,\r\n * then strip the project root prefix to get a project-relative path.\r\n */\r\nfunction resolveImportToProjectRelative(importPath, fileDir, projectRoot) {\r\n // Resolve relative to the file being linted\r\n const absoluteResolved = path.resolve(fileDir, importPath);\r\n // Make it relative to the project root\r\n const projectRelative = path.relative(projectRoot, absoluteResolved);\r\n // Normalize to forward slashes\r\n return projectRelative.replace(/\\\\/g, '/');\r\n}\r\n\r\nconst enforceRoutePreloadRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Ensure every route page in the configured directory has a matching dynamic import() in the preloader file',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n routeDir: {\r\n type: 'string',\r\n description:\r\n 'Directory to scan for route pages, relative to project root',\r\n default: 'app/(protected)',\r\n },\r\n excludeFiles: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Filename patterns to skip',\r\n default: ['_layout.tsx'],\r\n },\r\n excludeDirs: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Directory names to skip',\r\n default: ['__tests__'],\r\n },\r\n rootIndexIsRedirect: {\r\n type: 'boolean',\r\n description:\r\n 'Whether the root index.tsx in routeDir is just a redirect and should be skipped',\r\n default: true,\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n missingPreload:\r\n 'Route page \"{{routeFile}}\" is not preloaded. Add: import(\\'{{importPath}}\\').catch(() => undefined);',\r\n stalePreload:\r\n 'Preload import \"{{importPath}}\" does not match any route page in {{routeDir}}/. Remove it or add the corresponding route page.',\r\n noImportsFound:\r\n 'Preloader file has no dynamic import() expressions. Add imports for all route pages in {{routeDir}}/.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] ?? {};\r\n const routeDir = options.routeDir ?? 'app/(protected)';\r\n const excludeFiles = options.excludeFiles ?? ['_layout.tsx'];\r\n const excludeDirs = options.excludeDirs ?? ['__tests__'];\r\n const rootIndexIsRedirect = options.rootIndexIsRedirect ?? true;\r\n\r\n // Determine project root (directory containing eslint.config.mjs)\r\n const cwd = context.cwd ?? context.getCwd?.() ?? process.cwd();\r\n const projectRoot = cwd;\r\n\r\n // Determine the directory of the file being linted\r\n const filename = context.filename ?? context.getFilename?.();\r\n const fileDir = path.dirname(filename);\r\n\r\n // Discover all route page files\r\n const routeDirAbsolute = path.resolve(projectRoot, routeDir);\r\n const routePages = discoverRoutePages(routeDirAbsolute, {\r\n excludeFiles,\r\n excludeDirs,\r\n rootIndexIsRedirect,\r\n });\r\n\r\n // Build the set of expected normalized paths: \"app/(protected)/tenants/index\"\r\n const expectedRouteSet = new Set(\r\n routePages.map((rp) => `${routeDir}/${rp}`.replace(/\\\\/g, '/')),\r\n );\r\n\r\n // Collected during traversal\r\n const importExpressions = []; // { resolvedPath: string, rawPath: string, node: ASTNode }\r\n\r\n return {\r\n // Collect all dynamic import() expressions in the file\r\n ImportExpression(node) {\r\n if (node.source?.type !== 'Literal') return;\r\n const rawPath = node.source.value;\r\n const resolvedPath = resolveImportToProjectRelative(\r\n rawPath,\r\n fileDir,\r\n projectRoot,\r\n );\r\n importExpressions.push({ resolvedPath, rawPath, node });\r\n },\r\n\r\n 'Program:exit'(programNode) {\r\n // If no route pages were discovered, nothing to check\r\n if (expectedRouteSet.size === 0) return;\r\n\r\n // If preloader has zero imports, report a single error\r\n if (importExpressions.length === 0) {\r\n context.report({\r\n node: programNode,\r\n messageId: 'noImportsFound',\r\n data: { routeDir },\r\n });\r\n return;\r\n }\r\n\r\n // Build set of resolved import paths (normalized)\r\n const importedPaths = new Set(\r\n importExpressions.map((i) => i.resolvedPath),\r\n );\r\n\r\n // Check for missing preloads: route pages not covered by any import\r\n for (const routePath of expectedRouteSet) {\r\n if (!importedPaths.has(routePath)) {\r\n // Compute the relative import path from the preloader file to the route\r\n const routeAbsolute = path.resolve(projectRoot, `${routePath}.tsx`);\r\n let relativePath = path.relative(fileDir, routeAbsolute);\r\n // Normalize to forward slashes\r\n relativePath = relativePath.replace(/\\\\/g, '/');\r\n // Ensure it starts with ./\r\n if (!relativePath.startsWith('.'))\r\n relativePath = `./${relativePath}`;\r\n // Strip .tsx extension\r\n relativePath = relativePath.replace(/\\.tsx$/, '');\r\n\r\n context.report({\r\n node: programNode,\r\n messageId: 'missingPreload',\r\n data: {\r\n routeFile: routePath,\r\n importPath: relativePath,\r\n },\r\n });\r\n }\r\n }\r\n\r\n // Check for stale preloads: imports that don't match any route page\r\n for (const { resolvedPath, rawPath, node } of importExpressions) {\r\n // Only flag imports that point into the routeDir\r\n const normalizedRouteDir = routeDir.replace(/\\\\/g, '/');\r\n if (!resolvedPath.startsWith(normalizedRouteDir)) continue;\r\n\r\n if (!expectedRouteSet.has(resolvedPath))\r\n context.report({\r\n node,\r\n messageId: 'stalePreload',\r\n data: {\r\n importPath: rawPath,\r\n routeDir,\r\n },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\n/**\r\n * Export the plugin\r\n */\r\nexport default {\r\n rules: {\r\n 'enforce-route-preload': enforceRoutePreloadRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enforce Test Colocation\r\n *\r\n * Flags test files that live in __tests__/ directories instead of being\r\n * co-located next to the source file they test.\r\n *\r\n * Co-located tests are easier to find, easier to maintain, and make it\r\n * obvious which files have test coverage at a glance.\r\n *\r\n * Examples:\r\n * BAD: DataGrid/__tests__/useGridCallbacks.test.ts\r\n * GOOD: DataGrid/hooks/useGridCallbacks.test.ts (next to source)\r\n *\r\n * BAD: lib/api/errors/__tests__/apiError.test.ts\r\n * GOOD: lib/api/errors/apiError.test.ts (next to source)\r\n *\r\n * OK: hooks/useGridCallbacks.test.ts (already co-located)\r\n */\r\n\r\nimport { dirname, basename, sep, posix } from 'path';\r\n\r\nconst enforceTestColocationRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Test files should be co-located next to their source file, ' +\r\n 'not placed in a __tests__/ directory.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n testInTestsDir:\r\n 'Test file \"{{fileName}}\" is inside a __tests__/ directory. ' +\r\n 'Move it next to its source file for co-location. ' +\r\n 'Suggested: {{suggestedPath}}',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n Program() {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return;\r\n\r\n const fileName = basename(filePath);\r\n\r\n // Only check test files\r\n if (!fileName.endsWith('.test.ts') && !fileName.endsWith('.test.tsx'))\r\n return;\r\n\r\n // Normalize path separators for consistent checking\r\n const normalized = filePath.split(sep).join(posix.sep);\r\n\r\n // Check if the file is inside a __tests__/ directory\r\n if (!normalized.includes('/__tests__/')) return;\r\n\r\n // Build the suggested co-located path:\r\n // __tests__/foo.test.ts → ../foo.test.ts (next to source)\r\n const dir = dirname(filePath);\r\n const parentDir = dirname(dir);\r\n const parentDirName = basename(parentDir);\r\n\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'testInTestsDir',\r\n data: {\r\n fileName,\r\n suggestedPath: `${parentDirName}/${fileName}`,\r\n },\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enforce-test-colocation': enforceTestColocationRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enum File Isolation\r\n *\r\n * Flags exported enums in files that also contain unrelated exports.\r\n * Enums should live in dedicated files (e.g., status.enum.ts or status.ts).\r\n *\r\n * Related helpers (functions/variables/types that reference the enum name)\r\n * are allowed in the same file as the enum.\r\n *\r\n * Examples:\r\n * FLAGGED - enum mixed with unrelated exports:\r\n * export const enum ExportType { Csv = 'csv', Excel = 'excel' }\r\n * export interface TableColumn { ... } // Unrelated to ExportType\r\n *\r\n * FLAGGED - multiple exported enums in one file:\r\n * export const enum ErrorActionType { ... }\r\n * export const enum ErrorSeverity { ... }\r\n *\r\n * NOT FLAGGED - enum with related helpers:\r\n * export const enum MenuStatus { Active = 'active', Inactive = 'inactive' }\r\n * export const menuStatusToLabel = (s: MenuStatus): string => { ... }\r\n */\r\n\r\nconst enumFileIsolationRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Exported enums should live in dedicated files. Only related helpers may share the file.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n multipleEnums:\r\n 'File contains multiple exported enums ({{enumNames}}). Each enum should have its own dedicated file.',\r\n unrelatedExports:\r\n 'Exported enum \"{{enumName}}\" is in a file with unrelated exports. Move the enum to a dedicated file (e.g., {{suggestedFile}}) or move unrelated exports elsewhere.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const exportedEnums = [];\r\n const otherExportNodes = [];\r\n\r\n /**\r\n * Collect exported enum declarations.\r\n */\r\n function collectExportedEnum(node) {\r\n // ExportNamedDeclaration > TSEnumDeclaration\r\n if (\r\n node.type === 'ExportNamedDeclaration' &&\r\n node.declaration &&\r\n node.declaration.type === 'TSEnumDeclaration'\r\n ) {\r\n exportedEnums.push({\r\n name: node.declaration.id.name,\r\n node: node.declaration.id,\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Collect non-enum exported declarations.\r\n */\r\n function collectOtherExport(node) {\r\n if (node.type !== 'ExportNamedDeclaration') return;\r\n // Skip if it's an enum (already collected)\r\n if (\r\n node.declaration &&\r\n node.declaration.type === 'TSEnumDeclaration'\r\n )\r\n return;\r\n\r\n otherExportNodes.push(node);\r\n }\r\n\r\n /**\r\n * Check if a source text references an enum name using word boundary.\r\n */\r\n function referencesEnum(sourceText, enumName) {\r\n const regex = new RegExp(`\\\\b${enumName}\\\\b`);\r\n return regex.test(sourceText);\r\n }\r\n\r\n return {\r\n ExportNamedDeclaration(node) {\r\n if (!collectExportedEnum(node)) collectOtherExport(node);\r\n },\r\n\r\n 'Program:exit'() {\r\n // No exported enums -> nothing to check\r\n if (exportedEnums.length === 0) return;\r\n\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n\r\n // Check for multiple exported enums in the same file\r\n if (exportedEnums.length > 1) {\r\n const enumNames = exportedEnums\r\n .map((e) => e.name)\r\n .join(', ');\r\n for (const enumInfo of exportedEnums) {\r\n context.report({\r\n node: enumInfo.node,\r\n messageId: 'multipleEnums',\r\n data: { enumNames },\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Single enum - check if other exports are related\r\n const enumName = exportedEnums[0].name;\r\n const enumNode = exportedEnums[0].node;\r\n\r\n // If no other exports, the file is fine\r\n if (otherExportNodes.length === 0) return;\r\n\r\n // Check each other export to see if it references the enum\r\n const unrelatedExports = otherExportNodes.filter((node) => {\r\n const text = sourceCode.getText(node);\r\n return !referencesEnum(text, enumName);\r\n });\r\n\r\n if (unrelatedExports.length > 0) {\r\n // Convert PascalCase to kebab-case for suggested filename\r\n const suggestedFile = enumName\r\n .replace(/([a-z])([A-Z])/g, '$1-$2')\r\n .toLowerCase()\r\n .concat('.ts');\r\n\r\n context.report({\r\n node: enumNode,\r\n messageId: 'unrelatedExports',\r\n data: { enumName, suggestedFile },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enum-file-isolation': enumFileIsolationRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: i18n Interpolation Placeholder Enforcement\r\n *\r\n * Ensures translation JSON files only use standardized placeholders:\r\n * {{p1}}, {{p2}}, {{p3}} (compatible with the FM() helper).\r\n *\r\n * Detects and autofixes:\r\n * - Non-standard double-brace placeholders: {{message}} → {{p1}}\r\n * - Single-brace placeholders: {p1} → {{p1}}\r\n * - Placeholders exceeding the 3-param FM() limit (error only, no autofix)\r\n */\r\n\r\nconst DOUBLE_BRACE_REGEX = /\\{\\{(\\w+)\\}\\}/g;\r\nconst SINGLE_BRACE_REGEX = /(?<!\\{)\\{(\\w+)\\}(?!\\})/g;\r\nconst ALLOWED_NAMES = new Set(['p1', 'p2', 'p3']);\r\nconst MAX_POSITIONAL_PARAMS = 3;\r\n\r\nconst rule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Enforce {{p1}}/{{p2}}/{{p3}} interpolation placeholders in translation JSON files',\r\n },\r\n fixable: 'code',\r\n schema: [],\r\n messages: {\r\n nonStandardPlaceholder:\r\n 'Non-standard placeholder \"{{placeholder}}\" found. Use {{p1}}/{{p2}}/{{p3}} instead.',\r\n singleBracePlaceholder:\r\n 'Single-brace placeholder \"{{{placeholder}}}\" found. Use double braces: {{{{{fixedName}}}}}.',\r\n tooManyPlaceholders:\r\n 'Translation has {{count}} unique placeholders but FM() only supports 3. Refactor the translation string.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n JSONLiteral(node) {\r\n if (typeof node.value !== 'string') return;\r\n\r\n const raw = node.value;\r\n\r\n // Collect all non-standard double-brace placeholders\r\n const doubleBraceMatches = [];\r\n let match;\r\n while ((match = DOUBLE_BRACE_REGEX.exec(raw)) !== null) {\r\n if (!ALLOWED_NAMES.has(match[1]))\r\n doubleBraceMatches.push({ name: match[1], index: match.index });\r\n }\r\n\r\n // Collect single-brace placeholders (any name)\r\n const singleBraceMatches = [];\r\n while ((match = SINGLE_BRACE_REGEX.exec(raw)) !== null)\r\n singleBraceMatches.push({ name: match[1], index: match.index });\r\n\r\n const hasDoubleBraceIssues = doubleBraceMatches.length > 0;\r\n const hasSingleBraceIssues = singleBraceMatches.length > 0;\r\n\r\n if (!hasDoubleBraceIssues && !hasSingleBraceIssues) return;\r\n\r\n // Build ordered mapping of unique placeholder names → p1/p2/p3\r\n const seenNames = [];\r\n const allMatches = [...doubleBraceMatches, ...singleBraceMatches].sort(\r\n (a, b) => a.index - b.index,\r\n );\r\n\r\n for (const m of allMatches) {\r\n if (!seenNames.includes(m.name) && !ALLOWED_NAMES.has(m.name))\r\n seenNames.push(m.name);\r\n }\r\n\r\n // Check if too many unique placeholders\r\n // Count existing valid ones too\r\n const existingValid = new Set();\r\n let m2;\r\n const tempRegex = /\\{\\{(\\w+)\\}\\}/g;\r\n while ((m2 = tempRegex.exec(raw)) !== null) {\r\n if (ALLOWED_NAMES.has(m2[1])) existingValid.add(m2[1]);\r\n }\r\n\r\n // Also count single-brace valid ones\r\n const tempSingleRegex = /(?<!\\{)\\{(\\w+)\\}(?!\\})/g;\r\n while ((m2 = tempSingleRegex.exec(raw)) !== null) {\r\n if (ALLOWED_NAMES.has(m2[1])) existingValid.add(m2[1]);\r\n }\r\n\r\n const totalUnique = seenNames.length + existingValid.size;\r\n\r\n if (totalUnique > MAX_POSITIONAL_PARAMS) {\r\n context.report({\r\n node,\r\n messageId: 'tooManyPlaceholders',\r\n data: { count: String(totalUnique) },\r\n });\r\n return;\r\n }\r\n\r\n // Determine the next available positional name\r\n const usedPositional = new Set(existingValid);\r\n const nameMap = {};\r\n const positionalNames = ['p1', 'p2', 'p3'];\r\n let nextIdx = 0;\r\n\r\n // Skip already-used positional names\r\n for (const name of seenNames) {\r\n while (\r\n nextIdx < positionalNames.length &&\r\n usedPositional.has(positionalNames[nextIdx])\r\n )\r\n nextIdx++;\r\n\r\n if (nextIdx < positionalNames.length) {\r\n nameMap[name] = positionalNames[nextIdx];\r\n usedPositional.add(positionalNames[nextIdx]);\r\n nextIdx++;\r\n }\r\n }\r\n\r\n // Report and fix double-brace non-standard placeholders\r\n if (hasDoubleBraceIssues) {\r\n const fixedValue = raw.replace(DOUBLE_BRACE_REGEX, (full, name) => {\r\n if (ALLOWED_NAMES.has(name)) return full;\r\n const replacement = nameMap[name];\r\n return replacement !== undefined ? `{{${replacement}}}` : full;\r\n });\r\n\r\n context.report({\r\n node,\r\n messageId: 'nonStandardPlaceholder',\r\n data: { placeholder: doubleBraceMatches[0].name },\r\n fix(fixer) {\r\n let finalValue = fixedValue;\r\n\r\n // Also fix single-brace issues in the same pass\r\n if (hasSingleBraceIssues)\r\n finalValue = finalValue.replace(\r\n SINGLE_BRACE_REGEX,\r\n (full, name) => {\r\n if (ALLOWED_NAMES.has(name)) return `{{${name}}}`;\r\n const replacement = nameMap[name];\r\n return replacement !== undefined\r\n ? `{{${replacement}}}`\r\n : `{{${name}}}`;\r\n },\r\n );\r\n\r\n return fixer.replaceText(node, JSON.stringify(finalValue));\r\n },\r\n });\r\n } else if (hasSingleBraceIssues) {\r\n // Only single-brace issues\r\n const fixedValue = raw.replace(SINGLE_BRACE_REGEX, (full, name) => {\r\n if (ALLOWED_NAMES.has(name)) return `{{${name}}}`;\r\n const replacement = nameMap[name];\r\n return replacement !== undefined\r\n ? `{{${replacement}}}`\r\n : `{{${name}}}`;\r\n });\r\n\r\n context.report({\r\n node,\r\n messageId: 'singleBracePlaceholder',\r\n data: {\r\n placeholder: singleBraceMatches[0].name,\r\n fixedName: ALLOWED_NAMES.has(singleBraceMatches[0].name)\r\n ? singleBraceMatches[0].name\r\n : nameMap[singleBraceMatches[0].name] ??\r\n singleBraceMatches[0].name,\r\n },\r\n fix(fixer) {\r\n return fixer.replaceText(node, JSON.stringify(fixedValue));\r\n },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'i18n-interpolation': rule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: i18n Parameter Name Enforcement\r\n *\r\n * Ensures that t() calls from react-i18next use standardized\r\n * interpolation parameter names: p1, p2, p3. This complements the\r\n * i18n-interpolation rule (which enforces {{p1}}/{{p2}}/{{p3}} in\r\n * translation JSON files) by checking the call sites in TypeScript/TSX.\r\n *\r\n * DETECTS:\r\n * t('key', { count }) — non-standard param name \"count\"\r\n * t('key', { message: err }) — non-standard param name \"message\"\r\n *\r\n * ALLOWED:\r\n * FM('key', value) — FM() enforces positional params by design\r\n * t('key', { p1: value }) — standard param name\r\n * t('key', { p1, p2 }) — shorthand with correct names\r\n * t('key', 'default value') — string default (not an interpolation object)\r\n *\r\n * RECOMMENDS: Use FM() instead of t() for parameterized translations.\r\n */\r\n\r\nconst ALLOWED_PARAM_NAMES = new Set(['p1', 'p2', 'p3']);\r\n\r\n// i18next configuration keys that are NOT interpolation params\r\nconst I18NEXT_CONFIG_KEYS = new Set([\r\n 'defaultValue',\r\n 'ns',\r\n 'lng',\r\n 'context',\r\n 'returnObjects',\r\n 'keySeparator',\r\n 'nsSeparator',\r\n 'interpolation',\r\n 'joinArrays',\r\n 'postProcess',\r\n 'replace',\r\n 'ordinal',\r\n 'formatParams',\r\n 'missingInterpolationHandler',\r\n]);\r\n\r\nconst rule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Enforce p1/p2/p3 parameter names in t() interpolation calls. ' +\r\n 'Translation JSON uses {{p1}}/{{p2}}/{{p3}} placeholders, so call sites ' +\r\n 'must pass { p1: value } — not { count: value } or other names.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n nonStandardParam:\r\n 'Non-standard interpolation param \"{{paramName}}\" in t() call. ' +\r\n 'Translation placeholders use {{p1}}/{{p2}}/{{p3}}. ' +\r\n 'Use FM(key, value) or t(key, { p1: value }) instead.',\r\n preferFM:\r\n 'Prefer FM() over t() for parameterized translations. ' +\r\n 'FM() enforces positional params (p1, p2, p3) by design.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n CallExpression(node) {\r\n // Only match t('key', { ... }) calls\r\n if (node.callee.type !== 'Identifier' || node.callee.name !== 't')\r\n return;\r\n\r\n // Need at least 2 arguments: t(key, options)\r\n if (node.arguments.length < 2) return;\r\n\r\n // Find the options argument — could be 2nd or 3rd arg\r\n // t(key, defaultValue, options) or t(key, options)\r\n const optionsArg = node.arguments.length >= 3\r\n ? node.arguments[2]\r\n : node.arguments[1];\r\n\r\n // Only check object literals (not variables or expressions)\r\n if (!optionsArg || optionsArg.type !== 'ObjectExpression') return;\r\n\r\n const properties = optionsArg.properties;\r\n\r\n for (const prop of properties) {\r\n // Skip spread elements\r\n if (prop.type === 'SpreadElement') continue;\r\n\r\n const keyName =\r\n prop.key.type === 'Identifier'\r\n ? prop.key.name\r\n : prop.key.type === 'Literal'\r\n ? String(prop.key.value)\r\n : null;\r\n\r\n if (keyName === null) continue;\r\n\r\n // Skip known i18next config keys\r\n if (I18NEXT_CONFIG_KEYS.has(keyName)) continue;\r\n\r\n // Flag non-standard interpolation param names\r\n if (!ALLOWED_PARAM_NAMES.has(keyName))\r\n context.report({\r\n node: prop,\r\n messageId: 'nonStandardParam',\r\n data: { paramName: keyName },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'i18n-param-names': rule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Barrel Companion File\r\n *\r\n * Flags any .ts/.tsx file that has a same-named directory containing an\r\n * index.ts or index.tsx barrel file. This pattern causes a silent resolution\r\n * conflict: TypeScript resolves `import from './foo'` to `foo.ts` (the file),\r\n * NOT `foo/index.ts` (the barrel). Any exports added to the barrel but missing\r\n * from the companion file will cause \"has no exported member\" errors.\r\n *\r\n * Auto-fix: When the companion file contains ONLY re-exports (no local\r\n * declarations or logic), the fix replaces the entire file with\r\n * `export * from './<name>/index';`. Files with local code are flagged\r\n * but NOT auto-fixed — those require manual resolution.\r\n *\r\n * Examples:\r\n * BAD: types.ts exists alongside types/index.ts\r\n * → import from './types' resolves to types.ts, ignoring types/index.ts\r\n *\r\n * GOOD: Only types/index.ts exists (no companion types.ts)\r\n * → import from './types' resolves to types/index.ts as expected\r\n *\r\n * GOOD: Only types.ts exists (no directory)\r\n * → No ambiguity\r\n *\r\n * OK: types.ts exists with `export * from './types/index';`\r\n * → Companion is a pure passthrough, all exports forwarded\r\n */\r\n\r\nimport { existsSync } from 'fs';\r\nimport { dirname, basename, join } from 'path';\r\n\r\n/**\r\n * Checks whether a Program node contains only re-export statements\r\n * (no local declarations, logic, or JSX). A \"re-export\" is an\r\n * ExportNamedDeclaration or ExportAllDeclaration that has a `source`\r\n * property (meaning it re-exports from another module).\r\n * Import statements are also allowed (they may be needed for re-exports).\r\n */\r\nfunction isPureReExportFile(programNode) {\r\n const { body } = programNode;\r\n if (body.length === 0) return false;\r\n\r\n return body.every((stmt) => {\r\n if (stmt.type === 'ImportDeclaration') return true;\r\n if (stmt.type === 'ExportAllDeclaration') return true;\r\n const isReExport = stmt.type === 'ExportNamedDeclaration' && stmt.source !== null;\r\n return isReExport;\r\n });\r\n}\r\n\r\nconst noBarrelCompanionFileRule = {\r\n meta: {\r\n type: 'problem',\r\n fixable: 'code',\r\n docs: {\r\n description:\r\n 'Disallow .ts/.tsx files that shadow a same-named directory barrel (index.ts). ' +\r\n 'This causes TypeScript to resolve imports to the file instead of the barrel, ' +\r\n 'leading to missing export errors.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n companionFileConflict:\r\n 'File \"{{fileName}}\" shadows the barrel \"{{barrelPath}}\". ' +\r\n 'TypeScript resolves `import from \\'./{{baseName}}\\'` to this file, ignoring the barrel. ' +\r\n 'Delete this file and update imports to use the barrel, or consolidate into one location.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n Program(node) {\r\n const filePath = context.filename || context.getFilename();\r\n\r\n // Only check .ts and .tsx files (not .d.ts, not index files themselves)\r\n if (!filePath || (!filePath.endsWith('.ts') && !filePath.endsWith('.tsx'))) return;\r\n if (filePath.endsWith('.d.ts')) return;\r\n\r\n const fileBaseName = basename(filePath);\r\n\r\n // Skip index files — they ARE the barrel, not the companion\r\n if (fileBaseName === 'index.ts' || fileBaseName === 'index.tsx') return;\r\n\r\n // Get the base name without extension\r\n const ext = fileBaseName.endsWith('.tsx') ? '.tsx' : '.ts';\r\n const baseName = fileBaseName.slice(0, -ext.length);\r\n const dir = dirname(filePath);\r\n\r\n // Check if a same-named directory exists with an index barrel\r\n const siblingDir = join(dir, baseName);\r\n const barrelTs = join(siblingDir, 'index.ts');\r\n const barrelTsx = join(siblingDir, 'index.tsx');\r\n\r\n const hasBarrelTs = existsSync(barrelTs);\r\n const hasBarrelTsx = existsSync(barrelTsx);\r\n\r\n if (hasBarrelTs || hasBarrelTsx) {\r\n // If the companion is already a pure wildcard re-export of the\r\n // barrel, it's safe — all exports are forwarded automatically.\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n const trimmed = sourceCode.text.trim();\r\n const safePattern = `export * from './${baseName}/index';`;\r\n if (trimmed === safePattern) return;\r\n\r\n const barrelPath = hasBarrelTs\r\n ? `${baseName}/index.ts`\r\n : `${baseName}/index.tsx`;\r\n\r\n // Only provide auto-fix when the file is purely re-exports.\r\n // Files with local declarations, logic, or JSX require manual\r\n // resolution (move code into the barrel directory).\r\n const canAutoFix = isPureReExportFile(node);\r\n\r\n context.report({\r\n node,\r\n messageId: 'companionFileConflict',\r\n data: {\r\n fileName: fileBaseName,\r\n barrelPath,\r\n baseName,\r\n },\r\n ...(canAutoFix && {\r\n fix(fixer) {\r\n const fullRange = [0, sourceCode.text.length];\r\n const replacement = `export * from './${baseName}/index';\\n`;\r\n return fixer.replaceTextRange(fullRange, replacement);\r\n },\r\n }),\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-barrel-companion-file': noBarrelCompanionFileRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Duplicate Nav Route/Key\r\n *\r\n * Ensures every sidebar nav item within a module has a unique `route` and `key`.\r\n * Duplicate routes cause multiple sidebar items to navigate to the same path,\r\n * and duplicate keys cause rendering/highlighting issues.\r\n *\r\n * Scoped to module definition files: packages/[module]/src/index.ts\r\n */\r\n\r\n/**\r\n * @param {string} propName\r\n * @param {string} messageId\r\n */\r\nfunction createDuplicateChecker(propName, messageId) {\r\n return {\r\n /** @param {import('estree').ArrayExpression} node */\r\n check(node, context) {\r\n const objectsWithProp = node.elements.filter(\r\n (el) =>\r\n el &&\r\n el.type === 'ObjectExpression' &&\r\n el.properties.some(\r\n (p) =>\r\n p.type === 'Property' &&\r\n p.key.type === 'Identifier' &&\r\n p.key.name === propName,\r\n ),\r\n );\r\n\r\n if (objectsWithProp.length === 0) return;\r\n\r\n /** @type {Map<string, import('estree').Property>} */\r\n const seen = new Map();\r\n\r\n for (const obj of objectsWithProp) {\r\n const prop = obj.properties.find(\r\n (p) =>\r\n p.type === 'Property' &&\r\n p.key.type === 'Identifier' &&\r\n p.key.name === propName,\r\n );\r\n if (!prop) continue;\r\n\r\n let value;\r\n if (prop.value.type === 'Literal') {\r\n value = String(prop.value.value);\r\n } else if (prop.value.type === 'MemberExpression') {\r\n const src = context.sourceCode || context.getSourceCode();\r\n value = src.getText(prop.value);\r\n } else if (prop.value.type === 'TemplateLiteral' && prop.value.quasis.length === 1) {\r\n value = prop.value.quasis[0].value.cooked;\r\n } else {\r\n continue;\r\n }\r\n\r\n if (seen.has(value)) {\r\n context.report({\r\n node: prop.value,\r\n messageId,\r\n data: { value },\r\n });\r\n } else {\r\n seen.set(value, prop);\r\n }\r\n }\r\n },\r\n };\r\n}\r\n\r\nconst noDuplicateNavPrefixRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow duplicate route or key values in module sidebarItems. ' +\r\n 'Duplicate routes cause navigation collisions; duplicate keys cause rendering issues.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n duplicateRoute:\r\n 'Duplicate route \"{{value}}\" - each sidebar item must have a unique route.',\r\n duplicateKey:\r\n 'Duplicate key \"{{value}}\" - each sidebar item must have a unique key.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const routeChecker = createDuplicateChecker('route', 'duplicateRoute');\r\n const keyChecker = createDuplicateChecker('key', 'duplicateKey');\r\n\r\n return {\r\n ArrayExpression(node) {\r\n routeChecker.check(node, context);\r\n keyChecker.check(node, context);\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-duplicate-nav-prefix': noDuplicateNavPrefixRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Duplicate Shared Patterns\r\n *\r\n * Warns when product module directories create components with names\r\n * that match existing shared components in src/components/. This\r\n * helps prevent accidental duplication of shared UI patterns.\r\n *\r\n * Scanned directories (product-specific code):\r\n * - packages/* /src/ (product module packages)\r\n * - src/features/ (feature directories)\r\n *\r\n * Reference directory (shared components):\r\n * - src/components/ (recursively scanned for .tsx basenames)\r\n *\r\n * The rule collects all .tsx file basenames from src/components/ at\r\n * startup and warns when a .tsx file in a product directory has the\r\n * same basename.\r\n *\r\n * Examples:\r\n * WARN: packages/onlinemenu-module/src/components/EmptyState.tsx\r\n * (when src/components/Shared/EmptyState.tsx exists)\r\n *\r\n * OK: packages/onlinemenu-module/src/components/MenuCard.tsx\r\n * (no matching shared component)\r\n *\r\n * OK: packages/onlinemenu-module/src/index.ts\r\n * (not a .tsx component file)\r\n */\r\n\r\nimport { readdirSync, existsSync } from 'fs';\r\nimport { posix, sep, basename, join } from 'path';\r\n\r\n/**\r\n * Normalize a file path to use forward slashes.\r\n */\r\nfunction normalizePath(filePath) {\r\n return filePath.split(sep).join(posix.sep);\r\n}\r\n\r\n/**\r\n * Recursively collect all .tsx basenames from a directory.\r\n * Skips test files and index files.\r\n */\r\nfunction collectComponentNames(dirPath) {\r\n const names = new Set();\r\n if (!existsSync(dirPath)) return names;\r\n\r\n function walk(dir) {\r\n try {\r\n const entries = readdirSync(dir, { withFileTypes: true });\r\n for (const entry of entries) {\r\n if (entry.isDirectory()) {\r\n walk(join(dir, entry.name));\r\n continue;\r\n }\r\n const name = entry.name;\r\n if (!name.endsWith('.tsx')) continue;\r\n if (name.endsWith('.test.tsx')) continue;\r\n if (name === 'index.tsx') continue;\r\n names.add(name);\r\n }\r\n } catch {\r\n // Directory not readable, skip\r\n }\r\n }\r\n\r\n walk(dirPath);\r\n return names;\r\n}\r\n\r\n/**\r\n * Check whether a file is inside a product-specific directory.\r\n */\r\nfunction isInsideProductDirectory(filePath) {\r\n const normalized = normalizePath(filePath);\r\n return (\r\n normalized.includes('/packages/') &&\r\n normalized.includes('-module/src/')\r\n ) || normalized.includes('/src/features/');\r\n}\r\n\r\n/**\r\n * Find the BaseClient src/components/ directory from a file path.\r\n * Walks up looking for BaseClient/src/components/.\r\n */\r\nfunction findSharedComponentsDir(filePath) {\r\n const normalized = normalizePath(filePath);\r\n const baseClientIdx = normalized.indexOf('/BaseClient/');\r\n if (baseClientIdx === -1) return null;\r\n const baseClientRoot = filePath\r\n .split(sep)\r\n .join(posix.sep)\r\n .slice(0, baseClientIdx + '/BaseClient'.length);\r\n // Convert back to OS path\r\n const osPath = baseClientRoot.split(posix.sep).join(sep);\r\n return join(osPath, 'src', 'components');\r\n}\r\n\r\n/** Cache shared component names per components dir. */\r\nconst sharedNamesCache = new Map();\r\n\r\nconst noDuplicateSharedPatternsRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Warn when product modules create components that share names ' +\r\n 'with existing shared components in src/components/.',\r\n category: 'Best Practices',\r\n recommended: false,\r\n },\r\n schema: [],\r\n messages: {\r\n duplicateSharedPattern:\r\n '\"{{fileName}}\" already exists as a shared component in ' +\r\n 'src/components/. Consider reusing the shared version or ' +\r\n 'renaming this component to clarify its purpose.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return {};\r\n\r\n // Only check .tsx files (components)\r\n if (!filePath.endsWith('.tsx')) return {};\r\n\r\n const fileName = basename(filePath);\r\n\r\n // Skip test files and index files\r\n if (fileName.endsWith('.test.tsx')) return {};\r\n if (fileName === 'index.tsx') return {};\r\n\r\n // Only check files in product-specific directories\r\n if (!isInsideProductDirectory(filePath)) return {};\r\n\r\n return {\r\n Program() {\r\n const componentsDir = findSharedComponentsDir(filePath);\r\n if (!componentsDir) return;\r\n\r\n // Cache the shared component names\r\n if (!sharedNamesCache.has(componentsDir))\r\n sharedNamesCache.set(\r\n componentsDir,\r\n collectComponentNames(componentsDir),\r\n );\r\n\r\n const sharedNames = sharedNamesCache.get(componentsDir);\r\n\r\n if (sharedNames.has(fileName))\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'duplicateSharedPattern',\r\n data: { fileName },\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-duplicate-shared-patterns': noDuplicateSharedPatternsRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Generated Models Barrel Value Import\r\n *\r\n * Disallows runtime (value) imports from the auto-generated model barrels:\r\n * server/autoGeneratedHooks/<service>/models\r\n * server/autoGeneratedHooks/<service>/models/index\r\n *\r\n * These barrels re-export all generated types for a service. Importing runtime\r\n * values from them pulls the entire barrel into the module graph, preventing\r\n * tree-shaking and inflating bundle size.\r\n *\r\n * Type-only imports are always allowed:\r\n * import type { Foo } from '../../server/autoGeneratedHooks/questioner/models'; // OK\r\n * import { type Foo } from '../../server/autoGeneratedHooks/questioner/models'; // OK\r\n *\r\n * Runtime value imports must target the specific leaf module instead:\r\n * import { QuestionType } from '../../server/autoGeneratedHooks/questioner/models/questionType'; // OK\r\n */\r\n\r\n/** Matches any path ending in autoGeneratedHooks/<service>/models or …/models/index */\r\nconst BARREL_PATTERN = /autoGeneratedHooks\\/[^/]+\\/models(?:\\/index)?$/;\r\n\r\nfunction isTypeOnlyImport(node) {\r\n if (node.importKind === 'type') return true;\r\n\r\n const specifiers = node.specifiers ?? [];\r\n if (specifiers.length === 0) return false;\r\n\r\n return specifiers.every((s) => s.importKind === 'type');\r\n}\r\n\r\nconst noGeneratedModelsBarrelValueImportRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow runtime (value) imports from generated model barrels; use specific leaf modules or type-only imports.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n noValueImport:\r\n 'Do not import runtime values from \"{{module}}\". Import from a specific leaf model module instead (e.g. …/models/questionType). Type-only imports are allowed.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n ImportDeclaration(node) {\r\n const moduleName = node.source?.value;\r\n if (typeof moduleName !== 'string') return;\r\n if (!BARREL_PATTERN.test(moduleName)) return;\r\n if (isTypeOnlyImport(node)) return;\r\n\r\n context.report({\r\n node,\r\n messageId: 'noValueImport',\r\n data: { module: moduleName },\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-generated-models-barrel-value-import': noGeneratedModelsBarrelValueImportRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Null/Undefined Check\r\n *\r\n * Prohibits direct null/undefined checks (!== null, === null, !== undefined, === undefined)\r\n * and requires using isValueDefined() or isNullOrUndefined() from '@dloizides/utils' instead.\r\n *\r\n * These utility functions handle both null and undefined, providing\r\n * consistent and safer null checking across the codebase.\r\n *\r\n * Examples:\r\n * BAD: if (item !== null) { ... }\r\n * BAD: if (item !== undefined) { ... }\r\n * GOOD: if (isValueDefined(item)) { ... }\r\n *\r\n * BAD: if (item === null) { ... }\r\n * BAD: if (item === undefined) { ... }\r\n * GOOD: if (!isValueDefined(item)) { ... }\r\n * GOOD: if (isNullOrUndefined(item)) { ... }\r\n */\r\n\r\n/** Where `isValueDefined` is imported from when the fixer has to add the import. */\r\nconst DEFAULT_UTIL_IMPORT_PATH = '@dloizides/utils';\r\n\r\n/** The guard the autofix rewrites to. Must be in scope for the fixed code to compile. */\r\nconst GUARD_NAME = 'isValueDefined';\r\n\r\n/** How `isValueDefined` is bound in the file under lint, if at all. */\r\nconst BindingKind = {\r\n /** Not bound — the fixer must add an import. */\r\n None: 'none',\r\n /** Already imported — the fixer may rewrite freely. */\r\n Imported: 'imported',\r\n /** Declared/exported *by this file* — never autofix (it would self-import). */\r\n Local: 'local',\r\n};\r\n\r\n/**\r\n * Determine how `isValueDefined` is bound at the top level of `ast`.\r\n *\r\n * This is what makes the autofix safe: before ES-04 the fixer emitted\r\n * `isValueDefined(...)` unconditionally, so `eslint --fix` corrupted every file\r\n * that did not already import it.\r\n */\r\nfunction findGuardBinding(ast) {\r\n for (const statement of ast.body) {\r\n if (statement.type === 'ImportDeclaration') {\r\n for (const specifier of statement.specifiers) {\r\n if (specifier.local && specifier.local.name === GUARD_NAME) return BindingKind.Imported;\r\n }\r\n continue;\r\n }\r\n\r\n // `export { isValueDefined } from './guards/isValueDefined'` — the barrel that\r\n // re-exports the guard. Re-exports create no local binding, but importing the\r\n // guard into its own barrel is still wrong, so treat it as local.\r\n if (statement.type === 'ExportNamedDeclaration') {\r\n for (const specifier of statement.specifiers || []) {\r\n if (specifier.exported && specifier.exported.name === GUARD_NAME) return BindingKind.Local;\r\n }\r\n }\r\n\r\n const declaration =\r\n statement.type === 'ExportNamedDeclaration' ? statement.declaration : statement;\r\n if (!declaration) continue;\r\n\r\n if (declaration.type === 'FunctionDeclaration' && declaration.id?.name === GUARD_NAME) {\r\n return BindingKind.Local;\r\n }\r\n if (declaration.type === 'VariableDeclaration') {\r\n for (const declarator of declaration.declarations) {\r\n if (declarator.id?.type === 'Identifier' && declarator.id.name === GUARD_NAME) {\r\n return BindingKind.Local;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return BindingKind.None;\r\n}\r\n\r\n/**\r\n * Insert `import { isValueDefined } from '<utilImportPath>';` — after the last\r\n * existing import, or at the very top of the file when there are none.\r\n *\r\n * When a file has several violations, every report's fix carries this same\r\n * insertion. ESLint applies one and defers the rest (overlapping ranges), then\r\n * re-runs; on the next pass the import exists, `guardIsImported` is true, and the\r\n * remaining rewrites apply cleanly. Converges in two passes.\r\n */\r\nfunction buildGuardImportFix(fixer, sourceCode, utilImportPath) {\r\n const importStatement = `import { ${GUARD_NAME} } from '${utilImportPath}';`;\r\n const body = sourceCode.ast.body;\r\n const imports = body.filter((node) => node.type === 'ImportDeclaration');\r\n\r\n if (imports.length > 0) {\r\n return fixer.insertTextAfter(imports[imports.length - 1], `\\n${importStatement}`);\r\n }\r\n\r\n // No imports yet. Insert before the first statement rather than at offset 0 —\r\n // a node's range excludes its leading comments, so the file's header docblock\r\n // stays on top instead of being pushed below the new import.\r\n if (body.length > 0) {\r\n return fixer.insertTextBefore(body[0], `${importStatement}\\n`);\r\n }\r\n\r\n return fixer.insertTextBeforeRange([0, 0], `${importStatement}\\n`);\r\n}\r\n\r\nconst noNullCheckRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Disallow direct null/undefined checks. Use isValueDefined() or isNullOrUndefined() instead.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n fixable: 'code',\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n utilImportPath: {\r\n type: 'string',\r\n description: 'Import path for the utility functions',\r\n default: '@dloizides/utils',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n noNotEqualsNull:\r\n 'Avoid \"!== null\" checks. Use isValueDefined({{identifier}}) instead, which handles both null and undefined.',\r\n noEqualsNull:\r\n 'Avoid \"=== null\" checks. Use !isValueDefined({{identifier}}) or isNullOrUndefined({{identifier}}) instead.',\r\n noNotEqualsNullComplex:\r\n 'Avoid \"!== null\" checks. Use isValueDefined() instead, which handles both null and undefined.',\r\n noEqualsNullComplex:\r\n 'Avoid \"=== null\" checks. Use !isValueDefined() or isNullOrUndefined() instead.',\r\n noNotEqualsUndefined:\r\n 'Avoid \"!== undefined\" checks. Use isValueDefined({{identifier}}) instead, which handles both null and undefined.',\r\n noEqualsUndefined:\r\n 'Avoid \"=== undefined\" checks. Use !isValueDefined({{identifier}}) or isNullOrUndefined({{identifier}}) instead.',\r\n noNotEqualsUndefinedComplex:\r\n 'Avoid \"!== undefined\" checks. Use isValueDefined() instead, which handles both null and undefined.',\r\n noEqualsUndefinedComplex:\r\n 'Avoid \"=== undefined\" checks. Use !isValueDefined() or isNullOrUndefined() instead.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n const options = context.options[0] || {};\r\n const utilImportPath = options.utilImportPath ?? DEFAULT_UTIL_IMPORT_PATH;\r\n\r\n // The autofix rewrites `x === undefined` to `!isValueDefined(x)`. That is only\r\n // valid source if `isValueDefined` is actually in scope — otherwise `--fix`\r\n // silently produces a file referencing an undeclared global (which then trips\r\n // no-unsafe-call / strict-boolean-expressions). So resolve, ONCE per pass,\r\n // whether the guard is already bound in this file; if not, the fix also\r\n // inserts the import.\r\n const guardBinding = findGuardBinding(sourceCode.ast);\r\n const declaresGuardItself = guardBinding === BindingKind.Local;\r\n const guardIsImported = guardBinding === BindingKind.Imported;\r\n\r\n /**\r\n * Build the fix for one violation: the expression rewrite, plus the\r\n * `isValueDefined` import when the file does not already have it.\r\n *\r\n * Returns `null` (no autofix) for the module that *defines* the guard —\r\n * importing a symbol into the file that exports it would be nonsense.\r\n */\r\n function buildFix(fixer, node, replacementText) {\r\n if (declaresGuardItself) return null;\r\n\r\n const rewrite = fixer.replaceText(node, replacementText);\r\n if (guardIsImported) return rewrite;\r\n\r\n return [rewrite, buildGuardImportFix(fixer, sourceCode, utilImportPath)];\r\n }\r\n\r\n /**\r\n * Check if a node is a null literal\r\n */\r\n function isNullLiteral(node) {\r\n return node && node.type === 'Literal' && node.value === null;\r\n }\r\n\r\n /**\r\n * Check if a node is an undefined identifier\r\n */\r\n function isUndefinedIdentifier(node) {\r\n return node && node.type === 'Identifier' && node.name === 'undefined';\r\n }\r\n\r\n /**\r\n * Get the source text for a node\r\n */\r\n function getNodeText(node) {\r\n return sourceCode.getText(node);\r\n }\r\n\r\n /**\r\n * Check if the identifier is simple enough for a clean message\r\n */\r\n function isSimpleIdentifier(node) {\r\n return (\r\n node.type === 'Identifier' ||\r\n (node.type === 'MemberExpression' && !node.computed)\r\n );\r\n }\r\n\r\n /**\r\n * Handle binary expressions (===, !==)\r\n */\r\n function checkBinaryExpression(node) {\r\n const { operator, left, right } = node;\r\n\r\n // Only handle === and !==\r\n if (operator !== '===' && operator !== '!==') {\r\n return;\r\n }\r\n\r\n // Check if either side is null or undefined\r\n const leftIsNull = isNullLiteral(left);\r\n const rightIsNull = isNullLiteral(right);\r\n const leftIsUndefined = isUndefinedIdentifier(left);\r\n const rightIsUndefined = isUndefinedIdentifier(right);\r\n\r\n const isNullCheck = leftIsNull || rightIsNull;\r\n const isUndefinedCheck = leftIsUndefined || rightIsUndefined;\r\n\r\n if (!isNullCheck && !isUndefinedCheck) {\r\n return;\r\n }\r\n\r\n // Get the non-null/undefined operand\r\n const valueNode = (leftIsNull || leftIsUndefined) ? right : left;\r\n const valueText = getNodeText(valueNode);\r\n const isSimple = isSimpleIdentifier(valueNode);\r\n\r\n if (operator === '!==') {\r\n // item !== null/undefined -> isValueDefined(item)\r\n const messageId = isNullCheck\r\n ? (isSimple ? 'noNotEqualsNull' : 'noNotEqualsNullComplex')\r\n : (isSimple ? 'noNotEqualsUndefined' : 'noNotEqualsUndefinedComplex');\r\n\r\n context.report({\r\n node,\r\n messageId,\r\n data: isSimple ? { identifier: valueText } : {},\r\n fix(fixer) {\r\n return buildFix(fixer, node, `isValueDefined(${valueText})`);\r\n },\r\n });\r\n } else {\r\n // item === null/undefined -> !isValueDefined(item)\r\n const messageId = isNullCheck\r\n ? (isSimple ? 'noEqualsNull' : 'noEqualsNullComplex')\r\n : (isSimple ? 'noEqualsUndefined' : 'noEqualsUndefinedComplex');\r\n\r\n context.report({\r\n node,\r\n messageId,\r\n data: isSimple ? { identifier: valueText } : {},\r\n fix(fixer) {\r\n return buildFix(fixer, node, `!isValueDefined(${valueText})`);\r\n },\r\n });\r\n }\r\n }\r\n\r\n return {\r\n BinaryExpression: checkBinaryExpression,\r\n };\r\n },\r\n};\r\n\r\n/**\r\n * Export the plugin\r\n */\r\nexport default {\r\n rules: {\r\n 'no-null-check': noNullCheckRule,\r\n },\r\n};\r\n","/**\r\n * ESLint rule: no-optional-undefined\r\n *\r\n * Prevents declaring optional properties/parameters with explicit `| undefined`\r\n * in the type annotation. With `exactOptionalPropertyTypes: true`, `?: T` and\r\n * `?: T | undefined` are semantically different, but the correct practice is to\r\n * use `?: T` and fix the assignment side (omit the key) rather than widening the\r\n * type with `| undefined`.\r\n *\r\n * Bad: pageCount?: number | undefined;\r\n * Good: pageCount?: number;\r\n *\r\n * Bad: function foo(bar?: string | undefined) {}\r\n * Good: function foo(bar?: string) {}\r\n */\r\n\r\n/** @type {import('eslint').ESLint.Plugin} */\r\nexport default {\r\n rules: {\r\n 'no-optional-undefined': {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Disallow combining optional marker (?) with `| undefined` in type annotations',\r\n },\r\n messages: {\r\n noOptionalUndefined:\r\n 'Do not combine optional (?) with `| undefined`. Use `?: {{type}}` and omit the key when the value is undefined.',\r\n },\r\n schema: [],\r\n },\r\n create(context) {\r\n /**\r\n * Check if a type annotation is a union containing `undefined`.\r\n * Returns the cleaned type string (without undefined) if found,\r\n * otherwise returns null.\r\n */\r\n function getTypeWithoutUndefined(typeAnnotation) {\r\n if (!typeAnnotation || typeAnnotation.type !== 'TSUnionType') return null;\r\n\r\n const hasUndefined = typeAnnotation.types.some(\r\n (t) => t.type === 'TSUndefinedKeyword',\r\n );\r\n if (!hasUndefined) return null;\r\n\r\n const nonUndefinedTypes = typeAnnotation.types.filter(\r\n (t) => t.type !== 'TSUndefinedKeyword',\r\n );\r\n\r\n const sourceCode = context.sourceCode ?? context.getSourceCode();\r\n if (nonUndefinedTypes.length === 1)\r\n return sourceCode.getText(nonUndefinedTypes[0]);\r\n\r\n return nonUndefinedTypes.map((t) => sourceCode.getText(t)).join(' | ');\r\n }\r\n\r\n function checkNode(node, typeAnnotationNode) {\r\n if (!node.optional) return;\r\n if (!typeAnnotationNode) return;\r\n\r\n const annotation =\r\n typeAnnotationNode.typeAnnotation ?? typeAnnotationNode;\r\n const cleanType = getTypeWithoutUndefined(annotation);\r\n if (cleanType === null) return;\r\n\r\n context.report({\r\n node: typeAnnotationNode,\r\n messageId: 'noOptionalUndefined',\r\n data: { type: cleanType },\r\n });\r\n }\r\n\r\n return {\r\n // Interface / type alias properties: foo?: string | undefined\r\n TSPropertySignature(node) {\r\n checkNode(node, node.typeAnnotation?.typeAnnotation);\r\n },\r\n // Function parameters: function foo(bar?: string | undefined)\r\n // Arrow functions, methods, etc.\r\n Identifier(node) {\r\n if (!node.optional) return;\r\n // Only check function parameters\r\n const parent = node.parent;\r\n if (!parent) return;\r\n const isParam =\r\n (parent.type === 'FunctionDeclaration' ||\r\n parent.type === 'FunctionExpression' ||\r\n parent.type === 'ArrowFunctionExpression') &&\r\n parent.params.includes(node);\r\n if (!isParam) return;\r\n\r\n checkNode(node, node.typeAnnotation?.typeAnnotation);\r\n },\r\n };\r\n },\r\n },\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Product Imports in Shared\r\n *\r\n * Prevents product-specific imports inside `src/components/`.\r\n * Shared components must not depend on product modules, feature\r\n * directories, or product-specific auto-generated API hooks.\r\n * This ensures shared components remain reusable across all products.\r\n *\r\n * Banned import sources (when the importing file is under src/components/):\r\n * - @baseclient/*-module (except identity-module, which is shared infra)\r\n * - server/autoGeneratedHooks/{onlinemenu,questioner,content,notification}/\r\n * - src/features/ or src/modules/\r\n *\r\n * Allowed:\r\n * - @baseclient/core, @baseclient/identity-client (shared infra)\r\n * - src/shared/, src/lib/, src/localization/, src/components/\r\n * - External packages (react, react-native, etc.)\r\n * - Relative imports within src/components/\r\n *\r\n * Examples:\r\n * BAD: import { X } from '@baseclient/onlinemenu-module';\r\n * BAD: import { Y } from '../../server/autoGeneratedHooks/questioner/...';\r\n * BAD: import type { Z } from '@baseclient/questioner-module';\r\n * GOOD: import { A } from '@baseclient/core';\r\n * GOOD: import { B } from '../../shared/utils';\r\n */\r\n\r\nimport { posix, sep } from 'path';\r\n\r\n/**\r\n * Scoped @baseclient packages that are shared infrastructure\r\n * and allowed in src/components/.\r\n */\r\nconst ALLOWED_BASECLIENT_PACKAGES = new Set([\r\n '@baseclient/core',\r\n '@baseclient/identity-client',\r\n '@baseclient/identity-module',\r\n]);\r\n\r\n/**\r\n * Product-specific auto-generated hook directory names under\r\n * server/autoGeneratedHooks/ that are banned.\r\n */\r\nconst PRODUCT_HOOK_DIRS = new Set([\r\n 'onlinemenu',\r\n 'questioner',\r\n 'content',\r\n 'notification',\r\n]);\r\n\r\n/**\r\n * Normalize a file path to use forward slashes for consistent matching.\r\n */\r\nfunction normalizePath(filePath) {\r\n return filePath.split(sep).join(posix.sep);\r\n}\r\n\r\n/**\r\n * Check whether a file path is inside src/components/.\r\n */\r\nfunction isInsideSharedComponents(filePath) {\r\n const normalized = normalizePath(filePath);\r\n return normalized.includes('/src/components/');\r\n}\r\n\r\n/**\r\n * Check whether an import source is a banned @baseclient product module.\r\n * Bans any @baseclient/*-module package except those in the allow list.\r\n */\r\nfunction isBannedBaseclientModule(source) {\r\n if (!source.startsWith('@baseclient/')) return false;\r\n if (ALLOWED_BASECLIENT_PACKAGES.has(source)) return false;\r\n return source.endsWith('-module');\r\n}\r\n\r\n/**\r\n * Check whether an import source resolves to a product-specific\r\n * auto-generated hooks directory.\r\n */\r\nfunction isBannedAutoGeneratedHook(source) {\r\n const normalized = normalizePath(source);\r\n for (const dir of PRODUCT_HOOK_DIRS) {\r\n if (normalized.includes(`autoGeneratedHooks/${dir}`)) return true;\r\n if (normalized.includes(`autoGeneratedHooks/${dir}/`)) return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Check whether an import source points to src/features/ or src/modules/.\r\n */\r\nfunction isBannedFeatureOrModulePath(source) {\r\n const normalized = normalizePath(source);\r\n return (\r\n normalized.includes('/src/features/') ||\r\n normalized.includes('/src/modules/') ||\r\n normalized.includes('/features/') ||\r\n normalized.includes('/modules/')\r\n );\r\n}\r\n\r\nconst noProductImportsInSharedRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow product-specific imports in src/components/. ' +\r\n 'Shared components must not depend on product modules.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n productImportInShared:\r\n 'Shared components in src/components/ must not import from ' +\r\n 'product-specific modules ({{source}}). Move product-specific ' +\r\n 'logic to the feature module, or extract shared types to ' +\r\n '@baseclient/core.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return {};\r\n\r\n // Only apply to files inside src/components/\r\n if (!isInsideSharedComponents(filePath)) return {};\r\n\r\n /**\r\n * Check a single import/export declaration for banned sources.\r\n */\r\n function checkImportSource(node) {\r\n const source = node.source;\r\n if (!source) return;\r\n\r\n const importPath = source.value;\r\n if (typeof importPath !== 'string') return;\r\n\r\n const isBanned =\r\n isBannedBaseclientModule(importPath) ||\r\n isBannedAutoGeneratedHook(importPath) ||\r\n isBannedFeatureOrModulePath(importPath);\r\n\r\n if (isBanned)\r\n context.report({\r\n node,\r\n messageId: 'productImportInShared',\r\n data: { source: importPath },\r\n });\r\n }\r\n\r\n return {\r\n ImportDeclaration: checkImportSource,\r\n ExportNamedDeclaration: checkImportSource,\r\n ExportAllDeclaration: checkImportSource,\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-product-imports-in-shared': noProductImportsInSharedRule,\r\n },\r\n};\r\n","/**\n * Custom ESLint Plugin: No Raw Color Literal\n *\n * Turns \"use design tokens, not hardcoded colours\" from a convention into a gate.\n *\n * Why this exists: a raw colour literal is invisible until you try to rebrand. Changing the\n * PROOViD accent from indigo to sky-blue meant a find-and-replace of `#4f46e5` across a dozen\n * docs files plus three C# controllers, because every surface had hardcoded its own accent —\n * archaeology instead of one token edit. Every literal you allow today is a file someone greps\n * later. Colours belong in `@dloizides/design-tokens` and reach components through the theme.\n *\n * Examples:\n * FLAGGED: const c = '#38bdf8';\n * FLAGGED: backgroundColor: '#fff'\n * FLAGGED: boxShadow: `0 0 0 3px rgba(56, 189, 248, .15)`\n * FLAGGED: border: 'hsl(200 90% 60%)'\n *\n * NOT FLAGGED:\n * colors.primary // from the theme\n * theme.palette.primary['500'] // from the theme\n * '#main-content' // an anchor/selector, not a colour\n * 'transparent' / 'currentColor' // keywords, not literals to tokenise\n * anything under a path in the `allow` option (token/theme definitions must\n * state real colours SOMEWHERE — that somewhere is the token package)\n *\n * Options:\n * { allow: string[] } path substrings that are exempt, e.g.\n * [\"design-tokens\", \"theme/tokens\", \".test.\"]\n * The package owns the rule logic; the app owns which paths are exempt and the\n * severity — the same split as every other rule in this pack.\n */\n\n/** A string that IS a colour: #rgb, #rgba, #rrggbb, #rrggbbaa. Anchored, so `#section` is safe. */\nconst FULL_HEX_COLOR = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;\n\n/**\n * Functional colour syntax anywhere in the string. Unanchored on purpose: these show up INSIDE\n * bigger values (gradients, shadows) where the literal is not itself a bare colour, e.g.\n * `0 8px 22px -8px rgba(56,189,248,.7)`.\n */\nconst FUNCTIONAL_COLOR = /\\b(?:rgba?|hsla?)\\s*\\(/;\n\n/** True when the raw source text contains a colour we want tokenised. */\nfunction containsRawColor(text) {\n if (typeof text !== 'string' || text.length === 0) return false;\n if (FULL_HEX_COLOR.test(text.trim())) return true;\n return FUNCTIONAL_COLOR.test(text);\n}\n\n/** True when this file is exempt (token/theme definitions, or whatever the app allows). */\nfunction isAllowedFile(filename, allow) {\n if (typeof filename !== 'string') return false;\n const normalised = filename.split('\\\\').join('/');\n return allow.some((fragment) => normalised.includes(fragment));\n}\n\nconst noRawColorLiteralRule = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow raw colour literals (hex / rgb() / hsl()) in app code. Colours belong in @dloizides/design-tokens and reach components through the theme.',\n category: 'Best Practices',\n recommended: true,\n },\n schema: [\n {\n type: 'object',\n properties: {\n allow: {\n type: 'array',\n items: { type: 'string' },\n },\n },\n additionalProperties: false,\n },\n ],\n messages: {\n rawColor:\n 'Raw colour literal \"{{value}}\" — use a design token instead (@dloizides/design-tokens via the theme). Hardcoded colours make a rebrand a find-and-replace across every file.',\n },\n },\n\n create(context) {\n const options = context.options[0] ?? {};\n const allow = Array.isArray(options.allow) ? options.allow : [];\n\n const filename =\n typeof context.getFilename === 'function' ? context.getFilename() : context.filename;\n\n if (isAllowedFile(filename, allow)) return {};\n\n /** Report `node`, trimming the display value so a long gradient stays readable. */\n const report = (node, rawValue) => {\n const value = rawValue.trim();\n const display = value.length > 40 ? `${value.slice(0, 40)}…` : value;\n context.report({ node, messageId: 'rawColor', data: { value: display } });\n };\n\n return {\n Literal(node) {\n if (typeof node.value !== 'string') return;\n if (!containsRawColor(node.value)) return;\n report(node, node.value);\n },\n\n // Template literals: check each static chunk, so an interpolated value\n // (`${primary}`) is fine but a baked-in rgba(...) chunk is not.\n TemplateElement(node) {\n const raw = node.value?.raw;\n if (!containsRawColor(raw)) return;\n report(node, raw);\n },\n };\n },\n};\n\nexport default {\n rules: {\n 'no-raw-color-literal': noRawColorLiteralRule,\n },\n};\n","/**\r\n * Custom ESLint Plugin: Prefer Const Enum\r\n *\r\n * Flags type aliases where ALL union members are string literals (2+ members)\r\n * and suggests converting to const enum.\r\n *\r\n * Examples:\r\n * FLAGGED: type Mode = 'light' | 'dark';\r\n * FLAGGED: export type Status = 'active' | 'inactive' | 'pending';\r\n *\r\n * NOT FLAGGED:\r\n * type Result = Success | Error; // Union of type references\r\n * type Nullable<T> = T | null; // Contains null keyword\r\n * type Mixed = 'a' | number; // Contains non-string member\r\n * type Single = 'only'; // Single value, not a union\r\n * type Callback = () => void; // Function type\r\n */\r\n\r\n/**\r\n * Convert a string literal value to a PascalCase enum member name.\r\n *\r\n * 'light' -> 'Light'\r\n * 'modern-grid' -> 'ModernGrid'\r\n * 'UPPER_CASE' -> 'UpperCase'\r\n * '2xl' -> '_2xl'\r\n */\r\nfunction toPascalCase(value) {\r\n // Split on hyphens, underscores, spaces, and camelCase boundaries\r\n const words = value\r\n .replace(/([a-z])([A-Z])/g, '$1 $2')\r\n .split(/[-_\\s]+/)\r\n .filter((w) => w.length > 0);\r\n\r\n const result = words\r\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\r\n .join('');\r\n\r\n // If starts with a digit, prefix with underscore\r\n if (/^\\d/.test(result)) return `_${result}`;\r\n\r\n return result;\r\n}\r\n\r\nconst preferConstEnumRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Prefer const enum over string literal union types for better autocomplete, refactoring, and centralized definitions.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n hasSuggestions: true,\r\n schema: [],\r\n messages: {\r\n preferConstEnum:\r\n 'String literal union type \"{{name}}\" should be a const enum. Const enums provide autocomplete, refactoring support, and centralized definitions.',\r\n convertToConstEnum: 'Convert \"{{name}}\" to const enum',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n TSTypeAliasDeclaration(node) {\r\n const { typeAnnotation } = node;\r\n\r\n // Must be a union type\r\n if (typeAnnotation.type !== 'TSUnionType') return;\r\n\r\n const { types } = typeAnnotation;\r\n\r\n // Must have 2+ members\r\n if (types.length < 2) return;\r\n\r\n // ALL members must be string literals\r\n const allStringLiterals = types.every(\r\n (member) =>\r\n member.type === 'TSLiteralType' &&\r\n member.literal.type === 'Literal' &&\r\n typeof member.literal.value === 'string',\r\n );\r\n\r\n if (!allStringLiterals) return;\r\n\r\n const typeName = node.id.name;\r\n const isExported =\r\n node.parent.type === 'ExportNamedDeclaration';\r\n const exportPrefix = isExported ? 'export ' : '';\r\n\r\n // Build the const enum suggestion\r\n const enumMembers = types\r\n .map((member) => {\r\n const value = member.literal.value;\r\n const memberName = toPascalCase(value);\r\n return ` ${memberName} = '${value}',`;\r\n })\r\n .join('\\n');\r\n\r\n const replacement = `${exportPrefix}const enum ${typeName} {\\n${enumMembers}\\n}`;\r\n\r\n // The node to replace depends on whether it's exported\r\n const targetNode = isExported ? node.parent : node;\r\n\r\n context.report({\r\n node: node.id,\r\n messageId: 'preferConstEnum',\r\n data: { name: typeName },\r\n suggest: [\r\n {\r\n messageId: 'convertToConstEnum',\r\n data: { name: typeName },\r\n fix(fixer) {\r\n return fixer.replaceText(targetNode, replacement);\r\n },\r\n },\r\n ],\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'prefer-const-enum': preferConstEnumRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Require Stable Hook Arguments\r\n *\r\n * Detects functions, objects, and arrays declared in React component scope\r\n * that are passed as arguments to custom hooks (use*) without being wrapped\r\n * in useCallback or useMemo. These unstable references cause infinite\r\n * re-render loops when the hook uses them in useEffect dependency arrays.\r\n *\r\n * Examples:\r\n * BAD: const t = (key) => i18nT(key);\r\n * useQuizForm(data, t); // t is new ref every render\r\n *\r\n * GOOD: const t = useCallback((key) => i18nT(key), [i18nT]);\r\n * useQuizForm(data, t); // t is stable\r\n *\r\n * BAD: const config = { theme: 'dark' };\r\n * useMyHook(config); // config is new ref every render\r\n *\r\n * GOOD: const config = useMemo(() => ({ theme: 'dark' }), []);\r\n * useMyHook(config); // config is stable\r\n */\r\n\r\n/**\r\n * Names of hooks/functions whose return values are considered stable\r\n * (don't need further wrapping in useCallback/useMemo).\r\n */\r\nconst STABLE_INIT_CALLS = new Set([\r\n 'useCallback',\r\n 'useMemo',\r\n 'useRef',\r\n 'useState',\r\n 'useReducer',\r\n 'useContext',\r\n 'useId',\r\n 'useDeferredValue',\r\n 'useTransition',\r\n 'useSyncExternalStore',\r\n 'useActionState',\r\n 'useFormStatus',\r\n 'useOptimistic',\r\n 'StyleSheet.create',\r\n 'Object.freeze',\r\n]);\r\n\r\n/**\r\n * Hooks that should NOT trigger this rule. Includes:\r\n * - React built-in hooks\r\n * - Well-known library hooks that safely handle unstable references\r\n * (they don't put callback arguments into useEffect dependency arrays)\r\n */\r\nconst IGNORED_HOOKS = new Set([\r\n // React built-in\r\n 'useState',\r\n 'useEffect',\r\n 'useLayoutEffect',\r\n 'useCallback',\r\n 'useMemo',\r\n 'useRef',\r\n 'useReducer',\r\n 'useContext',\r\n 'useImperativeHandle',\r\n 'useDebugValue',\r\n 'useId',\r\n 'useDeferredValue',\r\n 'useTransition',\r\n 'useSyncExternalStore',\r\n 'useInsertionEffect',\r\n 'useActionState',\r\n 'useFormStatus',\r\n 'useOptimistic',\r\n 'use',\r\n // Redux - selector runs on every render by design\r\n 'useSelector',\r\n 'useDispatch',\r\n 'useStore',\r\n // React Query / TanStack Query - callbacks are not deps\r\n 'useQuery',\r\n 'useMutation',\r\n 'useInfiniteQuery',\r\n 'useQueryClient',\r\n 'useSuspenseQuery',\r\n 'useSuspenseInfiniteQuery',\r\n 'useQueries',\r\n 'usePrefetchQuery',\r\n 'useIsFetching',\r\n 'useIsMutating',\r\n // React Navigation / Expo Router\r\n 'useNavigation',\r\n 'useRoute',\r\n 'useRouter',\r\n 'usePathname',\r\n 'useSegments',\r\n 'useSearchParams',\r\n 'useLocalSearchParams',\r\n 'useGlobalSearchParams',\r\n 'useFocusEffect',\r\n 'useNavigationState',\r\n // i18next\r\n 'useTranslation',\r\n // Zustand - selector runs on every render\r\n 'useStoreWithEqualityFn',\r\n // React Spring / Animated\r\n 'useSpring',\r\n 'useSprings',\r\n 'useTrail',\r\n 'useChain',\r\n // Syncfusion\r\n 'useDynamicFormStyles',\r\n // React Hook Form - options object is safely handled\r\n 'useForm',\r\n 'useFormContext',\r\n 'useController',\r\n 'useWatch',\r\n 'useFieldArray',\r\n]);\r\n\r\n/**\r\n * Check if a node is an unstable initializer (function, object, or array literal\r\n * NOT wrapped in useCallback/useMemo/other stable call).\r\n */\r\nfunction isUnstableInit(initNode) {\r\n if (!initNode) return null;\r\n\r\n // Arrow functions and function expressions are unstable\r\n if (\r\n initNode.type === 'ArrowFunctionExpression' ||\r\n initNode.type === 'FunctionExpression'\r\n )\r\n return 'function';\r\n\r\n // Object literals are unstable\r\n if (initNode.type === 'ObjectExpression') return 'object';\r\n\r\n // Array literals are unstable\r\n if (initNode.type === 'ArrayExpression') return 'array';\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Check if a call expression is a stable initializer (useCallback, useMemo, etc.)\r\n */\r\nfunction isStableCall(initNode) {\r\n if (initNode.type !== 'CallExpression') return false;\r\n\r\n const callee = initNode.callee;\r\n\r\n // Direct call: useCallback(...), useMemo(...)\r\n if (callee.type === 'Identifier')\r\n return STABLE_INIT_CALLS.has(callee.name);\r\n\r\n // Member expression: StyleSheet.create(...), Object.freeze(...)\r\n if (\r\n callee.type === 'MemberExpression' &&\r\n callee.object.type === 'Identifier' &&\r\n callee.property.type === 'Identifier'\r\n )\r\n return STABLE_INIT_CALLS.has(`${callee.object.name}.${callee.property.name}`);\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Get the callee name from a CallExpression node.\r\n */\r\nfunction getCalleeName(callNode) {\r\n const callee = callNode.callee;\r\n if (callee.type === 'Identifier') return callee.name;\r\n if (\r\n callee.type === 'MemberExpression' &&\r\n callee.object.type === 'Identifier' &&\r\n callee.property.type === 'Identifier'\r\n )\r\n return `${callee.object.name}.${callee.property.name}`;\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Check if a function name looks like a custom hook (starts with \"use\" + uppercase).\r\n */\r\nfunction isCustomHookName(name, extraIgnored, patterns) {\r\n if (!name || name.length <= 3 || !name.startsWith('use')) return false;\r\n const charAfterUse = name[3];\r\n const isUpperCase = charAfterUse === charAfterUse.toUpperCase() && charAfterUse !== charAfterUse.toLowerCase();\r\n if (!isUpperCase) return false;\r\n if (IGNORED_HOOKS.has(name)) return false;\r\n if (extraIgnored && extraIgnored.has(name)) return false;\r\n if (patterns && patterns.some((re) => re.test(name))) return false;\r\n return true;\r\n}\r\n\r\n/**\r\n * Check if a node is inside a React component or custom hook (function scope\r\n * where this rule applies).\r\n */\r\nfunction isInsideComponentOrHook(node) {\r\n let current = node.parent;\r\n while (current) {\r\n const isFunction =\r\n current.type === 'FunctionDeclaration' ||\r\n current.type === 'FunctionExpression' ||\r\n current.type === 'ArrowFunctionExpression';\r\n\r\n if (isFunction) {\r\n // Check if it's a component (PascalCase) or hook (use* prefix)\r\n const name = getFunctionName(current);\r\n if (!name) return false;\r\n const isPascalCase = name[0] === name[0].toUpperCase() && name[0] !== name[0].toLowerCase();\r\n const isHook = name.length > 3 && name.startsWith('use');\r\n return isPascalCase || isHook;\r\n }\r\n current = current.parent;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Get the name of a function node.\r\n */\r\nfunction getFunctionName(funcNode) {\r\n // function Foo() {}\r\n if (funcNode.id) return funcNode.id.name;\r\n\r\n // const Foo = () => {} or const Foo = function() {}\r\n if (\r\n funcNode.parent &&\r\n funcNode.parent.type === 'VariableDeclarator' &&\r\n funcNode.parent.id &&\r\n funcNode.parent.id.type === 'Identifier'\r\n )\r\n return funcNode.parent.id.name;\r\n\r\n return null;\r\n}\r\n\r\nconst requireStableHookArgsRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow passing unstable functions/objects/arrays to custom hooks. Wrap in useCallback/useMemo to prevent infinite re-renders.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n ignoreHooks: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Additional hook names to ignore (e.g., [\"useMyLibraryHook\"])',\r\n },\r\n ignoreHookPatterns: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Regex patterns for hook names to ignore (e.g., [\"^useIdentityService\", \"^useQuestionerWeb\"])',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n unstableFunction:\r\n 'Unstable function \"{{name}}\" passed to hook \"{{hook}}\". Wrap in useCallback() to prevent infinite re-renders.',\r\n unstableObject:\r\n 'Unstable object \"{{name}}\" passed to hook \"{{hook}}\". Wrap in useMemo() to prevent infinite re-renders.',\r\n unstableArray:\r\n 'Unstable array \"{{name}}\" passed to hook \"{{hook}}\". Wrap in useMemo() to prevent infinite re-renders.',\r\n unstableInlineFunction:\r\n 'Inline function passed to hook \"{{hook}}\". Extract to a useCallback() variable to prevent infinite re-renders.',\r\n unstableInlineObject:\r\n 'Inline object passed to hook \"{{hook}}\". Extract to a useMemo() variable to prevent infinite re-renders.',\r\n unstableInlineArray:\r\n 'Inline array passed to hook \"{{hook}}\". Extract to a useMemo() variable to prevent infinite re-renders.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const extraIgnored = options.ignoreHooks ? new Set(options.ignoreHooks) : null;\r\n const ignorePatterns = (options.ignoreHookPatterns || []).map((p) => new RegExp(p));\r\n // Track unstable variable declarations: name -> { type, node }\r\n const unstableVars = new Map();\r\n\r\n return {\r\n /**\r\n * Track variable declarations with unstable initializers.\r\n * e.g., const t = (key) => i18nT(key);\r\n */\r\n VariableDeclarator(node) {\r\n if (\r\n !node.id ||\r\n node.id.type !== 'Identifier' ||\r\n !node.init\r\n )\r\n return;\r\n\r\n // Skip if the init is a stable call (useCallback, useMemo, etc.)\r\n if (isStableCall(node.init)) return;\r\n\r\n const unstableType = isUnstableInit(node.init);\r\n if (!unstableType) return;\r\n\r\n // Only track if inside a component or hook\r\n if (!isInsideComponentOrHook(node)) return;\r\n\r\n unstableVars.set(node.id.name, {\r\n type: unstableType,\r\n node: node,\r\n });\r\n },\r\n\r\n /**\r\n * Check call expressions that look like custom hooks.\r\n * Flag any arguments that reference unstable variables or are inline literals.\r\n */\r\n CallExpression(node) {\r\n const hookName = getCalleeName(node);\r\n if (!isCustomHookName(hookName, extraIgnored, ignorePatterns)) return;\r\n if (!isInsideComponentOrHook(node)) return;\r\n\r\n for (const arg of node.arguments) {\r\n // Check identifier arguments against tracked unstable vars\r\n if (arg.type === 'Identifier') {\r\n const tracked = unstableVars.get(arg.name);\r\n if (!tracked) continue;\r\n\r\n const messageMap = {\r\n function: 'unstableFunction',\r\n object: 'unstableObject',\r\n array: 'unstableArray',\r\n };\r\n\r\n context.report({\r\n node: arg,\r\n messageId: messageMap[tracked.type],\r\n data: {\r\n name: arg.name,\r\n hook: hookName,\r\n },\r\n });\r\n continue;\r\n }\r\n\r\n // Check inline unstable arguments (arrow functions, objects, arrays)\r\n const inlineType = isUnstableInit(arg);\r\n if (inlineType) {\r\n const inlineMessageMap = {\r\n function: 'unstableInlineFunction',\r\n object: 'unstableInlineObject',\r\n array: 'unstableInlineArray',\r\n };\r\n\r\n context.report({\r\n node: arg,\r\n messageId: inlineMessageMap[inlineType],\r\n data: { hook: hookName },\r\n });\r\n }\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'require-stable-hook-args': requireStableHookArgsRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Smart Max Lines Per Function\r\n *\r\n * Applies different line limits based on function type:\r\n * - React components (functions returning JSX): higher limit (default 200)\r\n * - Regular functions: stricter limit (default 50)\r\n *\r\n * ⚠️ `functionWarn` is NOT a separate \"warning\" severity.\r\n *\r\n * ESLint has no per-report severity: every `context.report()` a rule makes is\r\n * emitted at the severity the *rule* is configured with. So when this rule is\r\n * configured as `'error'` (as every app does), a `functionWarn` report is an\r\n * ERROR too — a `functionWarn: 30` therefore silently turns the documented\r\n * 50-line limit into a hard 30-line limit. That mismatch is exactly what bit\r\n * ES-04, so `functionWarn` is now **opt-in and disabled by default**: out of the\r\n * box the only enforced threshold is `functionMax` (50), which is what the docs\r\n * have always promised.\r\n *\r\n * Set `functionWarn` only if you deliberately want a *second, stricter* hard\r\n * threshold — it reports at the rule's own severity, not at 'warn'.\r\n */\r\n\r\nconst COMPONENT_MAX_DEFAULT = 200;\r\nconst FUNCTION_MAX_DEFAULT = 50;\r\n/** Disabled by default — see the severity note above. */\r\nconst FUNCTION_WARN_DEFAULT = undefined;\r\n\r\n/**\r\n * Check if an AST node is a JSX element or fragment\r\n */\r\nfunction isJSX(node) {\r\n if (!node) {\r\n return false;\r\n }\r\n return (\r\n node.type === 'JSXElement' ||\r\n node.type === 'JSXFragment'\r\n );\r\n}\r\n\r\n/**\r\n * Check if an expression could resolve to JSX\r\n */\r\nfunction expressionReturnsJSX(node) {\r\n if (!node) {\r\n return false;\r\n }\r\n\r\n // Direct JSX\r\n if (isJSX(node)) {\r\n return true;\r\n }\r\n\r\n // Conditional expression: condition ? <A/> : <B/>\r\n if (node.type === 'ConditionalExpression') {\r\n return expressionReturnsJSX(node.consequent) || expressionReturnsJSX(node.alternate);\r\n }\r\n\r\n // Logical expressions: condition && <A/> or condition || <A/>\r\n if (node.type === 'LogicalExpression') {\r\n return expressionReturnsJSX(node.left) || expressionReturnsJSX(node.right);\r\n }\r\n\r\n // Parenthesized expression\r\n if (node.type === 'ParenthesizedExpression') {\r\n return expressionReturnsJSX(node.expression);\r\n }\r\n\r\n // Sequence expression (rare but possible)\r\n if (node.type === 'SequenceExpression') {\r\n const lastExpr = node.expressions[node.expressions.length - 1];\r\n return expressionReturnsJSX(lastExpr);\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Recursively check if a block contains a return statement with JSX\r\n */\r\nfunction blockReturnsJSX(blockBody) {\r\n if (!blockBody || !Array.isArray(blockBody)) {\r\n return false;\r\n }\r\n\r\n for (const statement of blockBody) {\r\n if (statementReturnsJSX(statement)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Check if a statement returns JSX\r\n */\r\nfunction statementReturnsJSX(statement) {\r\n if (!statement) {\r\n return false;\r\n }\r\n\r\n switch (statement.type) {\r\n case 'ReturnStatement':\r\n return expressionReturnsJSX(statement.argument);\r\n\r\n case 'IfStatement':\r\n // Check consequent\r\n if (statement.consequent) {\r\n if (statement.consequent.type === 'BlockStatement') {\r\n if (blockReturnsJSX(statement.consequent.body)) {\r\n return true;\r\n }\r\n } else if (statementReturnsJSX(statement.consequent)) {\r\n return true;\r\n }\r\n }\r\n // Check alternate (else branch)\r\n if (statement.alternate) {\r\n if (statement.alternate.type === 'BlockStatement') {\r\n if (blockReturnsJSX(statement.alternate.body)) {\r\n return true;\r\n }\r\n } else if (statementReturnsJSX(statement.alternate)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n case 'SwitchStatement':\r\n for (const switchCase of statement.cases) {\r\n if (blockReturnsJSX(switchCase.consequent)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n case 'TryStatement':\r\n if (statement.block && blockReturnsJSX(statement.block.body)) {\r\n return true;\r\n }\r\n if (statement.handler && statement.handler.body && blockReturnsJSX(statement.handler.body.body)) {\r\n return true;\r\n }\r\n if (statement.finalizer && blockReturnsJSX(statement.finalizer.body)) {\r\n return true;\r\n }\r\n return false;\r\n\r\n case 'BlockStatement':\r\n return blockReturnsJSX(statement.body);\r\n\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Check if a function node is a React component (returns JSX)\r\n */\r\nfunction isReactComponent(node) {\r\n // Arrow function with implicit JSX return: () => <div/>\r\n if (node.type === 'ArrowFunctionExpression') {\r\n if (node.body.type !== 'BlockStatement') {\r\n return expressionReturnsJSX(node.body);\r\n }\r\n }\r\n\r\n // Function with block body - check for JSX returns\r\n const body = node.body;\r\n if (body && body.type === 'BlockStatement') {\r\n return blockReturnsJSX(body.body);\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Count effective lines in a function (optionally skipping blanks/comments)\r\n */\r\nfunction countLines(node, sourceCode, skipBlankLines, skipComments) {\r\n const startLine = node.loc.start.line;\r\n const endLine = node.loc.end.line;\r\n\r\n if (!skipBlankLines && !skipComments) {\r\n return endLine - startLine + 1;\r\n }\r\n\r\n const lines = sourceCode.lines.slice(startLine - 1, endLine);\r\n let count = 0;\r\n\r\n // Get all comments in the function\r\n const allComments = sourceCode.getAllComments();\r\n const functionComments = allComments.filter(\r\n (comment) => comment.loc.start.line >= startLine && comment.loc.end.line <= endLine\r\n );\r\n\r\n // Build a set of line numbers that are purely comment lines\r\n const commentOnlyLines = new Set();\r\n if (skipComments) {\r\n for (const comment of functionComments) {\r\n for (let line = comment.loc.start.line; line <= comment.loc.end.line; line++) {\r\n const lineContent = sourceCode.lines[line - 1];\r\n if (lineContent) {\r\n const trimmed = lineContent.trim();\r\n // Check if line is only a comment (starts with // or /* or * for multiline)\r\n const isOnlyComment =\r\n trimmed.startsWith('//') ||\r\n trimmed.startsWith('/*') ||\r\n trimmed.startsWith('*') ||\r\n trimmed.endsWith('*/') ||\r\n trimmed === '';\r\n if (isOnlyComment) {\r\n commentOnlyLines.add(line);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < lines.length; i++) {\r\n const lineNumber = startLine + i;\r\n const lineContent = lines[i];\r\n\r\n // Skip blank lines\r\n if (skipBlankLines && lineContent.trim() === '') {\r\n continue;\r\n }\r\n\r\n // Skip comment-only lines\r\n if (skipComments && commentOnlyLines.has(lineNumber)) {\r\n continue;\r\n }\r\n\r\n count++;\r\n }\r\n\r\n return count;\r\n}\r\n\r\n/**\r\n * The ESLint rule definition\r\n */\r\nconst smartMaxLinesRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Enforce different line limits for React components vs regular functions',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n componentMax: {\r\n type: 'integer',\r\n minimum: 1,\r\n description: 'Maximum lines for React components',\r\n },\r\n functionMax: {\r\n type: 'integer',\r\n minimum: 1,\r\n description: 'Maximum lines for regular functions (error threshold)',\r\n },\r\n functionWarn: {\r\n type: 'integer',\r\n minimum: 1,\r\n description:\r\n 'Optional SECOND, stricter threshold for regular functions. Disabled by default. ' +\r\n 'Reports at the severity the rule is configured with (ESLint has no per-report ' +\r\n 'severity) — it is NOT a \"warning\" tier.',\r\n },\r\n skipBlankLines: {\r\n type: 'boolean',\r\n description: 'Skip blank lines when counting',\r\n },\r\n skipComments: {\r\n type: 'boolean',\r\n description: 'Skip comment lines when counting',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n componentTooLong:\r\n 'React component has too many lines ({{count}}). Maximum allowed is {{max}}.',\r\n functionTooLong:\r\n 'Function has too many lines ({{count}}). Maximum allowed is {{max}}.',\r\n functionWarning:\r\n 'Function has {{count}} lines, over the configured stricter limit of {{warn}}. Consider refactoring.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const componentMax = options.componentMax ?? COMPONENT_MAX_DEFAULT;\r\n const functionMax = options.functionMax ?? FUNCTION_MAX_DEFAULT;\r\n const functionWarn = options.functionWarn ?? FUNCTION_WARN_DEFAULT;\r\n const skipBlankLines = options.skipBlankLines ?? true;\r\n const skipComments = options.skipComments ?? true;\r\n\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n\r\n function checkFunction(node) {\r\n const lineCount = countLines(node, sourceCode, skipBlankLines, skipComments);\r\n const isComponent = isReactComponent(node);\r\n\r\n if (isComponent) {\r\n // React component - apply componentMax limit\r\n if (lineCount > componentMax) {\r\n context.report({\r\n node,\r\n messageId: 'componentTooLong',\r\n data: {\r\n count: String(lineCount),\r\n max: String(componentMax),\r\n },\r\n });\r\n }\r\n } else {\r\n // Regular function - apply functionMax (error) and functionWarn (warning)\r\n if (lineCount > functionMax) {\r\n context.report({\r\n node,\r\n messageId: 'functionTooLong',\r\n data: {\r\n count: String(lineCount),\r\n max: String(functionMax),\r\n },\r\n });\r\n } else if (functionWarn !== undefined && lineCount > functionWarn) {\r\n context.report({\r\n node,\r\n messageId: 'functionWarning',\r\n data: {\r\n count: String(lineCount),\r\n warn: String(functionWarn),\r\n },\r\n });\r\n }\r\n }\r\n }\r\n\r\n return {\r\n FunctionDeclaration: checkFunction,\r\n FunctionExpression: checkFunction,\r\n ArrowFunctionExpression: checkFunction,\r\n };\r\n },\r\n};\r\n\r\n/**\r\n * Export the plugin\r\n */\r\nexport default {\r\n rules: {\r\n 'smart-max-lines': smartMaxLinesRule,\r\n },\r\n};\r\n","import type { CustomRule, FlatConfigPlugin, SingleRulePlugin } from './types';\n\n// The 17 shared custom rules (byte-for-byte the rule logic that lived in\n// erevna-web / katalogos-web `eslint-plugins/*.mjs`). Each module\n// default-exports `{ rules: { '<name>': rule } }`.\nimport enforceFunctionStyle from '../rules/enforce-function-style.js';\nimport enforceModuleStructure from '../rules/enforce-module-structure.js';\nimport enforceRoutePreload from '../rules/enforce-route-preload.js';\nimport enforceTestColocation from '../rules/enforce-test-colocation.js';\nimport enumFileIsolation from '../rules/enum-file-isolation.js';\nimport i18nInterpolation from '../rules/i18n-interpolation.js';\nimport i18nParamNames from '../rules/i18n-param-names.js';\nimport noBarrelCompanionFile from '../rules/no-barrel-companion-file.js';\nimport noDuplicateNavPrefix from '../rules/no-duplicate-nav-prefix.js';\nimport noDuplicateSharedPatterns from '../rules/no-duplicate-shared-patterns.js';\nimport noGeneratedModelsBarrelValueImport from '../rules/no-generated-models-barrel-value-import.js';\nimport noNullCheck from '../rules/no-null-check.js';\nimport noOptionalUndefined from '../rules/no-optional-undefined.js';\nimport noProductImportsInShared from '../rules/no-product-imports-in-shared.js';\nimport noRawColorLiteral from '../rules/no-raw-color-literal.js';\nimport preferConstEnum from '../rules/prefer-const-enum.js';\nimport requireStableHookArgs from '../rules/require-stable-hook-args.js';\nimport smartMaxLines from '../rules/smart-max-lines.js';\n\n// Package version — kept in sync with package.json by the publish flow.\nconst PLUGIN_VERSION = '1.0.0';\n\nconst ruleModules: readonly SingleRulePlugin[] = [\n enforceFunctionStyle,\n enforceModuleStructure,\n enforceRoutePreload,\n enforceTestColocation,\n enumFileIsolation,\n i18nInterpolation,\n i18nParamNames,\n noBarrelCompanionFile,\n noDuplicateNavPrefix,\n noDuplicateSharedPatterns,\n noGeneratedModelsBarrelValueImport,\n noNullCheck,\n noOptionalUndefined,\n noProductImportsInShared,\n noRawColorLiteral,\n preferConstEnum,\n requireStableHookArgs,\n smartMaxLines,\n];\n\nfunction mergeRules(modules: readonly SingleRulePlugin[]): Record<string, CustomRule> {\n const merged: Record<string, CustomRule> = {};\n for (const mod of modules) {\n for (const [name, rule] of Object.entries(mod.rules)) {\n if (merged[name] !== undefined) {\n throw new Error(`Duplicate ESLint rule name: \"${name}\"`);\n }\n merged[name] = rule;\n }\n }\n\n return merged;\n}\n\n/**\n * The flat-config plugin object. Register it under a namespace in the app's\n * `eslint.config.mjs`:\n *\n * ```js\n * import { plugin as devtools } from '@dloizides/frontend-devtools/eslint';\n * export default [{ plugins: { '@dloizides': devtools }, rules: {\n * '@dloizides/no-null-check': 'error',\n * } }];\n * ```\n */\nexport const plugin: FlatConfigPlugin = {\n meta: { name: '@dloizides/frontend-devtools', version: PLUGIN_VERSION },\n rules: mergeRules(ruleModules),\n};\n\n/**\n * The merged rule map alone (the same `Record<name, rule>` that the apps used to\n * spread from 17 separate `eslint-plugins/*.mjs` files).\n */\nexport const rules: Record<string, CustomRule> = plugin.rules;\n\n/**\n * The list of rule names this plugin provides. Useful for migration assertions\n * (prove no rule was dropped vs. the old 17 local files).\n */\nexport const ruleNames: readonly string[] = Object.keys(plugin.rules).sort();\n","import type { CustomRule, FlatConfigPlugin } from './types';\n\nimport { rules } from './plugin';\n\n/**\n * The apps historically registered each custom rule under a namespace EQUAL to\n * its rule name, e.g. `plugins: { 'no-null-check': plugin }` with the rule keyed\n * as `'no-null-check/no-null-check'`. Inline `eslint-disable-next-line\n * no-null-check/no-null-check` comments and config keys depend on that exact\n * `<name>/<name>` shape.\n *\n * To migrate WITHOUT changing a single config key or disable comment, the app\n * spreads {@link legacyPlugins} into its flat config's `plugins` map. Each rule\n * name maps to a one-rule plugin object holding that rule — reproducing the old\n * `import xPlugin from './eslint-plugins/x.mjs'` registration byte-for-byte.\n *\n * ```js\n * import { legacyPlugins } from '@dloizides/frontend-devtools/eslint';\n * export default [{\n * plugins: { ...legacyPlugins },\n * rules: {\n * 'no-null-check/no-null-check': 'error', // unchanged\n * 'smart-max-lines/smart-max-lines': ['error', { functionMax: 50 }],\n * },\n * }];\n * ```\n */\nexport const legacyPlugins: Record<string, FlatConfigPlugin> = buildLegacyPlugins();\n\nfunction buildLegacyPlugins(): Record<string, FlatConfigPlugin> {\n const out: Record<string, FlatConfigPlugin> = {};\n for (const [name, rule] of Object.entries(rules)) {\n out[name] = oneRulePlugin(name, rule);\n }\n\n return out;\n}\n\nfunction oneRulePlugin(name: string, rule: CustomRule): FlatConfigPlugin {\n return {\n meta: { name, version: '1.0.0' },\n rules: { [name]: rule },\n };\n}\n"]}
1
+ {"version":3,"sources":["../../src/rules/comment-utils.js","../../src/rules/doc-comment-max-lines.js","../../src/rules/doc-comment-public-only.js","../../src/rules/enforce-function-style.js","../../src/rules/enforce-module-structure.js","../../src/rules/enforce-route-preload.js","../../src/rules/enforce-test-colocation.js","../../src/rules/enum-file-isolation.js","../../src/rules/i18n-interpolation.js","../../src/rules/i18n-param-names.js","../../src/rules/no-comments.js","../../src/rules/no-barrel-companion-file.js","../../src/rules/no-duplicate-nav-prefix.js","../../src/rules/no-duplicate-shared-patterns.js","../../src/rules/no-generated-models-barrel-value-import.js","../../src/rules/no-null-check.js","../../src/rules/no-optional-undefined.js","../../src/rules/no-product-imports-in-shared.js","../../src/rules/no-raw-color-literal.js","../../src/rules/prefer-const-enum.js","../../src/rules/require-stable-hook-args.js","../../src/rules/smart-max-lines.js","../../src/eslint/plugin.ts","../../src/eslint/legacy.ts","../../src/eslint/configs.ts"],"names":["readdirSync","sep","posix","dirname","basename","fs","path","rule","join","existsSync","normalizePath","isJSX","expressionReturnsJSX","blockReturnsJSX"],"mappings":";;;;;;;;;;;AAAA,IAAM,kBAAA,GAAqB;AAAA,EACzB,6DAAA;AAAA,EACA,cAAA;AAAA,EACA,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,+CAAA;AAAA,EACA,uBAAA;AAAA,EACA,iCAAA;AAAA,EACA,yBAAA;AAAA,EACA,oBAAA;AAAA,EACA,wCAAA;AAAA,EACA,kCAAA;AAAA,EACA,YAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,eAAA,uBAAsB,GAAA,CAAI;AAAA,EAC9B,MAAA;AAAA,EACA,SAAA;AAAA,EACA,WAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,iBAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAC,CAAA;AAED,IAAM,SAAA,GAAY,oBAAA;AAElB,SAAS,WAAW,OAAA,EAAS;AAC3B,EAAA,OAAO,OAAA,CAAQ,SAAS,OAAA,IAAW,OAAA,CAAQ,MAAM,UAAA,CAAW,GAAG,CAAA,IAAK,OAAA,CAAQ,KAAA,KAAU,GAAA;AACxF;AAEA,SAAS,aAAa,OAAA,EAAS;AAC7B,EAAA,OAAO,OAAA,CAAQ,KAAA,CACZ,KAAA,CAAM,CAAC,CAAA,CACP,KAAA,CAAM,OAAO,CAAA,CACb,GAAA,CAAI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AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,EAAE,IAAA,EAAM,OAAA,EAAS,OAAA,EAAQ;AAAA,IAC/B,KAAA,EAAO,EAAE,CAAC,IAAI,GAAGA,KAAAA;AAAK,GACxB;AACF;;;ACvCA,IAAM,qBAAA,GAAwB,CAAA;AAEvB,IAAM,kBAAA,GAAwC;AAAA,EACnD,aAAA;AAAA,EACA,yBAAA;AAAA,EACA;AACF;AAGO,IAAM,cAAA,GAA6B;AAAA,EACxC,OAAA,EAAS,EAAE,YAAA,EAAc,MAAA,EAAgE;AAAA,EACzF,KAAA,EAAO;AAAA,IACL,wBAAA,EAA0B,OAAA;AAAA,IAC1B,oCAAA,EAAsC,OAAA;AAAA,IACtC,oCAAoC,CAAC,OAAA,EAAS,EAAE,GAAA,EAAK,uBAAuB;AAAA;AAEhF","file":"index.js","sourcesContent":["const DIRECTIVE_PATTERNS = [\n /^\\s*eslint(-disable|-enable|-env)?(-next-line|-line)?(\\s|$)/,\n /^\\s*eslint\\s/,\n /^\\s*globals?\\s/,\n /^\\s*exported\\s/,\n /^\\s*@ts-(expect-error|ignore|nocheck|check)\\b/,\n /^\\s*prettier-ignore\\b/,\n /^\\s*(istanbul|c8|v8)\\s+ignore\\b/,\n /^\\s*webpack[A-Z]\\w*\\s*:/,\n /^\\s*@vite-ignore\\b/,\n /^\\s*[#@]__(PURE|NO_SIDE_EFFECTS)__\\s*$/,\n /^\\s*@(jest|vitest)-environment\\b/,\n /^\\s*jscpd:/,\n /^\\s*biome-ignore\\b/,\n /^\\/\\s*<(reference|amd-module)\\b/,\n];\n\nconst JSDOC_TYPE_TAGS = new Set([\n 'type',\n 'typedef',\n 'satisfies',\n 'import',\n 'callback',\n 'template',\n 'property',\n 'jsx',\n 'jsxImportSource',\n 'jsxFrag',\n 'jsxRuntime',\n]);\n\nconst BLOCK_TAG = /^@([A-Za-z][\\w-]*)/;\n\nfunction isDocBlock(comment) {\n return comment.type === 'Block' && comment.value.startsWith('*') && comment.value !== '*';\n}\n\nfunction docBodyLines(comment) {\n return comment.value\n .slice(1)\n .split(/\\r?\\n/)\n .map((line) => line.trim().replace(/^\\*+\\s?/, '').trim())\n .filter((line) => line.length > 0);\n}\n\nfunction blockTags(lines) {\n const tags = [];\n for (const line of lines) {\n const match = BLOCK_TAG.exec(line);\n if (match) tags.push(match[1]);\n }\n\n return tags;\n}\n\nfunction isTypeAnnotationDoc(comment) {\n if (!isDocBlock(comment)) return false;\n const lines = docBodyLines(comment);\n if (lines.length === 0) return false;\n const allTagged = lines.every((line) => BLOCK_TAG.test(line));\n const tags = blockTags(lines);\n\n return allTagged && tags.every((tag) => JSDOC_TYPE_TAGS.has(tag));\n}\n\nfunction compileAllow(allow) {\n return (allow ?? []).map((source) => new RegExp(source));\n}\n\nfunction isDirective(comment, extraPatterns) {\n if (comment.type === 'Shebang') return true;\n const patterns = extraPatterns ? DIRECTIVE_PATTERNS.concat(extraPatterns) : DIRECTIVE_PATTERNS;\n\n return patterns.some((pattern) => pattern.test(comment.value));\n}\n\nfunction removalRange(sourceCode, comment) {\n const text = sourceCode.text;\n let start = comment.range[0];\n let end = comment.range[1];\n while (start > 0 && (text[start - 1] === ' ' || text[start - 1] === '\\t')) start--;\n const ownLine = start === 0 || text[start - 1] === '\\n';\n if (ownLine) {\n if (text[end] === '\\r') end++;\n if (text[end] === '\\n') end++;\n }\n\n return [start, end];\n}\n\nfunction removeSuggestion(sourceCode, comment) {\n return {\n messageId: 'removeComment',\n fix: (fixer) => fixer.removeRange(removalRange(sourceCode, comment)),\n };\n}\n\nexport {\n blockTags,\n compileAllow,\n docBodyLines,\n isDirective,\n isDocBlock,\n isTypeAnnotationDoc,\n removeSuggestion,\n};\n","import { blockTags, docBodyLines, isDocBlock, isTypeAnnotationDoc } from './comment-utils.js';\n\nconst DEFAULT_MAX = 3;\nconst DEFAULT_ALLOWED_TAGS = ['param', 'returns'];\nconst DEFAULT_SUMMARY_MAX_LINES = 1;\nconst DEFAULT_LINE_MAX_CHARS = 120;\nconst CALL_CHAIN = /(→|->|^Flow\\s*:)/i;\nconst PARAM_LINE = /^@(param|returns?)\\b/i;\n\nfunction firstShapeProblem(lines, limits) {\n if (lines.length > limits.max)\n return { messageId: 'tooLong', data: { actual: String(lines.length), max: String(limits.max) } };\n if (lines.some((line) => CALL_CHAIN.test(line))) return { messageId: 'callChain', data: {} };\n const summary = lines.filter((line) => !PARAM_LINE.test(line)).length;\n if (summary > limits.summaryMaxLines)\n return { messageId: 'summaryTooLong', data: { actual: String(summary), max: String(limits.summaryMaxLines) } };\n const long = lines.find((line) => line.length > limits.lineMaxChars);\n if (long !== undefined)\n return { messageId: 'lineTooLong', data: { actual: String(long.length), max: String(limits.lineMaxChars) } };\n\n return null;\n}\n\nconst docCommentMaxLinesRule = {\n meta: {\n type: 'suggestion',\n docs: {\n description:\n 'Cap a doc comment at a few lines, a one-line summary with no call chain, and only @param / @returns tags (RV-1, D-CMT-3, D-CMT-4)',\n },\n schema: [\n {\n type: 'object',\n properties: {\n max: { type: 'integer', minimum: 1 },\n allowedTags: { type: 'array', items: { type: 'string' } },\n bannedTags: { type: 'array', items: { type: 'string' } },\n summaryMaxLines: { type: 'integer', minimum: 1 },\n lineMaxChars: { type: 'integer', minimum: 1 },\n },\n additionalProperties: false,\n },\n ],\n messages: {\n tooLong: 'RV-1: doc comment is {{actual}} lines; the cap is {{max}}.',\n bannedTag: 'RV-1: @{{tag}} is not allowed in a doc comment (allowed: {{allowed}}).',\n summaryTooLong: 'RV-1: doc summary is {{actual}} lines; it must be one line saying what the member is for.',\n callChain: 'RV-1: no call chain or Flow: in a doc comment; say what the member is for, not how it runs.',\n lineTooLong: 'RV-1: doc line is {{actual}} chars; the cap is {{max}}.',\n },\n },\n\n create(context) {\n const sourceCode = context.sourceCode ?? context.getSourceCode();\n const options = context.options[0] ?? {};\n const limits = {\n max: options.max ?? DEFAULT_MAX,\n summaryMaxLines: options.summaryMaxLines ?? DEFAULT_SUMMARY_MAX_LINES,\n lineMaxChars: options.lineMaxChars ?? DEFAULT_LINE_MAX_CHARS,\n };\n const allowed = new Set(options.allowedTags ?? DEFAULT_ALLOWED_TAGS);\n for (const tag of options.bannedTags ?? []) allowed.delete(tag);\n const allowedText = [...allowed].map((tag) => `@${tag}`).join(', ') || 'none';\n\n return {\n Program() {\n for (const comment of sourceCode.getAllComments()) {\n if (!isDocBlock(comment) || isTypeAnnotationDoc(comment)) continue;\n const lines = docBodyLines(comment);\n const banned = blockTags(lines).filter((tag) => !allowed.has(tag));\n for (const tag of banned)\n context.report({ loc: comment.loc, messageId: 'bannedTag', data: { tag, allowed: allowedText } });\n if (banned.length > 0) continue;\n const problem = firstShapeProblem(lines, limits);\n if (problem) context.report({ loc: comment.loc, ...problem });\n }\n },\n };\n },\n};\n\nexport default { rules: { 'doc-comment-max-lines': docCommentMaxLinesRule } };\n","import { isDocBlock, isTypeAnnotationDoc } from './comment-utils.js';\n\nconst EXPORT_TYPES = new Set([\n 'ExportNamedDeclaration',\n 'ExportDefaultDeclaration',\n 'ExportAllDeclaration',\n 'TSExportAssignment',\n]);\n\nconst PASS_THROUGH = new Set([\n 'MethodDefinition',\n 'PropertyDefinition',\n 'AccessorProperty',\n 'TSAbstractMethodDefinition',\n 'TSAbstractPropertyDefinition',\n 'TSAbstractAccessorProperty',\n 'TSIndexSignature',\n 'ClassBody',\n 'ClassDeclaration',\n 'ClassExpression',\n 'TSInterfaceBody',\n 'TSInterfaceDeclaration',\n 'TSPropertySignature',\n 'TSMethodSignature',\n 'TSTypeLiteral',\n 'TSTypeAnnotation',\n 'TSTypeAliasDeclaration',\n 'TSIntersectionType',\n 'TSUnionType',\n 'TSEnumDeclaration',\n 'TSEnumBody',\n 'TSEnumMember',\n 'TSModuleBlock',\n 'TSModuleDeclaration',\n 'TSDeclareFunction',\n 'VariableDeclaration',\n 'VariableDeclarator',\n 'ObjectExpression',\n 'Property',\n 'TSAsExpression',\n 'TSSatisfiesExpression',\n]);\n\nconst HIDDEN_ACCESSIBILITY = new Set(['private', 'protected']);\n\nfunction isHiddenMember(node) {\n if (HIDDEN_ACCESSIBILITY.has(node.accessibility)) return true;\n\n return node.key?.type === 'PrivateIdentifier';\n}\n\nfunction isAmbientModule(node) {\n return node.type === 'TSModuleDeclaration' && (node.declare === true || node.global === true);\n}\n\nfunction isNamed(node, name) {\n return node?.type === 'Identifier' && node.name === name;\n}\n\nfunction isCommonJsExport(node) {\n if (node.type !== 'ExpressionStatement') return false;\n const expr = node.expression;\n if (expr.type !== 'AssignmentExpression' || expr.left.type !== 'MemberExpression') return false;\n const target = expr.left.object;\n const isModuleExports = isNamed(target, 'module') && isNamed(expr.left.property, 'exports');\n const isModuleExportsMember =\n target.type === 'MemberExpression' && isNamed(target.object, 'module') && isNamed(target.property, 'exports');\n\n return isNamed(target, 'exports') || isModuleExports || isModuleExportsMember;\n}\n\nfunction declaredNames(node) {\n if (node.type === 'VariableDeclaration')\n return node.declarations.filter((d) => d.id.type === 'Identifier').map((d) => d.id.name);\n if (node.id?.type === 'Identifier') return [node.id.name];\n\n return [];\n}\n\nfunction collectExportedNames(program) {\n const names = new Set();\n for (const statement of program.body) {\n if (statement.type === 'ExportNamedDeclaration' && !statement.source)\n for (const spec of statement.specifiers) if (spec.local.type === 'Identifier') names.add(spec.local.name);\n if (statement.type === 'ExportDefaultDeclaration' && statement.declaration.type === 'Identifier')\n names.add(statement.declaration.name);\n if (statement.type === 'TSExportAssignment' && statement.expression.type === 'Identifier')\n names.add(statement.expression.name);\n }\n\n return names;\n}\n\nfunction isTopLevelPublic(node, exportedNames) {\n if (EXPORT_TYPES.has(node.type) || isAmbientModule(node) || isCommonJsExport(node)) return true;\n\n return declaredNames(node).some((name) => exportedNames.has(name));\n}\n\nfunction isPublic(start, exportedNames) {\n let current = start;\n while (current.parent && current.parent.type !== 'Program') {\n if (isHiddenMember(current)) return false;\n const parent = current.parent;\n if (EXPORT_TYPES.has(parent.type) || isAmbientModule(parent)) return true;\n if (!PASS_THROUGH.has(parent.type)) return false;\n current = parent;\n }\n if (isHiddenMember(current)) return false;\n\n return isTopLevelPublic(current, exportedNames);\n}\n\nfunction documentedNode(sourceCode, comment) {\n const token = sourceCode.getTokenAfter(comment, { includeComments: false });\n if (!token) return null;\n let node = sourceCode.getNodeByRangeIndex(token.range[0]);\n while (node?.parent && node.parent.type !== 'Program' && node.parent.range[0] === node.range[0])\n node = node.parent;\n\n return node && node.type !== 'Program' ? node : null;\n}\n\nconst docCommentPublicOnlyRule = {\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Allow a doc comment only on an exported declaration or a public member of one (RV-1)',\n },\n schema: [],\n messages: {\n notPublic:\n 'RV-1: a doc comment is allowed only on an exported declaration or a public member of one. Move the intent into the name.',\n },\n },\n\n create(context) {\n const sourceCode = context.sourceCode ?? context.getSourceCode();\n\n return {\n Program(program) {\n const exportedNames = collectExportedNames(program);\n for (const comment of sourceCode.getAllComments()) {\n if (!isDocBlock(comment) || isTypeAnnotationDoc(comment)) continue;\n const node = documentedNode(sourceCode, comment);\n if (node && isPublic(node, exportedNames)) continue;\n context.report({ loc: comment.loc, messageId: 'notPublic' });\n }\n },\n };\n },\n};\n\nexport default { rules: { 'doc-comment-public-only': docCommentPublicOnlyRule } };\n","/**\r\n * Custom ESLint Plugin: Enforce Function Style & Ordering\r\n *\r\n * Two independent checks controlled by options:\r\n *\r\n * 1. **checkStyle** — Multi-statement functions must use `function` declarations,\r\n * not `const`-assigned arrow/function expressions. Single-expression arrows\r\n * are fine (concise one-liners). React components are exempt (enforced by\r\n * `react/function-component-definition`). Closures/callbacks are exempt.\r\n *\r\n * 2. **checkOrdering** — Module-level constants must appear before functions and\r\n * exports. Functions and exports may be freely interleaved.\r\n * Imports, type declarations, and re-exports are exempt.\r\n * This order is compatible with @typescript-eslint/no-use-before-define.\r\n */\r\n\r\n// ---------------------------------------------------------------------------\r\n// Helpers – JSX detection (borrowed from smart-max-lines for consistency)\r\n// ---------------------------------------------------------------------------\r\n\r\nfunction isJSX(node) {\r\n return node && (node.type === 'JSXElement' || node.type === 'JSXFragment');\r\n}\r\n\r\nfunction expressionReturnsJSX(node) {\r\n if (!node) return false;\r\n if (isJSX(node)) return true;\r\n if (node.type === 'ConditionalExpression')\r\n return expressionReturnsJSX(node.consequent) || expressionReturnsJSX(node.alternate);\r\n if (node.type === 'LogicalExpression')\r\n return expressionReturnsJSX(node.left) || expressionReturnsJSX(node.right);\r\n if (node.type === 'ParenthesizedExpression')\r\n return expressionReturnsJSX(node.expression);\r\n return false;\r\n}\r\n\r\nfunction blockReturnsJSX(body) {\r\n if (!Array.isArray(body)) return false;\r\n for (const stmt of body) {\r\n if (stmt.type === 'ReturnStatement' && expressionReturnsJSX(stmt.argument))\r\n return true;\r\n if (stmt.type === 'IfStatement') {\r\n const check = (branch) => {\r\n if (!branch) return false;\r\n if (branch.type === 'BlockStatement') return blockReturnsJSX(branch.body);\r\n return branch.type === 'ReturnStatement' && expressionReturnsJSX(branch.argument);\r\n };\r\n if (check(stmt.consequent) || check(stmt.alternate)) return true;\r\n }\r\n if (stmt.type === 'SwitchStatement') {\r\n for (const c of stmt.cases)\r\n if (blockReturnsJSX(c.consequent)) return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nfunction functionReturnsJSX(fnNode) {\r\n if (fnNode.type === 'ArrowFunctionExpression' && fnNode.body.type !== 'BlockStatement')\r\n return expressionReturnsJSX(fnNode.body);\r\n if (fnNode.body && fnNode.body.type === 'BlockStatement')\r\n return blockReturnsJSX(fnNode.body.body);\r\n return false;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Helpers – Statement classification for ordering\r\n// ---------------------------------------------------------------------------\r\n\r\n/** Exempt statement types that don't participate in ordering zones. */\r\nfunction isExemptStatement(stmt) {\r\n if (stmt.type === 'ImportDeclaration') return true;\r\n if (stmt.type === 'TSTypeAliasDeclaration') return true;\r\n if (stmt.type === 'TSInterfaceDeclaration') return true;\r\n if (stmt.type === 'TSEnumDeclaration') return true;\r\n if (stmt.type === 'ExportAllDeclaration') return true;\r\n // Type-only exports\r\n if (stmt.type === 'ExportNamedDeclaration' && stmt.exportKind === 'type') return true;\r\n // Re-exports (export { ... } from '...')\r\n if (stmt.type === 'ExportNamedDeclaration' && stmt.source) return true;\r\n // Empty export declarations (export {};)\r\n if (stmt.type === 'ExportNamedDeclaration' && !stmt.declaration && stmt.specifiers.length === 0)\r\n return true;\r\n return false;\r\n}\r\n\r\n/** Check if a VariableDeclaration's init is a function (arrow or function expression). */\r\nfunction hasFunctionInit(varDecl) {\r\n if (!varDecl.declarations || varDecl.declarations.length === 0) return false;\r\n const init = varDecl.declarations[0].init;\r\n if (!init) return false;\r\n return init.type === 'ArrowFunctionExpression' || init.type === 'FunctionExpression';\r\n}\r\n\r\n/**\r\n * Classify a top-level statement into a zone for ordering:\r\n * 1 = constant, 2 = function/export, 0 = exempt\r\n *\r\n * Expected file layout (compatible with no-use-before-define):\r\n * imports/types → constants → functions & exports (freely interleaved)\r\n */\r\nfunction classifyZone(stmt) {\r\n if (isExemptStatement(stmt)) return 0;\r\n\r\n // Exports → zone 2\r\n if (stmt.type === 'ExportNamedDeclaration' || stmt.type === 'ExportDefaultDeclaration')\r\n return 2;\r\n\r\n // Private function declarations → zone 2\r\n if (stmt.type === 'FunctionDeclaration') return 2;\r\n\r\n // Private variable declarations\r\n if (stmt.type === 'VariableDeclaration') {\r\n if (hasFunctionInit(stmt)) return 2; // function-valued → zone 2\r\n return 1; // plain constant → zone 1\r\n }\r\n\r\n // Everything else (expression statements, etc.) → exempt\r\n return 0;\r\n}\r\n\r\n/** Get a readable name from a statement for error messages. */\r\nfunction getStatementName(stmt) {\r\n if (stmt.type === 'ExportNamedDeclaration' && stmt.declaration) {\r\n const decl = stmt.declaration;\r\n if (decl.type === 'FunctionDeclaration' && decl.id) return decl.id.name;\r\n if (decl.type === 'VariableDeclaration' && decl.declarations[0]?.id)\r\n return decl.declarations[0].id.name;\r\n }\r\n if (stmt.type === 'ExportDefaultDeclaration') return 'default export';\r\n if (stmt.type === 'FunctionDeclaration' && stmt.id) return stmt.id.name;\r\n if (stmt.type === 'VariableDeclaration' && stmt.declarations[0]?.id)\r\n return stmt.declarations[0].id.name;\r\n return '(anonymous)';\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Helpers – Top-level detection\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Check if a VariableDeclarator is at the module top level.\r\n * A declarator is top-level if its VariableDeclaration parent is directly\r\n * under Program, or under an ExportNamedDeclaration that is under Program.\r\n */\r\nfunction isTopLevel(node) {\r\n const varDecl = node.parent; // VariableDeclaration\r\n if (!varDecl) return false;\r\n const container = varDecl.parent;\r\n if (!container) return false;\r\n if (container.type === 'Program') return true;\r\n if (container.type === 'ExportNamedDeclaration' && container.parent?.type === 'Program')\r\n return true;\r\n return false;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Rule definition\r\n// ---------------------------------------------------------------------------\r\n\r\nconst enforceFunctionStyleRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Enforce function declarations for multi-statement functions and ' +\r\n 'correct ordering of exports, private functions, and constants.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n checkStyle: {\r\n type: 'boolean',\r\n description: 'Flag const-assigned multi-statement functions (default true)',\r\n },\r\n checkOrdering: {\r\n type: 'boolean',\r\n description: 'Flag out-of-order module statements (default true)',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n useFunction:\r\n 'Use a function declaration (`function {{name}}`) instead of a ' +\r\n 'const-assigned arrow/function expression for multi-statement functions.',\r\n constantAfterCode:\r\n 'Module-level constant `{{name}}` should appear before functions and exports.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const checkStyle = options.checkStyle !== false;\r\n const checkOrdering = options.checkOrdering !== false;\r\n\r\n return {\r\n // -----------------------------------------------------------------\r\n // Check 1: Declaration style\r\n // -----------------------------------------------------------------\r\n ...(checkStyle\r\n ? {\r\n VariableDeclarator(node) {\r\n // Only care about top-level const-assigned functions\r\n if (!isTopLevel(node)) return;\r\n\r\n const init = node.init;\r\n if (!init) return;\r\n if (init.type !== 'ArrowFunctionExpression' && init.type !== 'FunctionExpression')\r\n return;\r\n\r\n // Allow single-expression arrows (concise body, no block)\r\n if (init.type === 'ArrowFunctionExpression' && init.body.type !== 'BlockStatement')\r\n return;\r\n\r\n // Allow React components (JSX return) — enforced separately\r\n if (functionReturnsJSX(init)) return;\r\n\r\n // Allow PascalCase names — likely React components (enforced\r\n // as arrow functions by react/function-component-definition).\r\n // Components returning null won't be caught by JSX check above.\r\n const name = node.id?.name ?? '(anonymous)';\r\n if (/^[A-Z]/.test(name)) return;\r\n\r\n // IIFEs like `const x = (() => {...})()` are implicitly exempt\r\n // because their init is a CallExpression, filtered by the type\r\n // check above.\r\n\r\n context.report({\r\n node,\r\n messageId: 'useFunction',\r\n data: { name },\r\n });\r\n },\r\n }\r\n : {}),\r\n\r\n // -----------------------------------------------------------------\r\n // Check 2: Ordering\r\n // -----------------------------------------------------------------\r\n ...(checkOrdering\r\n ? {\r\n 'Program:exit'(programNode) {\r\n let maxZoneSeen = 0;\r\n\r\n for (const stmt of programNode.body) {\r\n const zone = classifyZone(stmt);\r\n if (zone === 0) continue; // exempt — ignore\r\n\r\n if (zone < maxZoneSeen) {\r\n const name = getStatementName(stmt);\r\n const messageId = 'constantAfterCode';\r\n\r\n context.report({\r\n node: stmt,\r\n messageId,\r\n data: { name },\r\n });\r\n }\r\n\r\n if (zone > maxZoneSeen) maxZoneSeen = zone;\r\n }\r\n },\r\n }\r\n : {}),\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enforce-function-style': enforceFunctionStyleRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enforce Module Structure\r\n *\r\n * When a component/feature directory contains 4+ non-test source files,\r\n * this rule enforces a standard internal structure:\r\n *\r\n * hooks/ — Custom hooks (use*.ts)\r\n * components/ — Sub-components (non-index .tsx files)\r\n * utils/ — Pure helper functions (non-hook, non-component .ts files)\r\n * data/ — Static/mock data files (*Data.ts, *.data.ts)\r\n *\r\n * Files that may stay at the directory root:\r\n * index.tsx, index.ts, types.ts, constants.ts, schema.ts, columns.ts\r\n *\r\n * The rule also allows domain-specific subdirectories (e.g. filters/,\r\n * columnMenu/, pagination/) — files inside those are exempt because\r\n * they are already organized by concern.\r\n *\r\n * Special directory patterns exempt from sub-component checks:\r\n * sections/ — Feature page sections (.tsx files are the primary content)\r\n * forms/ — Form components (.tsx are the primary content)\r\n *\r\n * Threshold: only enforced when a directory has >= fileThreshold source\r\n * files (default 4). Simple components with 1-3 files are left alone.\r\n *\r\n * Examples:\r\n * BAD: DataGrid/useGridCallbacks.ts (hook at root, 8 siblings)\r\n * GOOD: DataGrid/hooks/useGridCallbacks.ts (hook in hooks/ subdir)\r\n *\r\n * BAD: sections/data.ts (data mixed with sections)\r\n * GOOD: data/gridData.ts (data in dedicated subdir)\r\n *\r\n * OK: sections/BasicGridSection.tsx (sections dir, .tsx exempt)\r\n * OK: TableNative/columnMenu/useColumnMenu.ts (domain subdir, exempt)\r\n * OK: Button/index.tsx (only 2 files, below threshold)\r\n */\r\n\r\nimport { readdirSync } from 'fs';\r\nimport { dirname, basename, sep, posix } from 'path';\r\n\r\nconst FILE_THRESHOLD_DEFAULT = 4;\r\n\r\n/** Exact file names allowed to stay at the root of a module directory. */\r\nconst ROOT_ALLOWED_BASENAMES = new Set([\r\n 'index.tsx',\r\n 'index.ts',\r\n 'types.ts',\r\n 'constants.ts',\r\n 'schema.ts',\r\n 'columns.ts',\r\n]);\r\n\r\n/**\r\n * File name patterns that are allowed at root.\r\n * - *Types.ts: type definition files (same purpose as types.ts)\r\n * - Files containing a single const enum are required by\r\n * enum-file-isolation to be standalone — don't force them into utils/.\r\n * We detect these by common naming patterns for enum files.\r\n */\r\nconst ROOT_ALLOWED_PATTERNS = [\r\n /^[a-zA-Z]+Types\\.ts$/, // alertTypes.ts, buttonTypes.ts, etc.\r\n];\r\n\r\n/**\r\n * Directory names where PascalCase .tsx files are the primary content\r\n * and should NOT be flagged as \"move to components/\".\r\n * Hooks, utils, and data files are still flagged in these directories.\r\n */\r\nconst COMPONENT_EXEMPT_DIRS = new Set([\r\n 'sections',\r\n 'forms',\r\n 'Forms',\r\n]);\r\n\r\n/**\r\n * Directory names that are collections of standalone files by design.\r\n * Files in these directories should not be reorganized into subdirs.\r\n * Example: shared/ contains type files and enums for multiple consumers.\r\n */\r\nconst FLAT_EXEMPT_DIRS = new Set([\r\n // Common (shared with SyncfusionThemeStudio)\r\n 'shared',\r\n 'presets',\r\n 'defaults',\r\n 'injectors',\r\n 'types',\r\n 'actions',\r\n 'icons',\r\n 'errors',\r\n 'interceptors',\r\n 'events',\r\n 'routes',\r\n 'utils',\r\n 'components',\r\n 'form-fields',\r\n // BaseClient-specific\r\n 'enums',\r\n 'testIds',\r\n 'constants',\r\n 'slices',\r\n 'schemas',\r\n 'locales',\r\n 'mutators',\r\n 'customHooks',\r\n 'swagger',\r\n 'models',\r\n 'handlers',\r\n 'menuHandlers',\r\n 'userHandlers',\r\n]);\r\n\r\n/**\r\n * Count non-test, non-directory source files in a directory (shallow).\r\n * Returns only .ts/.tsx files that are not tests or declarations.\r\n */\r\nfunction countSourceFiles(dirPath) {\r\n try {\r\n const entries = readdirSync(dirPath, { withFileTypes: true });\r\n return entries.filter((e) => {\r\n if (!e.isFile()) return false;\r\n const name = e.name;\r\n if (!name.endsWith('.ts') && !name.endsWith('.tsx')) return false;\r\n if (name.endsWith('.test.ts') || name.endsWith('.test.tsx')) return false;\r\n if (name.endsWith('.d.ts')) return false;\r\n return true;\r\n }).length;\r\n } catch {\r\n return 0;\r\n }\r\n}\r\n\r\n/**\r\n * Check whether the file is inside a non-root subdirectory of its\r\n * module directory (e.g. hooks/, components/, filters/, columnMenu/).\r\n * If so, it's already organized and should be exempt.\r\n */\r\nfunction isInsideSubdirectory(filePath, moduleRoot) {\r\n const rel = filePath\r\n .split(sep)\r\n .join(posix.sep)\r\n .slice(moduleRoot.split(sep).join(posix.sep).length + 1);\r\n // rel looks like \"hooks/useX.ts\" or \"index.tsx\"\r\n return rel.includes('/');\r\n}\r\n\r\n/**\r\n * Determine the \"module root\" — the nearest ancestor directory that\r\n * contains an index.ts or index.tsx file. This is the component or\r\n * page directory boundary.\r\n */\r\nfunction findModuleRoot(filePath) {\r\n let dir = dirname(filePath);\r\n const maxDepth = 10;\r\n for (let i = 0; i < maxDepth; i++) {\r\n try {\r\n const entries = readdirSync(dir);\r\n if (entries.includes('index.ts') || entries.includes('index.tsx'))\r\n return dir;\r\n } catch {\r\n return null;\r\n }\r\n const parent = dirname(dir);\r\n if (parent === dir) return null;\r\n dir = parent;\r\n }\r\n return null;\r\n}\r\n\r\nconst enforceModuleStructureRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Enforce standard module structure: hooks in hooks/, sub-components in components/, ' +\r\n 'utils in utils/, data in data/. Only applies when directory has 4+ source files.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n fileThreshold: {\r\n type: 'integer',\r\n minimum: 2,\r\n description:\r\n 'Minimum number of non-test source files before structure is enforced',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n hookAtRoot:\r\n 'Hook \"{{fileName}}\" should be in a hooks/ subdirectory. ' +\r\n 'Move to {{suggestedPath}}.',\r\n componentAtRoot:\r\n 'Sub-component \"{{fileName}}\" should be in a components/ subdirectory. ' +\r\n 'Move to {{suggestedPath}}.',\r\n utilAtRoot:\r\n 'Utility file \"{{fileName}}\" should be in a utils/ subdirectory. ' +\r\n 'Move to {{suggestedPath}}.',\r\n dataInSections:\r\n 'Data file \"{{fileName}}\" should be in a data/ subdirectory, ' +\r\n 'not mixed with section components. Move to {{suggestedPath}}.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const fileThreshold = options.fileThreshold ?? FILE_THRESHOLD_DEFAULT;\r\n\r\n return {\r\n Program() {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return;\r\n\r\n // Only check .ts/.tsx files\r\n if (!filePath.endsWith('.ts') && !filePath.endsWith('.tsx')) return;\r\n if (filePath.endsWith('.d.ts')) return;\r\n\r\n const fileName = basename(filePath);\r\n\r\n // Skip test files — they follow their source files\r\n if (fileName.endsWith('.test.ts') || fileName.endsWith('.test.tsx'))\r\n return;\r\n\r\n // Skip root-allowed files (exact matches and patterns)\r\n if (ROOT_ALLOWED_BASENAMES.has(fileName)) return;\r\n if (ROOT_ALLOWED_PATTERNS.some((p) => p.test(fileName))) return;\r\n\r\n const dir = dirname(filePath);\r\n const dirName = basename(dir);\r\n\r\n // Skip files in flat-exempt directories (shared/, presets/, etc.)\r\n if (FLAT_EXEMPT_DIRS.has(dirName)) return;\r\n\r\n // Find the module root (directory with index.ts/tsx)\r\n const moduleRoot = findModuleRoot(filePath);\r\n if (!moduleRoot) return;\r\n\r\n // If the file is already inside a subdirectory of the module root,\r\n // it's organized — skip\r\n if (isInsideSubdirectory(filePath, moduleRoot)) return;\r\n\r\n // Count source files in the module root to check threshold\r\n const sourceFileCount = countSourceFiles(moduleRoot);\r\n if (sourceFileCount < fileThreshold) return;\r\n\r\n // --- Classify the file and report ---\r\n\r\n const isHook =\r\n /^use[A-Z]/.test(fileName) &&\r\n (fileName.endsWith('.ts') || fileName.endsWith('.tsx'));\r\n\r\n const isComponent =\r\n fileName.endsWith('.tsx') && /^[A-Z]/.test(fileName);\r\n\r\n const isDataFile =\r\n /[Dd]ata\\.tsx?$/.test(fileName) ||\r\n /\\.data\\.tsx?$/.test(fileName);\r\n\r\n // Data files in sections/ directory → suggest data/ subdir\r\n if (isDataFile && dirName === 'sections') {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'dataInSections',\r\n data: {\r\n fileName,\r\n suggestedPath: `data/${fileName}`,\r\n },\r\n });\r\n return;\r\n }\r\n\r\n if (isHook) {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'hookAtRoot',\r\n data: {\r\n fileName,\r\n suggestedPath: `hooks/${fileName}`,\r\n },\r\n });\r\n return;\r\n }\r\n\r\n // In sections/ and forms/ dirs, .tsx files are the primary content\r\n // and should NOT be flagged as needing components/ subdir\r\n if (isComponent && !COMPONENT_EXEMPT_DIRS.has(dirName)) {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'componentAtRoot',\r\n data: {\r\n fileName,\r\n suggestedPath: `components/${fileName}`,\r\n },\r\n });\r\n return;\r\n }\r\n\r\n // Remaining .ts files that aren't root-allowed → utils\r\n // Skip .tsx files in exempt dirs (they're section/form components)\r\n if (fileName.endsWith('.ts') && !isDataFile) {\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'utilAtRoot',\r\n data: {\r\n fileName,\r\n suggestedPath: `utils/${fileName}`,\r\n },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enforce-module-structure': enforceModuleStructureRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enforce Route Page Preloading\r\n *\r\n * Runs on a preloader file (e.g., src/config/routePreloader.ts) and ensures\r\n * every Expo Router route page in the configured directory has a matching\r\n * dynamic import() expression. This prevents developers from adding new\r\n * route pages without preloading them, which would cause slower navigation.\r\n *\r\n * Reports:\r\n * - missingPreload: route page file has no matching import() in the preloader\r\n * - stalePreload: import path does not match any route page file\r\n * - noImportsFound: preloader file has no dynamic import() expressions at all\r\n */\r\n\r\nimport fs from 'fs';\r\nimport path from 'path';\r\n\r\n/**\r\n * Recursively discover route page files in the given directory.\r\n *\r\n * A file qualifies as a route page if:\r\n * - It is a .tsx file\r\n * - It is NOT a _layout.tsx file\r\n * - It is NOT inside an excluded directory (e.g., __tests__)\r\n * - If it lives in a directory that already has an index.tsx, only index.tsx\r\n * itself counts (sibling .tsx files are sub-components, not route entries)\r\n * - Direct .tsx files whose name does NOT start with _ are also route pages\r\n */\r\nfunction discoverRoutePages(baseDir, options) {\r\n const {\r\n excludeFiles = ['_layout.tsx'],\r\n excludeDirs = ['__tests__'],\r\n rootIndexIsRedirect = true,\r\n } = options;\r\n\r\n const routePages = [];\r\n\r\n function walk(dir, relativePrefix) {\r\n let entries;\r\n try {\r\n entries = fs.readdirSync(dir, { withFileTypes: true });\r\n } catch {\r\n return;\r\n }\r\n\r\n for (const entry of entries) {\r\n const fullPath = path.join(dir, entry.name);\r\n const relativePath = path.join(relativePrefix, entry.name);\r\n\r\n if (entry.isDirectory()) {\r\n // Skip excluded directories\r\n if (excludeDirs.includes(entry.name)) continue;\r\n\r\n walk(fullPath, relativePath);\r\n continue;\r\n }\r\n\r\n // Only consider .tsx files\r\n if (!entry.name.endsWith('.tsx')) continue;\r\n\r\n // Skip excluded file names\r\n if (excludeFiles.includes(entry.name)) continue;\r\n\r\n // Skip files starting with _ (e.g., _layout.tsx already excluded above,\r\n // but also any other underscore-prefixed files)\r\n if (entry.name.startsWith('_')) continue;\r\n\r\n // Skip root index if configured as redirect\r\n const normalizedRelative = relativePath.replace(/\\\\/g, '/');\r\n if (rootIndexIsRedirect && normalizedRelative === 'index.tsx') continue;\r\n\r\n // Strip .tsx extension for the normalized path\r\n const withoutExt = normalizedRelative.replace(/\\.tsx$/, '');\r\n routePages.push(withoutExt);\r\n }\r\n }\r\n\r\n walk(baseDir, '');\r\n return routePages;\r\n}\r\n\r\n/**\r\n * Recursively collect all ImportExpression source paths within an AST subtree.\r\n */\r\nfunction collectImportPaths(node) {\r\n const paths = [];\r\n\r\n function walk(n) {\r\n if (!n || typeof n !== 'object') return;\r\n\r\n if (n.type === 'ImportExpression' && n.source?.type === 'Literal')\r\n paths.push({ value: n.source.value, node: n });\r\n\r\n for (const key of Object.keys(n)) {\r\n if (key === 'parent') continue;\r\n const child = n[key];\r\n if (Array.isArray(child))\r\n child.forEach(walk);\r\n else if (child?.type)\r\n walk(child);\r\n }\r\n }\r\n\r\n walk(node);\r\n return paths;\r\n}\r\n\r\n/**\r\n * Resolve a relative import path to an absolute normalized form,\r\n * then strip the project root prefix to get a project-relative path.\r\n */\r\nfunction resolveImportToProjectRelative(importPath, fileDir, projectRoot) {\r\n // Resolve relative to the file being linted\r\n const absoluteResolved = path.resolve(fileDir, importPath);\r\n // Make it relative to the project root\r\n const projectRelative = path.relative(projectRoot, absoluteResolved);\r\n // Normalize to forward slashes\r\n return projectRelative.replace(/\\\\/g, '/');\r\n}\r\n\r\nconst enforceRoutePreloadRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Ensure every route page in the configured directory has a matching dynamic import() in the preloader file',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n routeDir: {\r\n type: 'string',\r\n description:\r\n 'Directory to scan for route pages, relative to project root',\r\n default: 'app/(protected)',\r\n },\r\n excludeFiles: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Filename patterns to skip',\r\n default: ['_layout.tsx'],\r\n },\r\n excludeDirs: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Directory names to skip',\r\n default: ['__tests__'],\r\n },\r\n rootIndexIsRedirect: {\r\n type: 'boolean',\r\n description:\r\n 'Whether the root index.tsx in routeDir is just a redirect and should be skipped',\r\n default: true,\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n missingPreload:\r\n 'Route page \"{{routeFile}}\" is not preloaded. Add: import(\\'{{importPath}}\\').catch(() => undefined);',\r\n stalePreload:\r\n 'Preload import \"{{importPath}}\" does not match any route page in {{routeDir}}/. Remove it or add the corresponding route page.',\r\n noImportsFound:\r\n 'Preloader file has no dynamic import() expressions. Add imports for all route pages in {{routeDir}}/.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] ?? {};\r\n const routeDir = options.routeDir ?? 'app/(protected)';\r\n const excludeFiles = options.excludeFiles ?? ['_layout.tsx'];\r\n const excludeDirs = options.excludeDirs ?? ['__tests__'];\r\n const rootIndexIsRedirect = options.rootIndexIsRedirect ?? true;\r\n\r\n // Determine project root (directory containing eslint.config.mjs)\r\n const cwd = context.cwd ?? context.getCwd?.() ?? process.cwd();\r\n const projectRoot = cwd;\r\n\r\n // Determine the directory of the file being linted\r\n const filename = context.filename ?? context.getFilename?.();\r\n const fileDir = path.dirname(filename);\r\n\r\n // Discover all route page files\r\n const routeDirAbsolute = path.resolve(projectRoot, routeDir);\r\n const routePages = discoverRoutePages(routeDirAbsolute, {\r\n excludeFiles,\r\n excludeDirs,\r\n rootIndexIsRedirect,\r\n });\r\n\r\n // Build the set of expected normalized paths: \"app/(protected)/tenants/index\"\r\n const expectedRouteSet = new Set(\r\n routePages.map((rp) => `${routeDir}/${rp}`.replace(/\\\\/g, '/')),\r\n );\r\n\r\n // Collected during traversal\r\n const importExpressions = []; // { resolvedPath: string, rawPath: string, node: ASTNode }\r\n\r\n return {\r\n // Collect all dynamic import() expressions in the file\r\n ImportExpression(node) {\r\n if (node.source?.type !== 'Literal') return;\r\n const rawPath = node.source.value;\r\n const resolvedPath = resolveImportToProjectRelative(\r\n rawPath,\r\n fileDir,\r\n projectRoot,\r\n );\r\n importExpressions.push({ resolvedPath, rawPath, node });\r\n },\r\n\r\n 'Program:exit'(programNode) {\r\n // If no route pages were discovered, nothing to check\r\n if (expectedRouteSet.size === 0) return;\r\n\r\n // If preloader has zero imports, report a single error\r\n if (importExpressions.length === 0) {\r\n context.report({\r\n node: programNode,\r\n messageId: 'noImportsFound',\r\n data: { routeDir },\r\n });\r\n return;\r\n }\r\n\r\n // Build set of resolved import paths (normalized)\r\n const importedPaths = new Set(\r\n importExpressions.map((i) => i.resolvedPath),\r\n );\r\n\r\n // Check for missing preloads: route pages not covered by any import\r\n for (const routePath of expectedRouteSet) {\r\n if (!importedPaths.has(routePath)) {\r\n // Compute the relative import path from the preloader file to the route\r\n const routeAbsolute = path.resolve(projectRoot, `${routePath}.tsx`);\r\n let relativePath = path.relative(fileDir, routeAbsolute);\r\n // Normalize to forward slashes\r\n relativePath = relativePath.replace(/\\\\/g, '/');\r\n // Ensure it starts with ./\r\n if (!relativePath.startsWith('.'))\r\n relativePath = `./${relativePath}`;\r\n // Strip .tsx extension\r\n relativePath = relativePath.replace(/\\.tsx$/, '');\r\n\r\n context.report({\r\n node: programNode,\r\n messageId: 'missingPreload',\r\n data: {\r\n routeFile: routePath,\r\n importPath: relativePath,\r\n },\r\n });\r\n }\r\n }\r\n\r\n // Check for stale preloads: imports that don't match any route page\r\n for (const { resolvedPath, rawPath, node } of importExpressions) {\r\n // Only flag imports that point into the routeDir\r\n const normalizedRouteDir = routeDir.replace(/\\\\/g, '/');\r\n if (!resolvedPath.startsWith(normalizedRouteDir)) continue;\r\n\r\n if (!expectedRouteSet.has(resolvedPath))\r\n context.report({\r\n node,\r\n messageId: 'stalePreload',\r\n data: {\r\n importPath: rawPath,\r\n routeDir,\r\n },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\n/**\r\n * Export the plugin\r\n */\r\nexport default {\r\n rules: {\r\n 'enforce-route-preload': enforceRoutePreloadRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enforce Test Colocation\r\n *\r\n * Flags test files that live in __tests__/ directories instead of being\r\n * co-located next to the source file they test.\r\n *\r\n * Co-located tests are easier to find, easier to maintain, and make it\r\n * obvious which files have test coverage at a glance.\r\n *\r\n * Examples:\r\n * BAD: DataGrid/__tests__/useGridCallbacks.test.ts\r\n * GOOD: DataGrid/hooks/useGridCallbacks.test.ts (next to source)\r\n *\r\n * BAD: lib/api/errors/__tests__/apiError.test.ts\r\n * GOOD: lib/api/errors/apiError.test.ts (next to source)\r\n *\r\n * OK: hooks/useGridCallbacks.test.ts (already co-located)\r\n */\r\n\r\nimport { dirname, basename, sep, posix } from 'path';\r\n\r\nconst enforceTestColocationRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Test files should be co-located next to their source file, ' +\r\n 'not placed in a __tests__/ directory.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n testInTestsDir:\r\n 'Test file \"{{fileName}}\" is inside a __tests__/ directory. ' +\r\n 'Move it next to its source file for co-location. ' +\r\n 'Suggested: {{suggestedPath}}',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n Program() {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return;\r\n\r\n const fileName = basename(filePath);\r\n\r\n // Only check test files\r\n if (!fileName.endsWith('.test.ts') && !fileName.endsWith('.test.tsx'))\r\n return;\r\n\r\n // Normalize path separators for consistent checking\r\n const normalized = filePath.split(sep).join(posix.sep);\r\n\r\n // Check if the file is inside a __tests__/ directory\r\n if (!normalized.includes('/__tests__/')) return;\r\n\r\n // Build the suggested co-located path:\r\n // __tests__/foo.test.ts → ../foo.test.ts (next to source)\r\n const dir = dirname(filePath);\r\n const parentDir = dirname(dir);\r\n const parentDirName = basename(parentDir);\r\n\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'testInTestsDir',\r\n data: {\r\n fileName,\r\n suggestedPath: `${parentDirName}/${fileName}`,\r\n },\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enforce-test-colocation': enforceTestColocationRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Enum File Isolation\r\n *\r\n * Flags exported enums in files that also contain unrelated exports.\r\n * Enums should live in dedicated files (e.g., status.enum.ts or status.ts).\r\n *\r\n * Related helpers (functions/variables/types that reference the enum name)\r\n * are allowed in the same file as the enum.\r\n *\r\n * Examples:\r\n * FLAGGED - enum mixed with unrelated exports:\r\n * export const enum ExportType { Csv = 'csv', Excel = 'excel' }\r\n * export interface TableColumn { ... } // Unrelated to ExportType\r\n *\r\n * FLAGGED - multiple exported enums in one file:\r\n * export const enum ErrorActionType { ... }\r\n * export const enum ErrorSeverity { ... }\r\n *\r\n * NOT FLAGGED - enum with related helpers:\r\n * export const enum MenuStatus { Active = 'active', Inactive = 'inactive' }\r\n * export const menuStatusToLabel = (s: MenuStatus): string => { ... }\r\n */\r\n\r\nconst enumFileIsolationRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Exported enums should live in dedicated files. Only related helpers may share the file.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n multipleEnums:\r\n 'File contains multiple exported enums ({{enumNames}}). Each enum should have its own dedicated file.',\r\n unrelatedExports:\r\n 'Exported enum \"{{enumName}}\" is in a file with unrelated exports. Move the enum to a dedicated file (e.g., {{suggestedFile}}) or move unrelated exports elsewhere.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const exportedEnums = [];\r\n const otherExportNodes = [];\r\n\r\n /**\r\n * Collect exported enum declarations.\r\n */\r\n function collectExportedEnum(node) {\r\n // ExportNamedDeclaration > TSEnumDeclaration\r\n if (\r\n node.type === 'ExportNamedDeclaration' &&\r\n node.declaration &&\r\n node.declaration.type === 'TSEnumDeclaration'\r\n ) {\r\n exportedEnums.push({\r\n name: node.declaration.id.name,\r\n node: node.declaration.id,\r\n });\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Collect non-enum exported declarations.\r\n */\r\n function collectOtherExport(node) {\r\n if (node.type !== 'ExportNamedDeclaration') return;\r\n // Skip if it's an enum (already collected)\r\n if (\r\n node.declaration &&\r\n node.declaration.type === 'TSEnumDeclaration'\r\n )\r\n return;\r\n\r\n otherExportNodes.push(node);\r\n }\r\n\r\n /**\r\n * Check if a source text references an enum name using word boundary.\r\n */\r\n function referencesEnum(sourceText, enumName) {\r\n const regex = new RegExp(`\\\\b${enumName}\\\\b`);\r\n return regex.test(sourceText);\r\n }\r\n\r\n return {\r\n ExportNamedDeclaration(node) {\r\n if (!collectExportedEnum(node)) collectOtherExport(node);\r\n },\r\n\r\n 'Program:exit'() {\r\n // No exported enums -> nothing to check\r\n if (exportedEnums.length === 0) return;\r\n\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n\r\n // Check for multiple exported enums in the same file\r\n if (exportedEnums.length > 1) {\r\n const enumNames = exportedEnums\r\n .map((e) => e.name)\r\n .join(', ');\r\n for (const enumInfo of exportedEnums) {\r\n context.report({\r\n node: enumInfo.node,\r\n messageId: 'multipleEnums',\r\n data: { enumNames },\r\n });\r\n }\r\n return;\r\n }\r\n\r\n // Single enum - check if other exports are related\r\n const enumName = exportedEnums[0].name;\r\n const enumNode = exportedEnums[0].node;\r\n\r\n // If no other exports, the file is fine\r\n if (otherExportNodes.length === 0) return;\r\n\r\n // Check each other export to see if it references the enum\r\n const unrelatedExports = otherExportNodes.filter((node) => {\r\n const text = sourceCode.getText(node);\r\n return !referencesEnum(text, enumName);\r\n });\r\n\r\n if (unrelatedExports.length > 0) {\r\n // Convert PascalCase to kebab-case for suggested filename\r\n const suggestedFile = enumName\r\n .replace(/([a-z])([A-Z])/g, '$1-$2')\r\n .toLowerCase()\r\n .concat('.ts');\r\n\r\n context.report({\r\n node: enumNode,\r\n messageId: 'unrelatedExports',\r\n data: { enumName, suggestedFile },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'enum-file-isolation': enumFileIsolationRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: i18n Interpolation Placeholder Enforcement\r\n *\r\n * Ensures translation JSON files only use standardized placeholders:\r\n * {{p1}}, {{p2}}, {{p3}} (compatible with the FM() helper).\r\n *\r\n * Detects and autofixes:\r\n * - Non-standard double-brace placeholders: {{message}} → {{p1}}\r\n * - Single-brace placeholders: {p1} → {{p1}}\r\n * - Placeholders exceeding the 3-param FM() limit (error only, no autofix)\r\n */\r\n\r\nconst DOUBLE_BRACE_REGEX = /\\{\\{(\\w+)\\}\\}/g;\r\nconst SINGLE_BRACE_REGEX = /(?<!\\{)\\{(\\w+)\\}(?!\\})/g;\r\nconst ALLOWED_NAMES = new Set(['p1', 'p2', 'p3']);\r\nconst MAX_POSITIONAL_PARAMS = 3;\r\n\r\nconst rule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Enforce {{p1}}/{{p2}}/{{p3}} interpolation placeholders in translation JSON files',\r\n },\r\n fixable: 'code',\r\n schema: [],\r\n messages: {\r\n nonStandardPlaceholder:\r\n 'Non-standard placeholder \"{{placeholder}}\" found. Use {{p1}}/{{p2}}/{{p3}} instead.',\r\n singleBracePlaceholder:\r\n 'Single-brace placeholder \"{{{placeholder}}}\" found. Use double braces: {{{{{fixedName}}}}}.',\r\n tooManyPlaceholders:\r\n 'Translation has {{count}} unique placeholders but FM() only supports 3. Refactor the translation string.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n JSONLiteral(node) {\r\n if (typeof node.value !== 'string') return;\r\n\r\n const raw = node.value;\r\n\r\n // Collect all non-standard double-brace placeholders\r\n const doubleBraceMatches = [];\r\n let match;\r\n while ((match = DOUBLE_BRACE_REGEX.exec(raw)) !== null) {\r\n if (!ALLOWED_NAMES.has(match[1]))\r\n doubleBraceMatches.push({ name: match[1], index: match.index });\r\n }\r\n\r\n // Collect single-brace placeholders (any name)\r\n const singleBraceMatches = [];\r\n while ((match = SINGLE_BRACE_REGEX.exec(raw)) !== null)\r\n singleBraceMatches.push({ name: match[1], index: match.index });\r\n\r\n const hasDoubleBraceIssues = doubleBraceMatches.length > 0;\r\n const hasSingleBraceIssues = singleBraceMatches.length > 0;\r\n\r\n if (!hasDoubleBraceIssues && !hasSingleBraceIssues) return;\r\n\r\n // Build ordered mapping of unique placeholder names → p1/p2/p3\r\n const seenNames = [];\r\n const allMatches = [...doubleBraceMatches, ...singleBraceMatches].sort(\r\n (a, b) => a.index - b.index,\r\n );\r\n\r\n for (const m of allMatches) {\r\n if (!seenNames.includes(m.name) && !ALLOWED_NAMES.has(m.name))\r\n seenNames.push(m.name);\r\n }\r\n\r\n // Check if too many unique placeholders\r\n // Count existing valid ones too\r\n const existingValid = new Set();\r\n let m2;\r\n const tempRegex = /\\{\\{(\\w+)\\}\\}/g;\r\n while ((m2 = tempRegex.exec(raw)) !== null) {\r\n if (ALLOWED_NAMES.has(m2[1])) existingValid.add(m2[1]);\r\n }\r\n\r\n // Also count single-brace valid ones\r\n const tempSingleRegex = /(?<!\\{)\\{(\\w+)\\}(?!\\})/g;\r\n while ((m2 = tempSingleRegex.exec(raw)) !== null) {\r\n if (ALLOWED_NAMES.has(m2[1])) existingValid.add(m2[1]);\r\n }\r\n\r\n const totalUnique = seenNames.length + existingValid.size;\r\n\r\n if (totalUnique > MAX_POSITIONAL_PARAMS) {\r\n context.report({\r\n node,\r\n messageId: 'tooManyPlaceholders',\r\n data: { count: String(totalUnique) },\r\n });\r\n return;\r\n }\r\n\r\n // Determine the next available positional name\r\n const usedPositional = new Set(existingValid);\r\n const nameMap = {};\r\n const positionalNames = ['p1', 'p2', 'p3'];\r\n let nextIdx = 0;\r\n\r\n // Skip already-used positional names\r\n for (const name of seenNames) {\r\n while (\r\n nextIdx < positionalNames.length &&\r\n usedPositional.has(positionalNames[nextIdx])\r\n )\r\n nextIdx++;\r\n\r\n if (nextIdx < positionalNames.length) {\r\n nameMap[name] = positionalNames[nextIdx];\r\n usedPositional.add(positionalNames[nextIdx]);\r\n nextIdx++;\r\n }\r\n }\r\n\r\n // Report and fix double-brace non-standard placeholders\r\n if (hasDoubleBraceIssues) {\r\n const fixedValue = raw.replace(DOUBLE_BRACE_REGEX, (full, name) => {\r\n if (ALLOWED_NAMES.has(name)) return full;\r\n const replacement = nameMap[name];\r\n return replacement !== undefined ? `{{${replacement}}}` : full;\r\n });\r\n\r\n context.report({\r\n node,\r\n messageId: 'nonStandardPlaceholder',\r\n data: { placeholder: doubleBraceMatches[0].name },\r\n fix(fixer) {\r\n let finalValue = fixedValue;\r\n\r\n // Also fix single-brace issues in the same pass\r\n if (hasSingleBraceIssues)\r\n finalValue = finalValue.replace(\r\n SINGLE_BRACE_REGEX,\r\n (full, name) => {\r\n if (ALLOWED_NAMES.has(name)) return `{{${name}}}`;\r\n const replacement = nameMap[name];\r\n return replacement !== undefined\r\n ? `{{${replacement}}}`\r\n : `{{${name}}}`;\r\n },\r\n );\r\n\r\n return fixer.replaceText(node, JSON.stringify(finalValue));\r\n },\r\n });\r\n } else if (hasSingleBraceIssues) {\r\n // Only single-brace issues\r\n const fixedValue = raw.replace(SINGLE_BRACE_REGEX, (full, name) => {\r\n if (ALLOWED_NAMES.has(name)) return `{{${name}}}`;\r\n const replacement = nameMap[name];\r\n return replacement !== undefined\r\n ? `{{${replacement}}}`\r\n : `{{${name}}}`;\r\n });\r\n\r\n context.report({\r\n node,\r\n messageId: 'singleBracePlaceholder',\r\n data: {\r\n placeholder: singleBraceMatches[0].name,\r\n fixedName: ALLOWED_NAMES.has(singleBraceMatches[0].name)\r\n ? singleBraceMatches[0].name\r\n : nameMap[singleBraceMatches[0].name] ??\r\n singleBraceMatches[0].name,\r\n },\r\n fix(fixer) {\r\n return fixer.replaceText(node, JSON.stringify(fixedValue));\r\n },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'i18n-interpolation': rule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: i18n Parameter Name Enforcement\r\n *\r\n * Ensures that t() calls from react-i18next use standardized\r\n * interpolation parameter names: p1, p2, p3. This complements the\r\n * i18n-interpolation rule (which enforces {{p1}}/{{p2}}/{{p3}} in\r\n * translation JSON files) by checking the call sites in TypeScript/TSX.\r\n *\r\n * DETECTS:\r\n * t('key', { count }) — non-standard param name \"count\"\r\n * t('key', { message: err }) — non-standard param name \"message\"\r\n *\r\n * ALLOWED:\r\n * FM('key', value) — FM() enforces positional params by design\r\n * t('key', { p1: value }) — standard param name\r\n * t('key', { p1, p2 }) — shorthand with correct names\r\n * t('key', 'default value') — string default (not an interpolation object)\r\n *\r\n * RECOMMENDS: Use FM() instead of t() for parameterized translations.\r\n */\r\n\r\nconst ALLOWED_PARAM_NAMES = new Set(['p1', 'p2', 'p3']);\r\n\r\n// i18next configuration keys that are NOT interpolation params\r\nconst I18NEXT_CONFIG_KEYS = new Set([\r\n 'defaultValue',\r\n 'ns',\r\n 'lng',\r\n 'context',\r\n 'returnObjects',\r\n 'keySeparator',\r\n 'nsSeparator',\r\n 'interpolation',\r\n 'joinArrays',\r\n 'postProcess',\r\n 'replace',\r\n 'ordinal',\r\n 'formatParams',\r\n 'missingInterpolationHandler',\r\n]);\r\n\r\nconst rule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Enforce p1/p2/p3 parameter names in t() interpolation calls. ' +\r\n 'Translation JSON uses {{p1}}/{{p2}}/{{p3}} placeholders, so call sites ' +\r\n 'must pass { p1: value } — not { count: value } or other names.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n nonStandardParam:\r\n 'Non-standard interpolation param \"{{paramName}}\" in t() call. ' +\r\n 'Translation placeholders use {{p1}}/{{p2}}/{{p3}}. ' +\r\n 'Use FM(key, value) or t(key, { p1: value }) instead.',\r\n preferFM:\r\n 'Prefer FM() over t() for parameterized translations. ' +\r\n 'FM() enforces positional params (p1, p2, p3) by design.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n CallExpression(node) {\r\n // Only match t('key', { ... }) calls\r\n if (node.callee.type !== 'Identifier' || node.callee.name !== 't')\r\n return;\r\n\r\n // Need at least 2 arguments: t(key, options)\r\n if (node.arguments.length < 2) return;\r\n\r\n // Find the options argument — could be 2nd or 3rd arg\r\n // t(key, defaultValue, options) or t(key, options)\r\n const optionsArg = node.arguments.length >= 3\r\n ? node.arguments[2]\r\n : node.arguments[1];\r\n\r\n // Only check object literals (not variables or expressions)\r\n if (!optionsArg || optionsArg.type !== 'ObjectExpression') return;\r\n\r\n const properties = optionsArg.properties;\r\n\r\n for (const prop of properties) {\r\n // Skip spread elements\r\n if (prop.type === 'SpreadElement') continue;\r\n\r\n const keyName =\r\n prop.key.type === 'Identifier'\r\n ? prop.key.name\r\n : prop.key.type === 'Literal'\r\n ? String(prop.key.value)\r\n : null;\r\n\r\n if (keyName === null) continue;\r\n\r\n // Skip known i18next config keys\r\n if (I18NEXT_CONFIG_KEYS.has(keyName)) continue;\r\n\r\n // Flag non-standard interpolation param names\r\n if (!ALLOWED_PARAM_NAMES.has(keyName))\r\n context.report({\r\n node: prop,\r\n messageId: 'nonStandardParam',\r\n data: { paramName: keyName },\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'i18n-param-names': rule,\r\n },\r\n};\r\n","import { compileAllow, isDirective, isDocBlock, removeSuggestion } from './comment-utils.js';\n\nconst noCommentsRule = {\n meta: {\n type: 'suggestion',\n hasSuggestions: true,\n docs: {\n description:\n 'Disallow code comments: intent goes in names, rules in test names, context in the task doc and commit (RV-2)',\n },\n schema: [\n {\n type: 'object',\n properties: { allow: { type: 'array', items: { type: 'string' } } },\n additionalProperties: false,\n },\n ],\n messages: {\n noComment:\n 'RV-2: no code comments. Put intent in names, business rules in test names, context in the task doc or commit message.',\n removeComment: 'Remove this comment.',\n },\n },\n\n create(context) {\n const sourceCode = context.sourceCode ?? context.getSourceCode();\n const extra = compileAllow(context.options[0]?.allow);\n\n return {\n Program() {\n for (const comment of sourceCode.getAllComments()) {\n if (isDocBlock(comment) || isDirective(comment, extra)) continue;\n context.report({\n loc: comment.loc,\n messageId: 'noComment',\n suggest: [removeSuggestion(sourceCode, comment)],\n });\n }\n },\n };\n },\n};\n\nexport default { rules: { 'no-comments': noCommentsRule } };\n","/**\r\n * Custom ESLint Plugin: No Barrel Companion File\r\n *\r\n * Flags any .ts/.tsx file that has a same-named directory containing an\r\n * index.ts or index.tsx barrel file. This pattern causes a silent resolution\r\n * conflict: TypeScript resolves `import from './foo'` to `foo.ts` (the file),\r\n * NOT `foo/index.ts` (the barrel). Any exports added to the barrel but missing\r\n * from the companion file will cause \"has no exported member\" errors.\r\n *\r\n * Auto-fix: When the companion file contains ONLY re-exports (no local\r\n * declarations or logic), the fix replaces the entire file with\r\n * `export * from './<name>/index';`. Files with local code are flagged\r\n * but NOT auto-fixed — those require manual resolution.\r\n *\r\n * Examples:\r\n * BAD: types.ts exists alongside types/index.ts\r\n * → import from './types' resolves to types.ts, ignoring types/index.ts\r\n *\r\n * GOOD: Only types/index.ts exists (no companion types.ts)\r\n * → import from './types' resolves to types/index.ts as expected\r\n *\r\n * GOOD: Only types.ts exists (no directory)\r\n * → No ambiguity\r\n *\r\n * OK: types.ts exists with `export * from './types/index';`\r\n * → Companion is a pure passthrough, all exports forwarded\r\n */\r\n\r\nimport { existsSync } from 'fs';\r\nimport { dirname, basename, join } from 'path';\r\n\r\n/**\r\n * Checks whether a Program node contains only re-export statements\r\n * (no local declarations, logic, or JSX). A \"re-export\" is an\r\n * ExportNamedDeclaration or ExportAllDeclaration that has a `source`\r\n * property (meaning it re-exports from another module).\r\n * Import statements are also allowed (they may be needed for re-exports).\r\n */\r\nfunction isPureReExportFile(programNode) {\r\n const { body } = programNode;\r\n if (body.length === 0) return false;\r\n\r\n return body.every((stmt) => {\r\n if (stmt.type === 'ImportDeclaration') return true;\r\n if (stmt.type === 'ExportAllDeclaration') return true;\r\n const isReExport = stmt.type === 'ExportNamedDeclaration' && stmt.source !== null;\r\n return isReExport;\r\n });\r\n}\r\n\r\nconst noBarrelCompanionFileRule = {\r\n meta: {\r\n type: 'problem',\r\n fixable: 'code',\r\n docs: {\r\n description:\r\n 'Disallow .ts/.tsx files that shadow a same-named directory barrel (index.ts). ' +\r\n 'This causes TypeScript to resolve imports to the file instead of the barrel, ' +\r\n 'leading to missing export errors.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n companionFileConflict:\r\n 'File \"{{fileName}}\" shadows the barrel \"{{barrelPath}}\". ' +\r\n 'TypeScript resolves `import from \\'./{{baseName}}\\'` to this file, ignoring the barrel. ' +\r\n 'Delete this file and update imports to use the barrel, or consolidate into one location.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n Program(node) {\r\n const filePath = context.filename || context.getFilename();\r\n\r\n // Only check .ts and .tsx files (not .d.ts, not index files themselves)\r\n if (!filePath || (!filePath.endsWith('.ts') && !filePath.endsWith('.tsx'))) return;\r\n if (filePath.endsWith('.d.ts')) return;\r\n\r\n const fileBaseName = basename(filePath);\r\n\r\n // Skip index files — they ARE the barrel, not the companion\r\n if (fileBaseName === 'index.ts' || fileBaseName === 'index.tsx') return;\r\n\r\n // Get the base name without extension\r\n const ext = fileBaseName.endsWith('.tsx') ? '.tsx' : '.ts';\r\n const baseName = fileBaseName.slice(0, -ext.length);\r\n const dir = dirname(filePath);\r\n\r\n // Check if a same-named directory exists with an index barrel\r\n const siblingDir = join(dir, baseName);\r\n const barrelTs = join(siblingDir, 'index.ts');\r\n const barrelTsx = join(siblingDir, 'index.tsx');\r\n\r\n const hasBarrelTs = existsSync(barrelTs);\r\n const hasBarrelTsx = existsSync(barrelTsx);\r\n\r\n if (hasBarrelTs || hasBarrelTsx) {\r\n // If the companion is already a pure wildcard re-export of the\r\n // barrel, it's safe — all exports are forwarded automatically.\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n const trimmed = sourceCode.text.trim();\r\n const safePattern = `export * from './${baseName}/index';`;\r\n if (trimmed === safePattern) return;\r\n\r\n const barrelPath = hasBarrelTs\r\n ? `${baseName}/index.ts`\r\n : `${baseName}/index.tsx`;\r\n\r\n // Only provide auto-fix when the file is purely re-exports.\r\n // Files with local declarations, logic, or JSX require manual\r\n // resolution (move code into the barrel directory).\r\n const canAutoFix = isPureReExportFile(node);\r\n\r\n context.report({\r\n node,\r\n messageId: 'companionFileConflict',\r\n data: {\r\n fileName: fileBaseName,\r\n barrelPath,\r\n baseName,\r\n },\r\n ...(canAutoFix && {\r\n fix(fixer) {\r\n const fullRange = [0, sourceCode.text.length];\r\n const replacement = `export * from './${baseName}/index';\\n`;\r\n return fixer.replaceTextRange(fullRange, replacement);\r\n },\r\n }),\r\n });\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-barrel-companion-file': noBarrelCompanionFileRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Duplicate Nav Route/Key\r\n *\r\n * Ensures every sidebar nav item within a module has a unique `route` and `key`.\r\n * Duplicate routes cause multiple sidebar items to navigate to the same path,\r\n * and duplicate keys cause rendering/highlighting issues.\r\n *\r\n * Scoped to module definition files: packages/[module]/src/index.ts\r\n */\r\n\r\n/**\r\n * @param {string} propName\r\n * @param {string} messageId\r\n */\r\nfunction createDuplicateChecker(propName, messageId) {\r\n return {\r\n /** @param {import('estree').ArrayExpression} node */\r\n check(node, context) {\r\n const objectsWithProp = node.elements.filter(\r\n (el) =>\r\n el &&\r\n el.type === 'ObjectExpression' &&\r\n el.properties.some(\r\n (p) =>\r\n p.type === 'Property' &&\r\n p.key.type === 'Identifier' &&\r\n p.key.name === propName,\r\n ),\r\n );\r\n\r\n if (objectsWithProp.length === 0) return;\r\n\r\n /** @type {Map<string, import('estree').Property>} */\r\n const seen = new Map();\r\n\r\n for (const obj of objectsWithProp) {\r\n const prop = obj.properties.find(\r\n (p) =>\r\n p.type === 'Property' &&\r\n p.key.type === 'Identifier' &&\r\n p.key.name === propName,\r\n );\r\n if (!prop) continue;\r\n\r\n let value;\r\n if (prop.value.type === 'Literal') {\r\n value = String(prop.value.value);\r\n } else if (prop.value.type === 'MemberExpression') {\r\n const src = context.sourceCode || context.getSourceCode();\r\n value = src.getText(prop.value);\r\n } else if (prop.value.type === 'TemplateLiteral' && prop.value.quasis.length === 1) {\r\n value = prop.value.quasis[0].value.cooked;\r\n } else {\r\n continue;\r\n }\r\n\r\n if (seen.has(value)) {\r\n context.report({\r\n node: prop.value,\r\n messageId,\r\n data: { value },\r\n });\r\n } else {\r\n seen.set(value, prop);\r\n }\r\n }\r\n },\r\n };\r\n}\r\n\r\nconst noDuplicateNavPrefixRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow duplicate route or key values in module sidebarItems. ' +\r\n 'Duplicate routes cause navigation collisions; duplicate keys cause rendering issues.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n duplicateRoute:\r\n 'Duplicate route \"{{value}}\" - each sidebar item must have a unique route.',\r\n duplicateKey:\r\n 'Duplicate key \"{{value}}\" - each sidebar item must have a unique key.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const routeChecker = createDuplicateChecker('route', 'duplicateRoute');\r\n const keyChecker = createDuplicateChecker('key', 'duplicateKey');\r\n\r\n return {\r\n ArrayExpression(node) {\r\n routeChecker.check(node, context);\r\n keyChecker.check(node, context);\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-duplicate-nav-prefix': noDuplicateNavPrefixRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Duplicate Shared Patterns\r\n *\r\n * Warns when product module directories create components with names\r\n * that match existing shared components in src/components/. This\r\n * helps prevent accidental duplication of shared UI patterns.\r\n *\r\n * Scanned directories (product-specific code):\r\n * - packages/* /src/ (product module packages)\r\n * - src/features/ (feature directories)\r\n *\r\n * Reference directory (shared components):\r\n * - src/components/ (recursively scanned for .tsx basenames)\r\n *\r\n * The rule collects all .tsx file basenames from src/components/ at\r\n * startup and warns when a .tsx file in a product directory has the\r\n * same basename.\r\n *\r\n * Examples:\r\n * WARN: packages/onlinemenu-module/src/components/EmptyState.tsx\r\n * (when src/components/Shared/EmptyState.tsx exists)\r\n *\r\n * OK: packages/onlinemenu-module/src/components/MenuCard.tsx\r\n * (no matching shared component)\r\n *\r\n * OK: packages/onlinemenu-module/src/index.ts\r\n * (not a .tsx component file)\r\n */\r\n\r\nimport { readdirSync, existsSync } from 'fs';\r\nimport { posix, sep, basename, join } from 'path';\r\n\r\n/**\r\n * Normalize a file path to use forward slashes.\r\n */\r\nfunction normalizePath(filePath) {\r\n return filePath.split(sep).join(posix.sep);\r\n}\r\n\r\n/**\r\n * Recursively collect all .tsx basenames from a directory.\r\n * Skips test files and index files.\r\n */\r\nfunction collectComponentNames(dirPath) {\r\n const names = new Set();\r\n if (!existsSync(dirPath)) return names;\r\n\r\n function walk(dir) {\r\n try {\r\n const entries = readdirSync(dir, { withFileTypes: true });\r\n for (const entry of entries) {\r\n if (entry.isDirectory()) {\r\n walk(join(dir, entry.name));\r\n continue;\r\n }\r\n const name = entry.name;\r\n if (!name.endsWith('.tsx')) continue;\r\n if (name.endsWith('.test.tsx')) continue;\r\n if (name === 'index.tsx') continue;\r\n names.add(name);\r\n }\r\n } catch {\r\n // Directory not readable, skip\r\n }\r\n }\r\n\r\n walk(dirPath);\r\n return names;\r\n}\r\n\r\n/**\r\n * Check whether a file is inside a product-specific directory.\r\n */\r\nfunction isInsideProductDirectory(filePath) {\r\n const normalized = normalizePath(filePath);\r\n return (\r\n normalized.includes('/packages/') &&\r\n normalized.includes('-module/src/')\r\n ) || normalized.includes('/src/features/');\r\n}\r\n\r\n/**\r\n * Find the BaseClient src/components/ directory from a file path.\r\n * Walks up looking for BaseClient/src/components/.\r\n */\r\nfunction findSharedComponentsDir(filePath) {\r\n const normalized = normalizePath(filePath);\r\n const baseClientIdx = normalized.indexOf('/BaseClient/');\r\n if (baseClientIdx === -1) return null;\r\n const baseClientRoot = filePath\r\n .split(sep)\r\n .join(posix.sep)\r\n .slice(0, baseClientIdx + '/BaseClient'.length);\r\n // Convert back to OS path\r\n const osPath = baseClientRoot.split(posix.sep).join(sep);\r\n return join(osPath, 'src', 'components');\r\n}\r\n\r\n/** Cache shared component names per components dir. */\r\nconst sharedNamesCache = new Map();\r\n\r\nconst noDuplicateSharedPatternsRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Warn when product modules create components that share names ' +\r\n 'with existing shared components in src/components/.',\r\n category: 'Best Practices',\r\n recommended: false,\r\n },\r\n schema: [],\r\n messages: {\r\n duplicateSharedPattern:\r\n '\"{{fileName}}\" already exists as a shared component in ' +\r\n 'src/components/. Consider reusing the shared version or ' +\r\n 'renaming this component to clarify its purpose.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return {};\r\n\r\n // Only check .tsx files (components)\r\n if (!filePath.endsWith('.tsx')) return {};\r\n\r\n const fileName = basename(filePath);\r\n\r\n // Skip test files and index files\r\n if (fileName.endsWith('.test.tsx')) return {};\r\n if (fileName === 'index.tsx') return {};\r\n\r\n // Only check files in product-specific directories\r\n if (!isInsideProductDirectory(filePath)) return {};\r\n\r\n return {\r\n Program() {\r\n const componentsDir = findSharedComponentsDir(filePath);\r\n if (!componentsDir) return;\r\n\r\n // Cache the shared component names\r\n if (!sharedNamesCache.has(componentsDir))\r\n sharedNamesCache.set(\r\n componentsDir,\r\n collectComponentNames(componentsDir),\r\n );\r\n\r\n const sharedNames = sharedNamesCache.get(componentsDir);\r\n\r\n if (sharedNames.has(fileName))\r\n context.report({\r\n loc: { line: 1, column: 0 },\r\n messageId: 'duplicateSharedPattern',\r\n data: { fileName },\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-duplicate-shared-patterns': noDuplicateSharedPatternsRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Generated Models Barrel Value Import\r\n *\r\n * Disallows runtime (value) imports from the auto-generated model barrels:\r\n * server/autoGeneratedHooks/<service>/models\r\n * server/autoGeneratedHooks/<service>/models/index\r\n *\r\n * These barrels re-export all generated types for a service. Importing runtime\r\n * values from them pulls the entire barrel into the module graph, preventing\r\n * tree-shaking and inflating bundle size.\r\n *\r\n * Type-only imports are always allowed:\r\n * import type { Foo } from '../../server/autoGeneratedHooks/questioner/models'; // OK\r\n * import { type Foo } from '../../server/autoGeneratedHooks/questioner/models'; // OK\r\n *\r\n * Runtime value imports must target the specific leaf module instead:\r\n * import { QuestionType } from '../../server/autoGeneratedHooks/questioner/models/questionType'; // OK\r\n */\r\n\r\n/** Matches any path ending in autoGeneratedHooks/<service>/models or …/models/index */\r\nconst BARREL_PATTERN = /autoGeneratedHooks\\/[^/]+\\/models(?:\\/index)?$/;\r\n\r\nfunction isTypeOnlyImport(node) {\r\n if (node.importKind === 'type') return true;\r\n\r\n const specifiers = node.specifiers ?? [];\r\n if (specifiers.length === 0) return false;\r\n\r\n return specifiers.every((s) => s.importKind === 'type');\r\n}\r\n\r\nconst noGeneratedModelsBarrelValueImportRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow runtime (value) imports from generated model barrels; use specific leaf modules or type-only imports.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n noValueImport:\r\n 'Do not import runtime values from \"{{module}}\". Import from a specific leaf model module instead (e.g. …/models/questionType). Type-only imports are allowed.',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n ImportDeclaration(node) {\r\n const moduleName = node.source?.value;\r\n if (typeof moduleName !== 'string') return;\r\n if (!BARREL_PATTERN.test(moduleName)) return;\r\n if (isTypeOnlyImport(node)) return;\r\n\r\n context.report({\r\n node,\r\n messageId: 'noValueImport',\r\n data: { module: moduleName },\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-generated-models-barrel-value-import': noGeneratedModelsBarrelValueImportRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Null/Undefined Check\r\n *\r\n * Prohibits direct null/undefined checks (!== null, === null, !== undefined, === undefined)\r\n * and requires using isValueDefined() or isNullOrUndefined() from '@dloizides/utils' instead.\r\n *\r\n * These utility functions handle both null and undefined, providing\r\n * consistent and safer null checking across the codebase.\r\n *\r\n * Examples:\r\n * BAD: if (item !== null) { ... }\r\n * BAD: if (item !== undefined) { ... }\r\n * GOOD: if (isValueDefined(item)) { ... }\r\n *\r\n * BAD: if (item === null) { ... }\r\n * BAD: if (item === undefined) { ... }\r\n * GOOD: if (!isValueDefined(item)) { ... }\r\n * GOOD: if (isNullOrUndefined(item)) { ... }\r\n */\r\n\r\n/** Where `isValueDefined` is imported from when the fixer has to add the import. */\r\nconst DEFAULT_UTIL_IMPORT_PATH = '@dloizides/utils';\r\n\r\n/** The guard the autofix rewrites to. Must be in scope for the fixed code to compile. */\r\nconst GUARD_NAME = 'isValueDefined';\r\n\r\n/** How `isValueDefined` is bound in the file under lint, if at all. */\r\nconst BindingKind = {\r\n /** Not bound — the fixer must add an import. */\r\n None: 'none',\r\n /** Already imported — the fixer may rewrite freely. */\r\n Imported: 'imported',\r\n /** Declared/exported *by this file* — never autofix (it would self-import). */\r\n Local: 'local',\r\n};\r\n\r\n/**\r\n * Determine how `isValueDefined` is bound at the top level of `ast`.\r\n *\r\n * This is what makes the autofix safe: before ES-04 the fixer emitted\r\n * `isValueDefined(...)` unconditionally, so `eslint --fix` corrupted every file\r\n * that did not already import it.\r\n */\r\nfunction findGuardBinding(ast) {\r\n for (const statement of ast.body) {\r\n if (statement.type === 'ImportDeclaration') {\r\n for (const specifier of statement.specifiers) {\r\n if (specifier.local && specifier.local.name === GUARD_NAME) return BindingKind.Imported;\r\n }\r\n continue;\r\n }\r\n\r\n // `export { isValueDefined } from './guards/isValueDefined'` — the barrel that\r\n // re-exports the guard. Re-exports create no local binding, but importing the\r\n // guard into its own barrel is still wrong, so treat it as local.\r\n if (statement.type === 'ExportNamedDeclaration') {\r\n for (const specifier of statement.specifiers || []) {\r\n if (specifier.exported && specifier.exported.name === GUARD_NAME) return BindingKind.Local;\r\n }\r\n }\r\n\r\n const declaration =\r\n statement.type === 'ExportNamedDeclaration' ? statement.declaration : statement;\r\n if (!declaration) continue;\r\n\r\n if (declaration.type === 'FunctionDeclaration' && declaration.id?.name === GUARD_NAME) {\r\n return BindingKind.Local;\r\n }\r\n if (declaration.type === 'VariableDeclaration') {\r\n for (const declarator of declaration.declarations) {\r\n if (declarator.id?.type === 'Identifier' && declarator.id.name === GUARD_NAME) {\r\n return BindingKind.Local;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return BindingKind.None;\r\n}\r\n\r\n/**\r\n * Insert `import { isValueDefined } from '<utilImportPath>';` — after the last\r\n * existing import, or at the very top of the file when there are none.\r\n *\r\n * When a file has several violations, every report's fix carries this same\r\n * insertion. ESLint applies one and defers the rest (overlapping ranges), then\r\n * re-runs; on the next pass the import exists, `guardIsImported` is true, and the\r\n * remaining rewrites apply cleanly. Converges in two passes.\r\n */\r\nfunction buildGuardImportFix(fixer, sourceCode, utilImportPath) {\r\n const importStatement = `import { ${GUARD_NAME} } from '${utilImportPath}';`;\r\n const body = sourceCode.ast.body;\r\n const imports = body.filter((node) => node.type === 'ImportDeclaration');\r\n\r\n if (imports.length > 0) {\r\n return fixer.insertTextAfter(imports[imports.length - 1], `\\n${importStatement}`);\r\n }\r\n\r\n // No imports yet. Insert before the first statement rather than at offset 0 —\r\n // a node's range excludes its leading comments, so the file's header docblock\r\n // stays on top instead of being pushed below the new import.\r\n if (body.length > 0) {\r\n return fixer.insertTextBefore(body[0], `${importStatement}\\n`);\r\n }\r\n\r\n return fixer.insertTextBeforeRange([0, 0], `${importStatement}\\n`);\r\n}\r\n\r\nconst noNullCheckRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Disallow direct null/undefined checks. Use isValueDefined() or isNullOrUndefined() instead.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n fixable: 'code',\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n utilImportPath: {\r\n type: 'string',\r\n description: 'Import path for the utility functions',\r\n default: '@dloizides/utils',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n noNotEqualsNull:\r\n 'Avoid \"!== null\" checks. Use isValueDefined({{identifier}}) instead, which handles both null and undefined.',\r\n noEqualsNull:\r\n 'Avoid \"=== null\" checks. Use !isValueDefined({{identifier}}) or isNullOrUndefined({{identifier}}) instead.',\r\n noNotEqualsNullComplex:\r\n 'Avoid \"!== null\" checks. Use isValueDefined() instead, which handles both null and undefined.',\r\n noEqualsNullComplex:\r\n 'Avoid \"=== null\" checks. Use !isValueDefined() or isNullOrUndefined() instead.',\r\n noNotEqualsUndefined:\r\n 'Avoid \"!== undefined\" checks. Use isValueDefined({{identifier}}) instead, which handles both null and undefined.',\r\n noEqualsUndefined:\r\n 'Avoid \"=== undefined\" checks. Use !isValueDefined({{identifier}}) or isNullOrUndefined({{identifier}}) instead.',\r\n noNotEqualsUndefinedComplex:\r\n 'Avoid \"!== undefined\" checks. Use isValueDefined() instead, which handles both null and undefined.',\r\n noEqualsUndefinedComplex:\r\n 'Avoid \"=== undefined\" checks. Use !isValueDefined() or isNullOrUndefined() instead.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n const options = context.options[0] || {};\r\n const utilImportPath = options.utilImportPath ?? DEFAULT_UTIL_IMPORT_PATH;\r\n\r\n // The autofix rewrites `x === undefined` to `!isValueDefined(x)`. That is only\r\n // valid source if `isValueDefined` is actually in scope — otherwise `--fix`\r\n // silently produces a file referencing an undeclared global (which then trips\r\n // no-unsafe-call / strict-boolean-expressions). So resolve, ONCE per pass,\r\n // whether the guard is already bound in this file; if not, the fix also\r\n // inserts the import.\r\n const guardBinding = findGuardBinding(sourceCode.ast);\r\n const declaresGuardItself = guardBinding === BindingKind.Local;\r\n const guardIsImported = guardBinding === BindingKind.Imported;\r\n\r\n /**\r\n * Build the fix for one violation: the expression rewrite, plus the\r\n * `isValueDefined` import when the file does not already have it.\r\n *\r\n * Returns `null` (no autofix) for the module that *defines* the guard —\r\n * importing a symbol into the file that exports it would be nonsense.\r\n */\r\n function buildFix(fixer, node, replacementText) {\r\n if (declaresGuardItself) return null;\r\n\r\n const rewrite = fixer.replaceText(node, replacementText);\r\n if (guardIsImported) return rewrite;\r\n\r\n return [rewrite, buildGuardImportFix(fixer, sourceCode, utilImportPath)];\r\n }\r\n\r\n /**\r\n * Check if a node is a null literal\r\n */\r\n function isNullLiteral(node) {\r\n return node && node.type === 'Literal' && node.value === null;\r\n }\r\n\r\n /**\r\n * Check if a node is an undefined identifier\r\n */\r\n function isUndefinedIdentifier(node) {\r\n return node && node.type === 'Identifier' && node.name === 'undefined';\r\n }\r\n\r\n /**\r\n * Get the source text for a node\r\n */\r\n function getNodeText(node) {\r\n return sourceCode.getText(node);\r\n }\r\n\r\n /**\r\n * Check if the identifier is simple enough for a clean message\r\n */\r\n function isSimpleIdentifier(node) {\r\n return (\r\n node.type === 'Identifier' ||\r\n (node.type === 'MemberExpression' && !node.computed)\r\n );\r\n }\r\n\r\n /**\r\n * Handle binary expressions (===, !==)\r\n */\r\n function checkBinaryExpression(node) {\r\n const { operator, left, right } = node;\r\n\r\n // Only handle === and !==\r\n if (operator !== '===' && operator !== '!==') {\r\n return;\r\n }\r\n\r\n // Check if either side is null or undefined\r\n const leftIsNull = isNullLiteral(left);\r\n const rightIsNull = isNullLiteral(right);\r\n const leftIsUndefined = isUndefinedIdentifier(left);\r\n const rightIsUndefined = isUndefinedIdentifier(right);\r\n\r\n const isNullCheck = leftIsNull || rightIsNull;\r\n const isUndefinedCheck = leftIsUndefined || rightIsUndefined;\r\n\r\n if (!isNullCheck && !isUndefinedCheck) {\r\n return;\r\n }\r\n\r\n // Get the non-null/undefined operand\r\n const valueNode = (leftIsNull || leftIsUndefined) ? right : left;\r\n const valueText = getNodeText(valueNode);\r\n const isSimple = isSimpleIdentifier(valueNode);\r\n\r\n if (operator === '!==') {\r\n // item !== null/undefined -> isValueDefined(item)\r\n const messageId = isNullCheck\r\n ? (isSimple ? 'noNotEqualsNull' : 'noNotEqualsNullComplex')\r\n : (isSimple ? 'noNotEqualsUndefined' : 'noNotEqualsUndefinedComplex');\r\n\r\n context.report({\r\n node,\r\n messageId,\r\n data: isSimple ? { identifier: valueText } : {},\r\n fix(fixer) {\r\n return buildFix(fixer, node, `isValueDefined(${valueText})`);\r\n },\r\n });\r\n } else {\r\n // item === null/undefined -> !isValueDefined(item)\r\n const messageId = isNullCheck\r\n ? (isSimple ? 'noEqualsNull' : 'noEqualsNullComplex')\r\n : (isSimple ? 'noEqualsUndefined' : 'noEqualsUndefinedComplex');\r\n\r\n context.report({\r\n node,\r\n messageId,\r\n data: isSimple ? { identifier: valueText } : {},\r\n fix(fixer) {\r\n return buildFix(fixer, node, `!isValueDefined(${valueText})`);\r\n },\r\n });\r\n }\r\n }\r\n\r\n return {\r\n BinaryExpression: checkBinaryExpression,\r\n };\r\n },\r\n};\r\n\r\n/**\r\n * Export the plugin\r\n */\r\nexport default {\r\n rules: {\r\n 'no-null-check': noNullCheckRule,\r\n },\r\n};\r\n","/**\r\n * ESLint rule: no-optional-undefined\r\n *\r\n * Prevents declaring optional properties/parameters with explicit `| undefined`\r\n * in the type annotation. With `exactOptionalPropertyTypes: true`, `?: T` and\r\n * `?: T | undefined` are semantically different, but the correct practice is to\r\n * use `?: T` and fix the assignment side (omit the key) rather than widening the\r\n * type with `| undefined`.\r\n *\r\n * Bad: pageCount?: number | undefined;\r\n * Good: pageCount?: number;\r\n *\r\n * Bad: function foo(bar?: string | undefined) {}\r\n * Good: function foo(bar?: string) {}\r\n */\r\n\r\n/** @type {import('eslint').ESLint.Plugin} */\r\nexport default {\r\n rules: {\r\n 'no-optional-undefined': {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Disallow combining optional marker (?) with `| undefined` in type annotations',\r\n },\r\n messages: {\r\n noOptionalUndefined:\r\n 'Do not combine optional (?) with `| undefined`. Use `?: {{type}}` and omit the key when the value is undefined.',\r\n },\r\n schema: [],\r\n },\r\n create(context) {\r\n /**\r\n * Check if a type annotation is a union containing `undefined`.\r\n * Returns the cleaned type string (without undefined) if found,\r\n * otherwise returns null.\r\n */\r\n function getTypeWithoutUndefined(typeAnnotation) {\r\n if (!typeAnnotation || typeAnnotation.type !== 'TSUnionType') return null;\r\n\r\n const hasUndefined = typeAnnotation.types.some(\r\n (t) => t.type === 'TSUndefinedKeyword',\r\n );\r\n if (!hasUndefined) return null;\r\n\r\n const nonUndefinedTypes = typeAnnotation.types.filter(\r\n (t) => t.type !== 'TSUndefinedKeyword',\r\n );\r\n\r\n const sourceCode = context.sourceCode ?? context.getSourceCode();\r\n if (nonUndefinedTypes.length === 1)\r\n return sourceCode.getText(nonUndefinedTypes[0]);\r\n\r\n return nonUndefinedTypes.map((t) => sourceCode.getText(t)).join(' | ');\r\n }\r\n\r\n function checkNode(node, typeAnnotationNode) {\r\n if (!node.optional) return;\r\n if (!typeAnnotationNode) return;\r\n\r\n const annotation =\r\n typeAnnotationNode.typeAnnotation ?? typeAnnotationNode;\r\n const cleanType = getTypeWithoutUndefined(annotation);\r\n if (cleanType === null) return;\r\n\r\n context.report({\r\n node: typeAnnotationNode,\r\n messageId: 'noOptionalUndefined',\r\n data: { type: cleanType },\r\n });\r\n }\r\n\r\n return {\r\n // Interface / type alias properties: foo?: string | undefined\r\n TSPropertySignature(node) {\r\n checkNode(node, node.typeAnnotation?.typeAnnotation);\r\n },\r\n // Function parameters: function foo(bar?: string | undefined)\r\n // Arrow functions, methods, etc.\r\n Identifier(node) {\r\n if (!node.optional) return;\r\n // Only check function parameters\r\n const parent = node.parent;\r\n if (!parent) return;\r\n const isParam =\r\n (parent.type === 'FunctionDeclaration' ||\r\n parent.type === 'FunctionExpression' ||\r\n parent.type === 'ArrowFunctionExpression') &&\r\n parent.params.includes(node);\r\n if (!isParam) return;\r\n\r\n checkNode(node, node.typeAnnotation?.typeAnnotation);\r\n },\r\n };\r\n },\r\n },\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: No Product Imports in Shared\r\n *\r\n * Prevents product-specific imports inside `src/components/`.\r\n * Shared components must not depend on product modules, feature\r\n * directories, or product-specific auto-generated API hooks.\r\n * This ensures shared components remain reusable across all products.\r\n *\r\n * Banned import sources (when the importing file is under src/components/):\r\n * - @baseclient/*-module (except identity-module, which is shared infra)\r\n * - server/autoGeneratedHooks/{onlinemenu,questioner,content,notification}/\r\n * - src/features/ or src/modules/\r\n *\r\n * Allowed:\r\n * - @baseclient/core, @baseclient/identity-client (shared infra)\r\n * - src/shared/, src/lib/, src/localization/, src/components/\r\n * - External packages (react, react-native, etc.)\r\n * - Relative imports within src/components/\r\n *\r\n * Examples:\r\n * BAD: import { X } from '@baseclient/onlinemenu-module';\r\n * BAD: import { Y } from '../../server/autoGeneratedHooks/questioner/...';\r\n * BAD: import type { Z } from '@baseclient/questioner-module';\r\n * GOOD: import { A } from '@baseclient/core';\r\n * GOOD: import { B } from '../../shared/utils';\r\n */\r\n\r\nimport { posix, sep } from 'path';\r\n\r\n/**\r\n * Scoped @baseclient packages that are shared infrastructure\r\n * and allowed in src/components/.\r\n */\r\nconst ALLOWED_BASECLIENT_PACKAGES = new Set([\r\n '@baseclient/core',\r\n '@baseclient/identity-client',\r\n '@baseclient/identity-module',\r\n]);\r\n\r\n/**\r\n * Product-specific auto-generated hook directory names under\r\n * server/autoGeneratedHooks/ that are banned.\r\n */\r\nconst PRODUCT_HOOK_DIRS = new Set([\r\n 'onlinemenu',\r\n 'questioner',\r\n 'content',\r\n 'notification',\r\n]);\r\n\r\n/**\r\n * Normalize a file path to use forward slashes for consistent matching.\r\n */\r\nfunction normalizePath(filePath) {\r\n return filePath.split(sep).join(posix.sep);\r\n}\r\n\r\n/**\r\n * Check whether a file path is inside src/components/.\r\n */\r\nfunction isInsideSharedComponents(filePath) {\r\n const normalized = normalizePath(filePath);\r\n return normalized.includes('/src/components/');\r\n}\r\n\r\n/**\r\n * Check whether an import source is a banned @baseclient product module.\r\n * Bans any @baseclient/*-module package except those in the allow list.\r\n */\r\nfunction isBannedBaseclientModule(source) {\r\n if (!source.startsWith('@baseclient/')) return false;\r\n if (ALLOWED_BASECLIENT_PACKAGES.has(source)) return false;\r\n return source.endsWith('-module');\r\n}\r\n\r\n/**\r\n * Check whether an import source resolves to a product-specific\r\n * auto-generated hooks directory.\r\n */\r\nfunction isBannedAutoGeneratedHook(source) {\r\n const normalized = normalizePath(source);\r\n for (const dir of PRODUCT_HOOK_DIRS) {\r\n if (normalized.includes(`autoGeneratedHooks/${dir}`)) return true;\r\n if (normalized.includes(`autoGeneratedHooks/${dir}/`)) return true;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Check whether an import source points to src/features/ or src/modules/.\r\n */\r\nfunction isBannedFeatureOrModulePath(source) {\r\n const normalized = normalizePath(source);\r\n return (\r\n normalized.includes('/src/features/') ||\r\n normalized.includes('/src/modules/') ||\r\n normalized.includes('/features/') ||\r\n normalized.includes('/modules/')\r\n );\r\n}\r\n\r\nconst noProductImportsInSharedRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow product-specific imports in src/components/. ' +\r\n 'Shared components must not depend on product modules.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [],\r\n messages: {\r\n productImportInShared:\r\n 'Shared components in src/components/ must not import from ' +\r\n 'product-specific modules ({{source}}). Move product-specific ' +\r\n 'logic to the feature module, or extract shared types to ' +\r\n '@baseclient/core.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const filePath = context.filename || context.getFilename();\r\n if (!filePath) return {};\r\n\r\n // Only apply to files inside src/components/\r\n if (!isInsideSharedComponents(filePath)) return {};\r\n\r\n /**\r\n * Check a single import/export declaration for banned sources.\r\n */\r\n function checkImportSource(node) {\r\n const source = node.source;\r\n if (!source) return;\r\n\r\n const importPath = source.value;\r\n if (typeof importPath !== 'string') return;\r\n\r\n const isBanned =\r\n isBannedBaseclientModule(importPath) ||\r\n isBannedAutoGeneratedHook(importPath) ||\r\n isBannedFeatureOrModulePath(importPath);\r\n\r\n if (isBanned)\r\n context.report({\r\n node,\r\n messageId: 'productImportInShared',\r\n data: { source: importPath },\r\n });\r\n }\r\n\r\n return {\r\n ImportDeclaration: checkImportSource,\r\n ExportNamedDeclaration: checkImportSource,\r\n ExportAllDeclaration: checkImportSource,\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'no-product-imports-in-shared': noProductImportsInSharedRule,\r\n },\r\n};\r\n","/**\n * Custom ESLint Plugin: No Raw Color Literal\n *\n * Turns \"use design tokens, not hardcoded colours\" from a convention into a gate.\n *\n * Why this exists: a raw colour literal is invisible until you try to rebrand. Changing the\n * PROOViD accent from indigo to sky-blue meant a find-and-replace of `#4f46e5` across a dozen\n * docs files plus three C# controllers, because every surface had hardcoded its own accent —\n * archaeology instead of one token edit. Every literal you allow today is a file someone greps\n * later. Colours belong in `@dloizides/design-tokens` and reach components through the theme.\n *\n * Examples:\n * FLAGGED: const c = '#38bdf8';\n * FLAGGED: backgroundColor: '#fff'\n * FLAGGED: boxShadow: `0 0 0 3px rgba(56, 189, 248, .15)`\n * FLAGGED: border: 'hsl(200 90% 60%)'\n *\n * NOT FLAGGED:\n * colors.primary // from the theme\n * theme.palette.primary['500'] // from the theme\n * '#main-content' // an anchor/selector, not a colour\n * 'transparent' / 'currentColor' // keywords, not literals to tokenise\n * anything under a path in the `allow` option (token/theme definitions must\n * state real colours SOMEWHERE — that somewhere is the token package)\n *\n * Options:\n * { allow: string[] } path substrings that are exempt, e.g.\n * [\"design-tokens\", \"theme/tokens\", \".test.\"]\n * The package owns the rule logic; the app owns which paths are exempt and the\n * severity — the same split as every other rule in this pack.\n */\n\n/** A string that IS a colour: #rgb, #rgba, #rrggbb, #rrggbbaa. Anchored, so `#section` is safe. */\nconst FULL_HEX_COLOR = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;\n\n/**\n * Functional colour syntax anywhere in the string. Unanchored on purpose: these show up INSIDE\n * bigger values (gradients, shadows) where the literal is not itself a bare colour, e.g.\n * `0 8px 22px -8px rgba(56,189,248,.7)`.\n */\nconst FUNCTIONAL_COLOR = /\\b(?:rgba?|hsla?)\\s*\\(/;\n\n/** True when the raw source text contains a colour we want tokenised. */\nfunction containsRawColor(text) {\n if (typeof text !== 'string' || text.length === 0) return false;\n if (FULL_HEX_COLOR.test(text.trim())) return true;\n return FUNCTIONAL_COLOR.test(text);\n}\n\n/** True when this file is exempt (token/theme definitions, or whatever the app allows). */\nfunction isAllowedFile(filename, allow) {\n if (typeof filename !== 'string') return false;\n const normalised = filename.split('\\\\').join('/');\n return allow.some((fragment) => normalised.includes(fragment));\n}\n\nconst noRawColorLiteralRule = {\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Disallow raw colour literals (hex / rgb() / hsl()) in app code. Colours belong in @dloizides/design-tokens and reach components through the theme.',\n category: 'Best Practices',\n recommended: true,\n },\n schema: [\n {\n type: 'object',\n properties: {\n allow: {\n type: 'array',\n items: { type: 'string' },\n },\n },\n additionalProperties: false,\n },\n ],\n messages: {\n rawColor:\n 'Raw colour literal \"{{value}}\" — use a design token instead (@dloizides/design-tokens via the theme). Hardcoded colours make a rebrand a find-and-replace across every file.',\n },\n },\n\n create(context) {\n const options = context.options[0] ?? {};\n const allow = Array.isArray(options.allow) ? options.allow : [];\n\n const filename =\n typeof context.getFilename === 'function' ? context.getFilename() : context.filename;\n\n if (isAllowedFile(filename, allow)) return {};\n\n /** Report `node`, trimming the display value so a long gradient stays readable. */\n const report = (node, rawValue) => {\n const value = rawValue.trim();\n const display = value.length > 40 ? `${value.slice(0, 40)}…` : value;\n context.report({ node, messageId: 'rawColor', data: { value: display } });\n };\n\n return {\n Literal(node) {\n if (typeof node.value !== 'string') return;\n if (!containsRawColor(node.value)) return;\n report(node, node.value);\n },\n\n // Template literals: check each static chunk, so an interpolated value\n // (`${primary}`) is fine but a baked-in rgba(...) chunk is not.\n TemplateElement(node) {\n const raw = node.value?.raw;\n if (!containsRawColor(raw)) return;\n report(node, raw);\n },\n };\n },\n};\n\nexport default {\n rules: {\n 'no-raw-color-literal': noRawColorLiteralRule,\n },\n};\n","/**\r\n * Custom ESLint Plugin: Prefer Const Enum\r\n *\r\n * Flags type aliases where ALL union members are string literals (2+ members)\r\n * and suggests converting to const enum.\r\n *\r\n * Examples:\r\n * FLAGGED: type Mode = 'light' | 'dark';\r\n * FLAGGED: export type Status = 'active' | 'inactive' | 'pending';\r\n *\r\n * NOT FLAGGED:\r\n * type Result = Success | Error; // Union of type references\r\n * type Nullable<T> = T | null; // Contains null keyword\r\n * type Mixed = 'a' | number; // Contains non-string member\r\n * type Single = 'only'; // Single value, not a union\r\n * type Callback = () => void; // Function type\r\n */\r\n\r\n/**\r\n * Convert a string literal value to a PascalCase enum member name.\r\n *\r\n * 'light' -> 'Light'\r\n * 'modern-grid' -> 'ModernGrid'\r\n * 'UPPER_CASE' -> 'UpperCase'\r\n * '2xl' -> '_2xl'\r\n */\r\nfunction toPascalCase(value) {\r\n // Split on hyphens, underscores, spaces, and camelCase boundaries\r\n const words = value\r\n .replace(/([a-z])([A-Z])/g, '$1 $2')\r\n .split(/[-_\\s]+/)\r\n .filter((w) => w.length > 0);\r\n\r\n const result = words\r\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\r\n .join('');\r\n\r\n // If starts with a digit, prefix with underscore\r\n if (/^\\d/.test(result)) return `_${result}`;\r\n\r\n return result;\r\n}\r\n\r\nconst preferConstEnumRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Prefer const enum over string literal union types for better autocomplete, refactoring, and centralized definitions.',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n hasSuggestions: true,\r\n schema: [],\r\n messages: {\r\n preferConstEnum:\r\n 'String literal union type \"{{name}}\" should be a const enum. Const enums provide autocomplete, refactoring support, and centralized definitions.',\r\n convertToConstEnum: 'Convert \"{{name}}\" to const enum',\r\n },\r\n },\r\n\r\n create(context) {\r\n return {\r\n TSTypeAliasDeclaration(node) {\r\n const { typeAnnotation } = node;\r\n\r\n // Must be a union type\r\n if (typeAnnotation.type !== 'TSUnionType') return;\r\n\r\n const { types } = typeAnnotation;\r\n\r\n // Must have 2+ members\r\n if (types.length < 2) return;\r\n\r\n // ALL members must be string literals\r\n const allStringLiterals = types.every(\r\n (member) =>\r\n member.type === 'TSLiteralType' &&\r\n member.literal.type === 'Literal' &&\r\n typeof member.literal.value === 'string',\r\n );\r\n\r\n if (!allStringLiterals) return;\r\n\r\n const typeName = node.id.name;\r\n const isExported =\r\n node.parent.type === 'ExportNamedDeclaration';\r\n const exportPrefix = isExported ? 'export ' : '';\r\n\r\n // Build the const enum suggestion\r\n const enumMembers = types\r\n .map((member) => {\r\n const value = member.literal.value;\r\n const memberName = toPascalCase(value);\r\n return ` ${memberName} = '${value}',`;\r\n })\r\n .join('\\n');\r\n\r\n const replacement = `${exportPrefix}const enum ${typeName} {\\n${enumMembers}\\n}`;\r\n\r\n // The node to replace depends on whether it's exported\r\n const targetNode = isExported ? node.parent : node;\r\n\r\n context.report({\r\n node: node.id,\r\n messageId: 'preferConstEnum',\r\n data: { name: typeName },\r\n suggest: [\r\n {\r\n messageId: 'convertToConstEnum',\r\n data: { name: typeName },\r\n fix(fixer) {\r\n return fixer.replaceText(targetNode, replacement);\r\n },\r\n },\r\n ],\r\n });\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'prefer-const-enum': preferConstEnumRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Require Stable Hook Arguments\r\n *\r\n * Detects functions, objects, and arrays declared in React component scope\r\n * that are passed as arguments to custom hooks (use*) without being wrapped\r\n * in useCallback or useMemo. These unstable references cause infinite\r\n * re-render loops when the hook uses them in useEffect dependency arrays.\r\n *\r\n * Examples:\r\n * BAD: const t = (key) => i18nT(key);\r\n * useQuizForm(data, t); // t is new ref every render\r\n *\r\n * GOOD: const t = useCallback((key) => i18nT(key), [i18nT]);\r\n * useQuizForm(data, t); // t is stable\r\n *\r\n * BAD: const config = { theme: 'dark' };\r\n * useMyHook(config); // config is new ref every render\r\n *\r\n * GOOD: const config = useMemo(() => ({ theme: 'dark' }), []);\r\n * useMyHook(config); // config is stable\r\n */\r\n\r\n/**\r\n * Names of hooks/functions whose return values are considered stable\r\n * (don't need further wrapping in useCallback/useMemo).\r\n */\r\nconst STABLE_INIT_CALLS = new Set([\r\n 'useCallback',\r\n 'useMemo',\r\n 'useRef',\r\n 'useState',\r\n 'useReducer',\r\n 'useContext',\r\n 'useId',\r\n 'useDeferredValue',\r\n 'useTransition',\r\n 'useSyncExternalStore',\r\n 'useActionState',\r\n 'useFormStatus',\r\n 'useOptimistic',\r\n 'StyleSheet.create',\r\n 'Object.freeze',\r\n]);\r\n\r\n/**\r\n * Hooks that should NOT trigger this rule. Includes:\r\n * - React built-in hooks\r\n * - Well-known library hooks that safely handle unstable references\r\n * (they don't put callback arguments into useEffect dependency arrays)\r\n */\r\nconst IGNORED_HOOKS = new Set([\r\n // React built-in\r\n 'useState',\r\n 'useEffect',\r\n 'useLayoutEffect',\r\n 'useCallback',\r\n 'useMemo',\r\n 'useRef',\r\n 'useReducer',\r\n 'useContext',\r\n 'useImperativeHandle',\r\n 'useDebugValue',\r\n 'useId',\r\n 'useDeferredValue',\r\n 'useTransition',\r\n 'useSyncExternalStore',\r\n 'useInsertionEffect',\r\n 'useActionState',\r\n 'useFormStatus',\r\n 'useOptimistic',\r\n 'use',\r\n // Redux - selector runs on every render by design\r\n 'useSelector',\r\n 'useDispatch',\r\n 'useStore',\r\n // React Query / TanStack Query - callbacks are not deps\r\n 'useQuery',\r\n 'useMutation',\r\n 'useInfiniteQuery',\r\n 'useQueryClient',\r\n 'useSuspenseQuery',\r\n 'useSuspenseInfiniteQuery',\r\n 'useQueries',\r\n 'usePrefetchQuery',\r\n 'useIsFetching',\r\n 'useIsMutating',\r\n // React Navigation / Expo Router\r\n 'useNavigation',\r\n 'useRoute',\r\n 'useRouter',\r\n 'usePathname',\r\n 'useSegments',\r\n 'useSearchParams',\r\n 'useLocalSearchParams',\r\n 'useGlobalSearchParams',\r\n 'useFocusEffect',\r\n 'useNavigationState',\r\n // i18next\r\n 'useTranslation',\r\n // Zustand - selector runs on every render\r\n 'useStoreWithEqualityFn',\r\n // React Spring / Animated\r\n 'useSpring',\r\n 'useSprings',\r\n 'useTrail',\r\n 'useChain',\r\n // Syncfusion\r\n 'useDynamicFormStyles',\r\n // React Hook Form - options object is safely handled\r\n 'useForm',\r\n 'useFormContext',\r\n 'useController',\r\n 'useWatch',\r\n 'useFieldArray',\r\n]);\r\n\r\n/**\r\n * Check if a node is an unstable initializer (function, object, or array literal\r\n * NOT wrapped in useCallback/useMemo/other stable call).\r\n */\r\nfunction isUnstableInit(initNode) {\r\n if (!initNode) return null;\r\n\r\n // Arrow functions and function expressions are unstable\r\n if (\r\n initNode.type === 'ArrowFunctionExpression' ||\r\n initNode.type === 'FunctionExpression'\r\n )\r\n return 'function';\r\n\r\n // Object literals are unstable\r\n if (initNode.type === 'ObjectExpression') return 'object';\r\n\r\n // Array literals are unstable\r\n if (initNode.type === 'ArrayExpression') return 'array';\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Check if a call expression is a stable initializer (useCallback, useMemo, etc.)\r\n */\r\nfunction isStableCall(initNode) {\r\n if (initNode.type !== 'CallExpression') return false;\r\n\r\n const callee = initNode.callee;\r\n\r\n // Direct call: useCallback(...), useMemo(...)\r\n if (callee.type === 'Identifier')\r\n return STABLE_INIT_CALLS.has(callee.name);\r\n\r\n // Member expression: StyleSheet.create(...), Object.freeze(...)\r\n if (\r\n callee.type === 'MemberExpression' &&\r\n callee.object.type === 'Identifier' &&\r\n callee.property.type === 'Identifier'\r\n )\r\n return STABLE_INIT_CALLS.has(`${callee.object.name}.${callee.property.name}`);\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Get the callee name from a CallExpression node.\r\n */\r\nfunction getCalleeName(callNode) {\r\n const callee = callNode.callee;\r\n if (callee.type === 'Identifier') return callee.name;\r\n if (\r\n callee.type === 'MemberExpression' &&\r\n callee.object.type === 'Identifier' &&\r\n callee.property.type === 'Identifier'\r\n )\r\n return `${callee.object.name}.${callee.property.name}`;\r\n\r\n return null;\r\n}\r\n\r\n/**\r\n * Check if a function name looks like a custom hook (starts with \"use\" + uppercase).\r\n */\r\nfunction isCustomHookName(name, extraIgnored, patterns) {\r\n if (!name || name.length <= 3 || !name.startsWith('use')) return false;\r\n const charAfterUse = name[3];\r\n const isUpperCase = charAfterUse === charAfterUse.toUpperCase() && charAfterUse !== charAfterUse.toLowerCase();\r\n if (!isUpperCase) return false;\r\n if (IGNORED_HOOKS.has(name)) return false;\r\n if (extraIgnored && extraIgnored.has(name)) return false;\r\n if (patterns && patterns.some((re) => re.test(name))) return false;\r\n return true;\r\n}\r\n\r\n/**\r\n * Check if a node is inside a React component or custom hook (function scope\r\n * where this rule applies).\r\n */\r\nfunction isInsideComponentOrHook(node) {\r\n let current = node.parent;\r\n while (current) {\r\n const isFunction =\r\n current.type === 'FunctionDeclaration' ||\r\n current.type === 'FunctionExpression' ||\r\n current.type === 'ArrowFunctionExpression';\r\n\r\n if (isFunction) {\r\n // Check if it's a component (PascalCase) or hook (use* prefix)\r\n const name = getFunctionName(current);\r\n if (!name) return false;\r\n const isPascalCase = name[0] === name[0].toUpperCase() && name[0] !== name[0].toLowerCase();\r\n const isHook = name.length > 3 && name.startsWith('use');\r\n return isPascalCase || isHook;\r\n }\r\n current = current.parent;\r\n }\r\n return false;\r\n}\r\n\r\n/**\r\n * Get the name of a function node.\r\n */\r\nfunction getFunctionName(funcNode) {\r\n // function Foo() {}\r\n if (funcNode.id) return funcNode.id.name;\r\n\r\n // const Foo = () => {} or const Foo = function() {}\r\n if (\r\n funcNode.parent &&\r\n funcNode.parent.type === 'VariableDeclarator' &&\r\n funcNode.parent.id &&\r\n funcNode.parent.id.type === 'Identifier'\r\n )\r\n return funcNode.parent.id.name;\r\n\r\n return null;\r\n}\r\n\r\nconst requireStableHookArgsRule = {\r\n meta: {\r\n type: 'problem',\r\n docs: {\r\n description:\r\n 'Disallow passing unstable functions/objects/arrays to custom hooks. Wrap in useCallback/useMemo to prevent infinite re-renders.',\r\n category: 'Possible Errors',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n ignoreHooks: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Additional hook names to ignore (e.g., [\"useMyLibraryHook\"])',\r\n },\r\n ignoreHookPatterns: {\r\n type: 'array',\r\n items: { type: 'string' },\r\n description: 'Regex patterns for hook names to ignore (e.g., [\"^useIdentityService\", \"^useQuestionerWeb\"])',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n unstableFunction:\r\n 'Unstable function \"{{name}}\" passed to hook \"{{hook}}\". Wrap in useCallback() to prevent infinite re-renders.',\r\n unstableObject:\r\n 'Unstable object \"{{name}}\" passed to hook \"{{hook}}\". Wrap in useMemo() to prevent infinite re-renders.',\r\n unstableArray:\r\n 'Unstable array \"{{name}}\" passed to hook \"{{hook}}\". Wrap in useMemo() to prevent infinite re-renders.',\r\n unstableInlineFunction:\r\n 'Inline function passed to hook \"{{hook}}\". Extract to a useCallback() variable to prevent infinite re-renders.',\r\n unstableInlineObject:\r\n 'Inline object passed to hook \"{{hook}}\". Extract to a useMemo() variable to prevent infinite re-renders.',\r\n unstableInlineArray:\r\n 'Inline array passed to hook \"{{hook}}\". Extract to a useMemo() variable to prevent infinite re-renders.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const extraIgnored = options.ignoreHooks ? new Set(options.ignoreHooks) : null;\r\n const ignorePatterns = (options.ignoreHookPatterns || []).map((p) => new RegExp(p));\r\n // Track unstable variable declarations: name -> { type, node }\r\n const unstableVars = new Map();\r\n\r\n return {\r\n /**\r\n * Track variable declarations with unstable initializers.\r\n * e.g., const t = (key) => i18nT(key);\r\n */\r\n VariableDeclarator(node) {\r\n if (\r\n !node.id ||\r\n node.id.type !== 'Identifier' ||\r\n !node.init\r\n )\r\n return;\r\n\r\n // Skip if the init is a stable call (useCallback, useMemo, etc.)\r\n if (isStableCall(node.init)) return;\r\n\r\n const unstableType = isUnstableInit(node.init);\r\n if (!unstableType) return;\r\n\r\n // Only track if inside a component or hook\r\n if (!isInsideComponentOrHook(node)) return;\r\n\r\n unstableVars.set(node.id.name, {\r\n type: unstableType,\r\n node: node,\r\n });\r\n },\r\n\r\n /**\r\n * Check call expressions that look like custom hooks.\r\n * Flag any arguments that reference unstable variables or are inline literals.\r\n */\r\n CallExpression(node) {\r\n const hookName = getCalleeName(node);\r\n if (!isCustomHookName(hookName, extraIgnored, ignorePatterns)) return;\r\n if (!isInsideComponentOrHook(node)) return;\r\n\r\n for (const arg of node.arguments) {\r\n // Check identifier arguments against tracked unstable vars\r\n if (arg.type === 'Identifier') {\r\n const tracked = unstableVars.get(arg.name);\r\n if (!tracked) continue;\r\n\r\n const messageMap = {\r\n function: 'unstableFunction',\r\n object: 'unstableObject',\r\n array: 'unstableArray',\r\n };\r\n\r\n context.report({\r\n node: arg,\r\n messageId: messageMap[tracked.type],\r\n data: {\r\n name: arg.name,\r\n hook: hookName,\r\n },\r\n });\r\n continue;\r\n }\r\n\r\n // Check inline unstable arguments (arrow functions, objects, arrays)\r\n const inlineType = isUnstableInit(arg);\r\n if (inlineType) {\r\n const inlineMessageMap = {\r\n function: 'unstableInlineFunction',\r\n object: 'unstableInlineObject',\r\n array: 'unstableInlineArray',\r\n };\r\n\r\n context.report({\r\n node: arg,\r\n messageId: inlineMessageMap[inlineType],\r\n data: { hook: hookName },\r\n });\r\n }\r\n }\r\n },\r\n };\r\n },\r\n};\r\n\r\nexport default {\r\n rules: {\r\n 'require-stable-hook-args': requireStableHookArgsRule,\r\n },\r\n};\r\n","/**\r\n * Custom ESLint Plugin: Smart Max Lines Per Function\r\n *\r\n * Applies different line limits based on function type:\r\n * - React components (functions returning JSX): higher limit (default 200)\r\n * - Regular functions: stricter limit (default 50)\r\n *\r\n * ⚠️ `functionWarn` is NOT a separate \"warning\" severity.\r\n *\r\n * ESLint has no per-report severity: every `context.report()` a rule makes is\r\n * emitted at the severity the *rule* is configured with. So when this rule is\r\n * configured as `'error'` (as every app does), a `functionWarn` report is an\r\n * ERROR too — a `functionWarn: 30` therefore silently turns the documented\r\n * 50-line limit into a hard 30-line limit. That mismatch is exactly what bit\r\n * ES-04, so `functionWarn` is now **opt-in and disabled by default**: out of the\r\n * box the only enforced threshold is `functionMax` (50), which is what the docs\r\n * have always promised.\r\n *\r\n * Set `functionWarn` only if you deliberately want a *second, stricter* hard\r\n * threshold — it reports at the rule's own severity, not at 'warn'.\r\n */\r\n\r\nconst COMPONENT_MAX_DEFAULT = 200;\r\nconst FUNCTION_MAX_DEFAULT = 50;\r\n/** Disabled by default — see the severity note above. */\r\nconst FUNCTION_WARN_DEFAULT = undefined;\r\n\r\n/**\r\n * Check if an AST node is a JSX element or fragment\r\n */\r\nfunction isJSX(node) {\r\n if (!node) {\r\n return false;\r\n }\r\n return (\r\n node.type === 'JSXElement' ||\r\n node.type === 'JSXFragment'\r\n );\r\n}\r\n\r\n/**\r\n * Check if an expression could resolve to JSX\r\n */\r\nfunction expressionReturnsJSX(node) {\r\n if (!node) {\r\n return false;\r\n }\r\n\r\n // Direct JSX\r\n if (isJSX(node)) {\r\n return true;\r\n }\r\n\r\n // Conditional expression: condition ? <A/> : <B/>\r\n if (node.type === 'ConditionalExpression') {\r\n return expressionReturnsJSX(node.consequent) || expressionReturnsJSX(node.alternate);\r\n }\r\n\r\n // Logical expressions: condition && <A/> or condition || <A/>\r\n if (node.type === 'LogicalExpression') {\r\n return expressionReturnsJSX(node.left) || expressionReturnsJSX(node.right);\r\n }\r\n\r\n // Parenthesized expression\r\n if (node.type === 'ParenthesizedExpression') {\r\n return expressionReturnsJSX(node.expression);\r\n }\r\n\r\n // Sequence expression (rare but possible)\r\n if (node.type === 'SequenceExpression') {\r\n const lastExpr = node.expressions[node.expressions.length - 1];\r\n return expressionReturnsJSX(lastExpr);\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Recursively check if a block contains a return statement with JSX\r\n */\r\nfunction blockReturnsJSX(blockBody) {\r\n if (!blockBody || !Array.isArray(blockBody)) {\r\n return false;\r\n }\r\n\r\n for (const statement of blockBody) {\r\n if (statementReturnsJSX(statement)) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Check if a statement returns JSX\r\n */\r\nfunction statementReturnsJSX(statement) {\r\n if (!statement) {\r\n return false;\r\n }\r\n\r\n switch (statement.type) {\r\n case 'ReturnStatement':\r\n return expressionReturnsJSX(statement.argument);\r\n\r\n case 'IfStatement':\r\n // Check consequent\r\n if (statement.consequent) {\r\n if (statement.consequent.type === 'BlockStatement') {\r\n if (blockReturnsJSX(statement.consequent.body)) {\r\n return true;\r\n }\r\n } else if (statementReturnsJSX(statement.consequent)) {\r\n return true;\r\n }\r\n }\r\n // Check alternate (else branch)\r\n if (statement.alternate) {\r\n if (statement.alternate.type === 'BlockStatement') {\r\n if (blockReturnsJSX(statement.alternate.body)) {\r\n return true;\r\n }\r\n } else if (statementReturnsJSX(statement.alternate)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n case 'SwitchStatement':\r\n for (const switchCase of statement.cases) {\r\n if (blockReturnsJSX(switchCase.consequent)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n\r\n case 'TryStatement':\r\n if (statement.block && blockReturnsJSX(statement.block.body)) {\r\n return true;\r\n }\r\n if (statement.handler && statement.handler.body && blockReturnsJSX(statement.handler.body.body)) {\r\n return true;\r\n }\r\n if (statement.finalizer && blockReturnsJSX(statement.finalizer.body)) {\r\n return true;\r\n }\r\n return false;\r\n\r\n case 'BlockStatement':\r\n return blockReturnsJSX(statement.body);\r\n\r\n default:\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Check if a function node is a React component (returns JSX)\r\n */\r\nfunction isReactComponent(node) {\r\n // Arrow function with implicit JSX return: () => <div/>\r\n if (node.type === 'ArrowFunctionExpression') {\r\n if (node.body.type !== 'BlockStatement') {\r\n return expressionReturnsJSX(node.body);\r\n }\r\n }\r\n\r\n // Function with block body - check for JSX returns\r\n const body = node.body;\r\n if (body && body.type === 'BlockStatement') {\r\n return blockReturnsJSX(body.body);\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Count effective lines in a function (optionally skipping blanks/comments)\r\n */\r\nfunction countLines(node, sourceCode, skipBlankLines, skipComments) {\r\n const startLine = node.loc.start.line;\r\n const endLine = node.loc.end.line;\r\n\r\n if (!skipBlankLines && !skipComments) {\r\n return endLine - startLine + 1;\r\n }\r\n\r\n const lines = sourceCode.lines.slice(startLine - 1, endLine);\r\n let count = 0;\r\n\r\n // Get all comments in the function\r\n const allComments = sourceCode.getAllComments();\r\n const functionComments = allComments.filter(\r\n (comment) => comment.loc.start.line >= startLine && comment.loc.end.line <= endLine\r\n );\r\n\r\n // Build a set of line numbers that are purely comment lines\r\n const commentOnlyLines = new Set();\r\n if (skipComments) {\r\n for (const comment of functionComments) {\r\n for (let line = comment.loc.start.line; line <= comment.loc.end.line; line++) {\r\n const lineContent = sourceCode.lines[line - 1];\r\n if (lineContent) {\r\n const trimmed = lineContent.trim();\r\n // Check if line is only a comment (starts with // or /* or * for multiline)\r\n const isOnlyComment =\r\n trimmed.startsWith('//') ||\r\n trimmed.startsWith('/*') ||\r\n trimmed.startsWith('*') ||\r\n trimmed.endsWith('*/') ||\r\n trimmed === '';\r\n if (isOnlyComment) {\r\n commentOnlyLines.add(line);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < lines.length; i++) {\r\n const lineNumber = startLine + i;\r\n const lineContent = lines[i];\r\n\r\n // Skip blank lines\r\n if (skipBlankLines && lineContent.trim() === '') {\r\n continue;\r\n }\r\n\r\n // Skip comment-only lines\r\n if (skipComments && commentOnlyLines.has(lineNumber)) {\r\n continue;\r\n }\r\n\r\n count++;\r\n }\r\n\r\n return count;\r\n}\r\n\r\n/**\r\n * The ESLint rule definition\r\n */\r\nconst smartMaxLinesRule = {\r\n meta: {\r\n type: 'suggestion',\r\n docs: {\r\n description:\r\n 'Enforce different line limits for React components vs regular functions',\r\n category: 'Best Practices',\r\n recommended: true,\r\n },\r\n schema: [\r\n {\r\n type: 'object',\r\n properties: {\r\n componentMax: {\r\n type: 'integer',\r\n minimum: 1,\r\n description: 'Maximum lines for React components',\r\n },\r\n functionMax: {\r\n type: 'integer',\r\n minimum: 1,\r\n description: 'Maximum lines for regular functions (error threshold)',\r\n },\r\n functionWarn: {\r\n type: 'integer',\r\n minimum: 1,\r\n description:\r\n 'Optional SECOND, stricter threshold for regular functions. Disabled by default. ' +\r\n 'Reports at the severity the rule is configured with (ESLint has no per-report ' +\r\n 'severity) — it is NOT a \"warning\" tier.',\r\n },\r\n skipBlankLines: {\r\n type: 'boolean',\r\n description: 'Skip blank lines when counting',\r\n },\r\n skipComments: {\r\n type: 'boolean',\r\n description: 'Skip comment lines when counting',\r\n },\r\n },\r\n additionalProperties: false,\r\n },\r\n ],\r\n messages: {\r\n componentTooLong:\r\n 'React component has too many lines ({{count}}). Maximum allowed is {{max}}.',\r\n functionTooLong:\r\n 'Function has too many lines ({{count}}). Maximum allowed is {{max}}.',\r\n functionWarning:\r\n 'Function has {{count}} lines, over the configured stricter limit of {{warn}}. Consider refactoring.',\r\n },\r\n },\r\n\r\n create(context) {\r\n const options = context.options[0] || {};\r\n const componentMax = options.componentMax ?? COMPONENT_MAX_DEFAULT;\r\n const functionMax = options.functionMax ?? FUNCTION_MAX_DEFAULT;\r\n const functionWarn = options.functionWarn ?? FUNCTION_WARN_DEFAULT;\r\n const skipBlankLines = options.skipBlankLines ?? true;\r\n const skipComments = options.skipComments ?? true;\r\n\r\n const sourceCode = context.sourceCode || context.getSourceCode();\r\n\r\n function checkFunction(node) {\r\n const lineCount = countLines(node, sourceCode, skipBlankLines, skipComments);\r\n const isComponent = isReactComponent(node);\r\n\r\n if (isComponent) {\r\n // React component - apply componentMax limit\r\n if (lineCount > componentMax) {\r\n context.report({\r\n node,\r\n messageId: 'componentTooLong',\r\n data: {\r\n count: String(lineCount),\r\n max: String(componentMax),\r\n },\r\n });\r\n }\r\n } else {\r\n // Regular function - apply functionMax (error) and functionWarn (warning)\r\n if (lineCount > functionMax) {\r\n context.report({\r\n node,\r\n messageId: 'functionTooLong',\r\n data: {\r\n count: String(lineCount),\r\n max: String(functionMax),\r\n },\r\n });\r\n } else if (functionWarn !== undefined && lineCount > functionWarn) {\r\n context.report({\r\n node,\r\n messageId: 'functionWarning',\r\n data: {\r\n count: String(lineCount),\r\n warn: String(functionWarn),\r\n },\r\n });\r\n }\r\n }\r\n }\r\n\r\n return {\r\n FunctionDeclaration: checkFunction,\r\n FunctionExpression: checkFunction,\r\n ArrowFunctionExpression: checkFunction,\r\n };\r\n },\r\n};\r\n\r\n/**\r\n * Export the plugin\r\n */\r\nexport default {\r\n rules: {\r\n 'smart-max-lines': smartMaxLinesRule,\r\n },\r\n};\r\n","import type { CustomRule, FlatConfigPlugin, SingleRulePlugin } from './types';\n\n// The 17 shared custom rules (byte-for-byte the rule logic that lived in\n// erevna-web / katalogos-web `eslint-plugins/*.mjs`). Each module\n// default-exports `{ rules: { '<name>': rule } }`.\nimport docCommentMaxLines from '../rules/doc-comment-max-lines.js';\nimport docCommentPublicOnly from '../rules/doc-comment-public-only.js';\nimport enforceFunctionStyle from '../rules/enforce-function-style.js';\nimport enforceModuleStructure from '../rules/enforce-module-structure.js';\nimport enforceRoutePreload from '../rules/enforce-route-preload.js';\nimport enforceTestColocation from '../rules/enforce-test-colocation.js';\nimport enumFileIsolation from '../rules/enum-file-isolation.js';\nimport i18nInterpolation from '../rules/i18n-interpolation.js';\nimport i18nParamNames from '../rules/i18n-param-names.js';\nimport noComments from '../rules/no-comments.js';\nimport noBarrelCompanionFile from '../rules/no-barrel-companion-file.js';\nimport noDuplicateNavPrefix from '../rules/no-duplicate-nav-prefix.js';\nimport noDuplicateSharedPatterns from '../rules/no-duplicate-shared-patterns.js';\nimport noGeneratedModelsBarrelValueImport from '../rules/no-generated-models-barrel-value-import.js';\nimport noNullCheck from '../rules/no-null-check.js';\nimport noOptionalUndefined from '../rules/no-optional-undefined.js';\nimport noProductImportsInShared from '../rules/no-product-imports-in-shared.js';\nimport noRawColorLiteral from '../rules/no-raw-color-literal.js';\nimport preferConstEnum from '../rules/prefer-const-enum.js';\nimport requireStableHookArgs from '../rules/require-stable-hook-args.js';\nimport smartMaxLines from '../rules/smart-max-lines.js';\n\n// Package version — kept in sync with package.json by the publish flow.\nconst PLUGIN_VERSION = '1.0.0';\n\nconst ruleModules: readonly SingleRulePlugin[] = [\n docCommentMaxLines,\n docCommentPublicOnly,\n enforceFunctionStyle,\n enforceModuleStructure,\n enforceRoutePreload,\n enforceTestColocation,\n enumFileIsolation,\n i18nInterpolation,\n i18nParamNames,\n noBarrelCompanionFile,\n noComments,\n noDuplicateNavPrefix,\n noDuplicateSharedPatterns,\n noGeneratedModelsBarrelValueImport,\n noNullCheck,\n noOptionalUndefined,\n noProductImportsInShared,\n noRawColorLiteral,\n preferConstEnum,\n requireStableHookArgs,\n smartMaxLines,\n];\n\nfunction mergeRules(modules: readonly SingleRulePlugin[]): Record<string, CustomRule> {\n const merged: Record<string, CustomRule> = {};\n for (const mod of modules) {\n for (const [name, rule] of Object.entries(mod.rules)) {\n if (merged[name] !== undefined) {\n throw new Error(`Duplicate ESLint rule name: \"${name}\"`);\n }\n merged[name] = rule;\n }\n }\n\n return merged;\n}\n\n/**\n * The flat-config plugin object. Register it under a namespace in the app's\n * `eslint.config.mjs`:\n *\n * ```js\n * import { plugin as devtools } from '@dloizides/frontend-devtools/eslint';\n * export default [{ plugins: { '@dloizides': devtools }, rules: {\n * '@dloizides/no-null-check': 'error',\n * } }];\n * ```\n */\nexport const plugin: FlatConfigPlugin = {\n meta: { name: '@dloizides/frontend-devtools', version: PLUGIN_VERSION },\n rules: mergeRules(ruleModules),\n};\n\n/**\n * The merged rule map alone (the same `Record<name, rule>` that the apps used to\n * spread from 17 separate `eslint-plugins/*.mjs` files).\n */\nexport const rules: Record<string, CustomRule> = plugin.rules;\n\n/**\n * The list of rule names this plugin provides. Useful for migration assertions\n * (prove no rule was dropped vs. the old 17 local files).\n */\nexport const ruleNames: readonly string[] = Object.keys(plugin.rules).sort();\n","import type { CustomRule, FlatConfigPlugin } from './types';\n\nimport { rules } from './plugin';\n\n/**\n * The apps historically registered each custom rule under a namespace EQUAL to\n * its rule name, e.g. `plugins: { 'no-null-check': plugin }` with the rule keyed\n * as `'no-null-check/no-null-check'`. Inline `eslint-disable-next-line\n * no-null-check/no-null-check` comments and config keys depend on that exact\n * `<name>/<name>` shape.\n *\n * To migrate WITHOUT changing a single config key or disable comment, the app\n * spreads {@link legacyPlugins} into its flat config's `plugins` map. Each rule\n * name maps to a one-rule plugin object holding that rule — reproducing the old\n * `import xPlugin from './eslint-plugins/x.mjs'` registration byte-for-byte.\n *\n * ```js\n * import { legacyPlugins } from '@dloizides/frontend-devtools/eslint';\n * export default [{\n * plugins: { ...legacyPlugins },\n * rules: {\n * 'no-null-check/no-null-check': 'error', // unchanged\n * 'smart-max-lines/smart-max-lines': ['error', { functionMax: 50 }],\n * },\n * }];\n * ```\n */\nexport const legacyPlugins: Record<string, FlatConfigPlugin> = buildLegacyPlugins();\n\nfunction buildLegacyPlugins(): Record<string, FlatConfigPlugin> {\n const out: Record<string, FlatConfigPlugin> = {};\n for (const [name, rule] of Object.entries(rules)) {\n out[name] = oneRulePlugin(name, rule);\n }\n\n return out;\n}\n\nfunction oneRulePlugin(name: string, rule: CustomRule): FlatConfigPlugin {\n return {\n meta: { name, version: '1.0.0' },\n rules: { [name]: rule },\n };\n}\n","import type { FlatConfig } from './types';\n\nimport { plugin } from './plugin';\n\nconst DOC_COMMENT_MAX_LINES = 3;\n\nexport const COMMENT_RULE_NAMES: readonly string[] = [\n 'no-comments',\n 'doc-comment-public-only',\n 'doc-comment-max-lines',\n];\n\n/** Flat-config block for COMMENTS-1: no code comments, short doc comments on public members only. */\nexport const commentsConfig: FlatConfig = {\n plugins: { '@dloizides': plugin as unknown as NonNullable<FlatConfig['plugins']>[string] },\n rules: {\n '@dloizides/no-comments': 'error',\n '@dloizides/doc-comment-public-only': 'error',\n '@dloizides/doc-comment-max-lines': ['error', { max: DOC_COMMENT_MAX_LINES }],\n },\n};\n"]}