@cerios/sparta-lint-rules 0.0.1 → 0.0.3
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.
- package/LICENSE +7 -7
- package/README.md +87 -40
- package/dist/conventions-DK3A7JWL.d.cts +97 -0
- package/dist/conventions-DK3A7JWL.d.mts +97 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.mts +16 -2
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/oxlint.cjs +2 -1
- package/dist/oxlint.cjs.map +1 -1
- package/dist/oxlint.d.cts +18 -1
- package/dist/oxlint.d.mts +19 -2
- package/dist/oxlint.mjs +2 -1
- package/dist/oxlint.mjs.map +1 -1
- package/dist/{plugin-types-CgeW0cQl.d.cts → plugin-types-7QJakt0Z.d.cts} +10 -4
- package/dist/{plugin-types-CgeW0cQl.d.mts → plugin-types-7QJakt0Z.d.mts} +10 -4
- package/dist/{rules-COk7kmEU.cjs → rules-5VZcw4ds.cjs} +868 -175
- package/dist/rules-5VZcw4ds.cjs.map +1 -0
- package/dist/{rules-BSRYNh4F.mjs → rules-Ay2ZlXtg.mjs} +868 -175
- package/dist/rules-Ay2ZlXtg.mjs.map +1 -0
- package/dist/settings.cjs +1 -0
- package/dist/settings.d.cts +5 -92
- package/dist/settings.d.mts +5 -92
- package/dist/settings.mjs +1 -0
- package/oxlintrc.schema.json +718 -0
- package/package.json +10 -3
- package/dist/rules-BSRYNh4F.mjs.map +0 -1
- package/dist/rules-COk7kmEU.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rules-COk7kmEU.cjs","names":["path","path","existsSync","rule","rule","path","rule","rule","path","BLANK_LINE","rule","rule","rule","rule","memberName","isFunction","memberName","statSync","parseSync","readFileSync","path","rule","rule","rule","rule","architectureBoundaries","classMatchesFilename","expectFromSupport","fileNaming","linesBetweenClassMembers","noDirectConstructionInTests","noExpectInTests","noHardWaits","noNestedPolling","paddingLines","privateMembersLast","stepPlaceholders","stepRequired"],"sources":["../src/utils/ast.ts","../src/utils/docs.ts","../src/utils/conventions.ts","../src/utils/sparta-paths.ts","../src/utils/settings.ts","../src/rules/architecture-boundaries.ts","../src/rules/class-matches-filename.ts","../src/rules/expect-from-support.ts","../src/rules/file-naming.ts","../src/rules/lines-between-class-members.ts","../src/rules/no-direct-construction-in-tests.ts","../src/rules/no-expect-in-tests.ts","../src/rules/no-hard-waits.ts","../src/utils/polling.ts","../src/utils/project-index.ts","../src/rules/no-nested-polling.ts","../src/rules/padding-lines.ts","../src/rules/private-members-last.ts","../src/rules/step-placeholders.ts","../src/rules/step-required.ts","../src/rules/index.ts"],"sourcesContent":["import type { AstNode, NodeOfType } from \"./types\";\n\nexport const isIdentifier = (node: AstNode | null | undefined, name: string): boolean =>\n\tnode?.type === \"Identifier\" && node.name === name;\n\n/** The value of a string literal node, or `undefined` for any other node. */\nexport const stringValue = (node: AstNode | null | undefined): string | undefined =>\n\tnode?.type === \"Literal\" && typeof node.value === \"string\" ? node.value : undefined;\n\n/** True for `@step` and `@step(\"...\")` decorators, or any of the given decorator `names`. */\nexport const isStepDecorator = (decorator: NodeOfType<\"Decorator\">, names: ReadonlySet<string>): boolean => {\n\tconst { expression } = decorator;\n\tconst callee = expression.type === \"CallExpression\" ? expression.callee : expression;\n\n\treturn callee.type === \"Identifier\" && names.has(callee.name);\n};\n","const REPOSITORY = \"https://github.com/CeriosTesting/sparta-lint-rules\";\n\nexport const docsUrl = (ruleName: string): string => `${REPOSITORY}/blob/main/docs/rules/${ruleName}.md`;\n","import path from \"node:path\";\n\n/**\n * The names a SPARTA project uses, and how `settings.sparta` extends them.\n *\n * Settings describe a project; they never relax the rules. A setting either maps a project's own name onto an\n * existing SPARTA concept (so it gets all of that concept's checks) or adds names to detect (which only makes the\n * rules stricter). Switching checks off is left to the linter config, where it stays visible.\n */\n\nexport type Area = \"api\" | \"database\" | \"mobile\" | \"ui\";\n\n/** A top-level SPARTA folder that aliases can point to. */\nexport type TopFolder = \"sparta\" | \"tests\";\n\n/** The standard layer folders, with the layer the architecture rules know them as and their file name suffix. */\nexport const LAYER_FOLDERS = {\n\tasserters: { layer: \"asserter\", suffix: \"asserter\" },\n\tbuilders: { layer: \"builder\", suffix: \"builder\" },\n\tclients: { layer: \"client\", suffix: \"client\" },\n\tcomponents: { layer: \"component\", suffix: \"component\" },\n\tcontainers: { layer: \"container\" },\n\tdatabases: { layer: \"database\" },\n\tdirectors: { layer: \"director\", suffix: \"director\" },\n\tfactories: { suffix: \"factory\" },\n\tpages: { layer: \"page\", suffix: \"page\" },\n\trepositories: { layer: \"repository\", suffix: \"repository\" },\n\tscenarios: { layer: \"scenario\", suffix: \"scenario\" },\n\tscreens: { layer: \"screen\", suffix: \"screen\" },\n\tservices: { layer: \"service\", suffix: \"service\" },\n\tsteppers: { layer: \"stepper\", suffix: \"stepper\" },\n} as const satisfies Record<string, { layer?: string; suffix?: string }>;\n\nexport type LayerFolder = keyof typeof LAYER_FOLDERS;\n\nconst AREAS: readonly Area[] = [\"api\", \"database\", \"mobile\", \"ui\"];\n\n/** Folders directly below the sparta folder that are not areas. */\nconst TOP_LEVEL_FOLDERS = [\"common\", \"fixtures\", \"scenarios\", \"support\"];\n\nconst POLLING_METHODS = [\"toPass\", \"toPassAndReturn\", \"poll\", \"pollAndReturn\"];\n\n/** Settings accepted under `settings.sparta`. Every key is optional; the defaults are the SPARTA standard. */\nexport type SpartaSettings = {\n\t/** Project root that the aliases resolve against. Default: the nearest folder with a `package.json`. */\n\troot?: string;\n\t/** Names of the top-level folders. Default: `{ sparta: \"sparta\", tests: \"tests\" }`. */\n\tfolders?: { sparta?: string; tests?: string };\n\t/** Extra area folders, mapped to the standard area they follow, e.g. `{ web: \"ui\" }`. */\n\tareas?: Record<string, Area>;\n\t/** Extra layer folders, mapped to the standard layer folder they follow, e.g. `{ \"page-objects\": \"pages\" }`. */\n\tlayers?: Record<string, LayerFolder>;\n\t/** Extra path aliases, mapped to the top-level folder they point to, e.g. `{ \"@app/*\": \"sparta\" }`. */\n\taliases?: Record<string, TopFolder>;\n\t/** The module `expect` must be imported from inside the sparta folder. Default: `@sparta/support`. */\n\tsupportModule?: string;\n\t/** Extra retrying methods, added to `toPass`, `toPassAndReturn`, `poll` and `pollAndReturn`. */\n\tpollingMethods?: string[];\n\t/** Extra step decorators, added to `step`. */\n\tstepDecorators?: string[];\n\t/** Extra assertion functions that tests must not call, added to `expect` and `expectly…`. */\n\texpectNames?: string[];\n};\n\n/** Resolved, validated settings, with the patterns the rules match file paths against. */\nexport interface Conventions {\n\t/** Identifies these conventions, for caches. */\n\tkey: string;\n\t/** Explicit project root (`settings.sparta.root`), or `undefined` to detect it per file. */\n\troot?: string;\n\tspartaFolder: string;\n\ttestsFolder: string;\n\tareas: ReadonlyMap<string, Area>;\n\tlayerFolders: ReadonlyMap<string, LayerFolder>;\n\t/** Alias prefixes (ending in `/`), longest first. */\n\taliases: readonly (readonly [prefix: string, target: TopFolder])[];\n\tsupportModule: string;\n\tpollingMethods: ReadonlySet<string>;\n\tstepDecorators: ReadonlySet<string>;\n\texpectNames: ReadonlySet<string>;\n\tpatterns: {\n\t\t/** `/<sparta>/<area>/<group>[/<folder>]`. */\n\t\tarea: RegExp;\n\t\t/** `/<sparta>/<area>/<group>/<folder>/`, capturing the folder. */\n\t\tlayer: RegExp;\n\t\t/** `/<sparta>/<common|fixtures|scenarios|support>/`. */\n\t\ttop: RegExp;\n\t\t/** `/<sparta>/` or `/<tests>/`. */\n\t\tchecked: RegExp;\n\t\tsparta: RegExp;\n\t\ttests: RegExp;\n\t\tframework: RegExp;\n\t};\n}\n\nconst PREFIX = \"[@cerios/sparta-lint-rules]\";\n\nclass SettingsError extends Error {\n\tconstructor(where: string, problem: string) {\n\t\tsuper(`${PREFIX} settings.sparta${where}: ${problem}`);\n\t\tthis.name = \"SettingsError\";\n\t}\n}\n\nconst escape = (value: string): string => value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\nconst distance = (a: string, b: string): number => {\n\tlet previous = Array.from({ length: b.length + 1 }, (_, index) => index);\n\n\tfor (let i = 1; i <= a.length; i++) {\n\t\tconst current = [i];\n\n\t\tfor (let j = 1; j <= b.length; j++) {\n\t\t\tcurrent[j] = Math.min(previous[j] + 1, current[j - 1] + 1, previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));\n\t\t}\n\n\t\tprevious = current;\n\t}\n\n\treturn previous[b.length];\n};\n\n/** `; did you mean \"x\"?` for the closest candidate, if it is close enough to be a typo. */\nconst suggest = (value: string, candidates: readonly string[]): string => {\n\tconst [best] = candidates\n\t\t.map(candidate => ({ candidate, score: distance(value.toLowerCase(), candidate.toLowerCase()) }))\n\t\t.toSorted((a, b) => a.score - b.score);\n\n\treturn best && best.score <= Math.max(2, Math.floor(best.candidate.length / 3))\n\t\t? `; did you mean ${JSON.stringify(best.candidate)}?`\n\t\t: \"\";\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === \"object\" && value !== null && !Array.isArray(value);\n\nfunction record(value: unknown, where: string): Record<string, unknown> {\n\tif (!isRecord(value)) throw new SettingsError(where, `must be an object, got ${JSON.stringify(value)}.`);\n\n\treturn value;\n}\n\nfunction checkKeys(value: Record<string, unknown>, allowed: readonly string[], where: string): void {\n\tfor (const key of Object.keys(value)) {\n\t\tif (!allowed.includes(key)) {\n\t\t\tthrow new SettingsError(where, `unknown setting ${JSON.stringify(key)}${suggest(key, allowed)}`);\n\t\t}\n\t}\n}\n\nfunction nonEmptyString(value: unknown, where: string): string {\n\tif (typeof value !== \"string\" || value.trim() === \"\") {\n\t\tthrow new SettingsError(where, `must be a non-empty string, got ${JSON.stringify(value)}.`);\n\t}\n\n\treturn value;\n}\n\nfunction folderName(value: unknown, where: string): string {\n\tconst name = nonEmptyString(value, where);\n\n\tif (/[/\\\\]/.test(name) || name === \".\" || name === \"..\") {\n\t\tthrow new SettingsError(where, `must be a single folder name, got ${JSON.stringify(name)}.`);\n\t}\n\n\treturn name;\n}\n\nfunction identifiers(value: unknown, where: string): string[] {\n\tif (!Array.isArray(value)) throw new SettingsError(where, `must be an array of names, got ${JSON.stringify(value)}.`);\n\n\treturn value.map((item, index) => {\n\t\tconst name = nonEmptyString(item, `${where}[${index}]`);\n\n\t\tif (!/^[A-Za-z_$][\\w$]*$/.test(name)) {\n\t\t\tthrow new SettingsError(`${where}[${index}]`, `must be an identifier, got ${JSON.stringify(name)}.`);\n\t\t}\n\n\t\treturn name;\n\t});\n}\n\n/**\n * Maps the project's own names onto standard ones. A name that is already standard may only map onto itself,\n * and `reserved` names may not be used at all, so a setting can never turn one concept into another.\n */\nfunction mapping<T extends string>(\n\tvalue: unknown,\n\twhere: string,\n\ttargets: readonly T[],\n\tdescribe: string,\n\treserved: readonly string[] = []\n): Map<string, T> {\n\tconst result = new Map<string, T>();\n\n\tfor (const [name, target] of Object.entries(record(value, where))) {\n\t\tconst at = `${where}.${name}`;\n\n\t\tfolderName(name, at);\n\n\t\tif (typeof target !== \"string\" || !(targets as readonly string[]).includes(target)) {\n\t\t\tthrow new SettingsError(\n\t\t\t\tat,\n\t\t\t\t`unknown ${describe} ${JSON.stringify(target)}${typeof target === \"string\" ? suggest(target, targets) : \"\"}. Use one of: ${targets.join(\", \")}.`\n\t\t\t);\n\t\t}\n\n\t\tif ((targets as readonly string[]).includes(name) && name !== target) {\n\t\t\tthrow new SettingsError(\n\t\t\t\tat,\n\t\t\t\t`${JSON.stringify(name)} is already the standard ${describe} ${JSON.stringify(name)}.`\n\t\t\t);\n\t\t}\n\n\t\tif (reserved.includes(name)) {\n\t\t\tthrow new SettingsError(at, `${JSON.stringify(name)} is a reserved SPARTA folder.`);\n\t\t}\n\n\t\tresult.set(name, target as T);\n\t}\n\n\treturn result;\n}\n\n/** `@app/*`, `@app/` and `@app` all become the prefix `@app/`. */\nfunction aliasPrefix(alias: string, where: string): string {\n\tconst prefix = `${alias.replace(/\\/?\\*?$/, \"\")}/`;\n\n\tif (prefix === \"/\" || alias.startsWith(\".\") || alias.startsWith(\"/\")) {\n\t\tthrow new SettingsError(where, `must be an alias such as \"@app/*\", got ${JSON.stringify(alias)}.`);\n\t}\n\n\treturn prefix;\n}\n\nconst SETTINGS_KEYS: readonly (keyof SpartaSettings)[] = [\n\t\"root\",\n\t\"folders\",\n\t\"areas\",\n\t\"layers\",\n\t\"aliases\",\n\t\"supportModule\",\n\t\"pollingMethods\",\n\t\"stepDecorators\",\n\t\"expectNames\",\n];\n\nfunction parseFolders(value: unknown): { spartaFolder: string; testsFolder: string } {\n\tconst folders = value === undefined ? {} : record(value, \".folders\");\n\n\tcheckKeys(folders, [\"sparta\", \"tests\"], \".folders\");\n\n\tconst spartaFolder = folders.sparta === undefined ? \"sparta\" : folderName(folders.sparta, \".folders.sparta\");\n\tconst testsFolder = folders.tests === undefined ? \"tests\" : folderName(folders.tests, \".folders.tests\");\n\n\tif (spartaFolder === testsFolder) {\n\t\tthrow new SettingsError(\n\t\t\t\".folders\",\n\t\t\t`sparta and tests must be different folders, both are ${JSON.stringify(spartaFolder)}.`\n\t\t);\n\t}\n\n\treturn { spartaFolder, testsFolder };\n}\n\n/** The standard names, each mapped onto itself, plus the project's own names. */\nfunction withStandard<T extends string>(standard: readonly T[], custom: Map<string, T> | undefined): Map<string, T> {\n\treturn new Map<string, T>([...standard.map(name => [name, name] as const), ...(custom ?? [])]);\n}\n\nfunction parseAliases(value: unknown): Map<string, TopFolder> {\n\tconst aliases = new Map<string, TopFolder>([\n\t\t[\"@sparta/\", \"sparta\"],\n\t\t[\"@tests/\", \"tests\"],\n\t]);\n\n\tif (value === undefined) return aliases;\n\n\tfor (const [alias, target] of Object.entries(record(value, \".aliases\"))) {\n\t\tconst at = `.aliases.${alias}`;\n\t\tconst prefix = aliasPrefix(alias, at);\n\n\t\tif (target !== \"sparta\" && target !== \"tests\") {\n\t\t\tthrow new SettingsError(at, `must point to \"sparta\" or \"tests\", got ${JSON.stringify(target)}.`);\n\t\t}\n\n\t\tif (aliases.has(prefix) && aliases.get(prefix) !== target) {\n\t\t\tthrow new SettingsError(at, `${JSON.stringify(alias)} already points to ${JSON.stringify(aliases.get(prefix))}.`);\n\t\t}\n\n\t\taliases.set(prefix, target);\n\t}\n\n\treturn aliases;\n}\n\n/** The default names plus the configured extra ones. */\nconst withExtra = (defaults: readonly string[], value: unknown, where: string): Set<string> =>\n\tnew Set([...defaults, ...(value === undefined ? [] : identifiers(value, where))]);\n\nfunction buildPatterns(\n\tspartaFolder: string,\n\ttestsFolder: string,\n\tareas: ReadonlyMap<string, Area>\n): Conventions[\"patterns\"] {\n\tconst sparta = escape(spartaFolder);\n\tconst tests = escape(testsFolder);\n\tconst areaNames = [...areas.keys()].map(escape).join(\"|\");\n\n\treturn {\n\t\tarea: new RegExp(`/${sparta}/(${areaNames})/([^/]+)(?:/([^/]+))?`),\n\t\tlayer: new RegExp(`/${sparta}/(?:${areaNames})/[^/]+/([^/]+)/`),\n\t\ttop: new RegExp(`/${sparta}/(${TOP_LEVEL_FOLDERS.join(\"|\")})/`),\n\t\tchecked: new RegExp(`/(?:${sparta}|${tests})/`),\n\t\tsparta: new RegExp(`/${sparta}/`),\n\t\ttests: new RegExp(`/${tests}/`),\n\t\tframework: new RegExp(`/${tests}/framework/`),\n\t};\n}\n\nconst STANDARD_LAYER_FOLDERS = Object.keys(LAYER_FOLDERS) as LayerFolder[];\n\n/**\n * Validates `settings.sparta` and resolves it against the defaults. Throws a descriptive error for anything it\n * does not understand, so a typo cannot silently weaken the checks. A relative `root` resolves against `cwd`.\n */\nexport function parseSettings(raw: unknown, cwd: string): Conventions {\n\tconst settings = raw === undefined || raw === null ? {} : record(raw, \"\");\n\n\tcheckKeys(settings, SETTINGS_KEYS, \"\");\n\n\tconst root =\n\t\tsettings.root === undefined\n\t\t\t? undefined\n\t\t\t: path.resolve(cwd, nonEmptyString(settings.root, \".root\")).split(\"\\\\\").join(\"/\");\n\tconst { spartaFolder, testsFolder } = parseFolders(settings.folders);\n\tconst areas = withStandard(\n\t\tAREAS,\n\t\tsettings.areas === undefined ? undefined : mapping(settings.areas, \".areas\", AREAS, \"area\", TOP_LEVEL_FOLDERS)\n\t);\n\tconst layerFolders = withStandard(\n\t\tSTANDARD_LAYER_FOLDERS,\n\t\tsettings.layers === undefined\n\t\t\t? undefined\n\t\t\t: mapping(settings.layers, \".layers\", STANDARD_LAYER_FOLDERS, \"layer folder\", [\"common\"])\n\t);\n\n\treturn {\n\t\tkey: JSON.stringify(raw ?? null) + (root ?? \"\"),\n\t\troot,\n\t\tspartaFolder,\n\t\ttestsFolder,\n\t\tareas,\n\t\tlayerFolders,\n\t\taliases: [...parseAliases(settings.aliases)].toSorted(([a], [b]) => b.length - a.length),\n\t\tsupportModule:\n\t\t\tsettings.supportModule === undefined\n\t\t\t\t? \"@sparta/support\"\n\t\t\t\t: nonEmptyString(settings.supportModule, \".supportModule\"),\n\t\tpollingMethods: withExtra(POLLING_METHODS, settings.pollingMethods, \".pollingMethods\"),\n\t\tstepDecorators: withExtra([\"step\"], settings.stepDecorators, \".stepDecorators\"),\n\t\texpectNames: withExtra([], settings.expectNames, \".expectNames\"),\n\t\tpatterns: buildPatterns(spartaFolder, testsFolder, areas),\n\t};\n}\n\n/** The SPARTA standard, for code that runs without a linter context. */\nexport const DEFAULT_CONVENTIONS: Conventions = parseSettings(undefined, process.cwd());\n","import { existsSync } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { LAYER_FOLDERS } from \"./conventions\";\nimport type { Area, Conventions, LayerFolder } from \"./conventions\";\n\nexport type { Area } from \"./conventions\";\n\n/**\n * File classification for the SPARTA folder conventions (names shown with their defaults; see `conventions.ts`):\n *\n * - `sparta/{api,database,mobile,ui}/<group>/<layer folder>/` holds the layers of one group.\n * - `sparta/{api,database,mobile,ui}/common/` is shared within an area.\n * - `mobile` is structured like `ui`, with `screens/` in place of `pages/`.\n * - `sparta/scenarios/`, `sparta/fixtures/`, `sparta/common/` and `sparta/support/` are top level.\n * - `tests/` holds the tests, except `tests/framework/`, which is never checked.\n * - `@sparta/*` and `@tests/*` are path aliases for `<root>/sparta/` and `<root>/tests/`, where the root is the\n * nearest folder with a `package.json`, or `settings.sparta.root` when that is set.\n */\n\nexport type Kind = \"group\" | \"area-common\" | \"top-scenario\" | \"fixture\" | \"shared\" | \"test\";\n\nexport interface FileInfo {\n\tkind: Kind;\n\t/** The standard area the file's area follows, which decides the layer rules. */\n\tarea?: Area;\n\t/** The area folder as it appears in the project, which decides isolation. */\n\tareaFolder?: string;\n\tgroup?: string;\n\tlayer?: string;\n}\n\nexport const normalize = (value: string): string => value.split(\"\\\\\").join(\"/\");\n\nconst TOP_LEVEL_KINDS: Record<string, Kind> = { fixtures: \"fixture\", scenarios: \"top-scenario\" };\n\n/** The standard layer folder that a project's folder name follows, if any. */\nconst standardFolder = (conventions: Conventions, folder: string | undefined): LayerFolder | undefined =>\n\tfolder === undefined ? undefined : conventions.layerFolders.get(folder);\n\nconst caseInsensitivePaths = process.platform === \"win32\";\n\n/**\n * The part of `filename` below the project `root`, with a leading `/` (`/sparta/ui/...`), or `undefined` for files\n * outside the root. Only this part is matched against the SPARTA folder names, so folders above the project (such\n * as a checkout inside a folder named `tests`) never change how a file is classified.\n */\nexport function projectPath(filename: string, root: string): string | undefined {\n\tconst file = normalize(filename);\n\tconst base = normalize(root).replace(/\\/$/, \"\");\n\tconst prefix = file.slice(0, base.length);\n\tconst inRoot = caseInsensitivePaths ? prefix.toLowerCase() === base.toLowerCase() : prefix === base;\n\n\treturn inRoot && file[base.length] === \"/\" ? file.slice(base.length) : undefined;\n}\n\n/** What a file is in the SPARTA architecture, judged by its path below `root`. */\nexport function classify(filename: string, conventions: Conventions, root: string): FileInfo | undefined {\n\tconst file = projectPath(filename, root);\n\tconst { patterns } = conventions;\n\n\tif (file === undefined || patterns.framework.test(file)) return undefined;\n\tif (patterns.tests.test(file)) return { kind: \"test\" };\n\n\tconst area = file.match(patterns.area);\n\n\tif (area) {\n\t\tconst [, areaName, group, folder] = area;\n\t\tconst base = file.match(/-base-(client|repository|service)(?:\\.[cm]?[jt]s)?$/)?.[1];\n\t\tconst standard = standardFolder(conventions, folder);\n\t\tconst layer = base\n\t\t\t? `base-${base}`\n\t\t\t: standard === undefined\n\t\t\t\t? undefined\n\t\t\t\t: (LAYER_FOLDERS[standard] as { layer?: string }).layer;\n\n\t\treturn {\n\t\t\tkind: group === \"common\" ? \"area-common\" : \"group\",\n\t\t\tarea: conventions.areas.get(areaName),\n\t\t\tareaFolder: areaName,\n\t\t\tgroup,\n\t\t\tlayer,\n\t\t};\n\t}\n\n\tconst top = file.match(patterns.top)?.[1];\n\n\treturn top ? { kind: TOP_LEVEL_KINDS[top] ?? \"shared\" } : undefined;\n}\n\n/** Project root per directory, kept for the lifetime of the linter process. */\nconst rootCache = new Map<string, string>();\n\n/**\n * The project root of a file: the nearest directory, from the file upwards, that contains a `package.json`.\n * Falls back to the working directory when there is none.\n */\nexport function projectRoot(filename: string): string {\n\tconst visited: string[] = [];\n\tlet root: string | undefined;\n\n\tfor (let dir = path.dirname(path.resolve(filename)); ;) {\n\t\troot = rootCache.get(dir);\n\t\tif (root !== undefined) break;\n\n\t\tvisited.push(dir);\n\n\t\tif (existsSync(path.join(dir, \"package.json\"))) {\n\t\t\troot = normalize(dir);\n\t\t\tbreak;\n\t\t}\n\n\t\tconst parent = path.dirname(dir);\n\n\t\tif (parent === dir) {\n\t\t\troot = normalize(process.cwd());\n\t\t\tbreak;\n\t\t}\n\n\t\tdir = parent;\n\t}\n\n\tfor (const dir of visited) rootCache.set(dir, root);\n\n\treturn root;\n}\n\n/**\n * Resolves a relative or aliased import (`@sparta/*`, `@tests/*` and `settings.sparta.aliases`) to an absolute,\n * normalized path. Other imports are ignored. Aliases resolve against `root`.\n */\nexport function resolveImport(\n\tfilename: string,\n\trequest: string,\n\troot: string,\n\tconventions: Conventions\n): string | undefined {\n\tfor (const [prefix, target] of conventions.aliases) {\n\t\tif (request.startsWith(prefix)) {\n\t\t\tconst folder = target === \"sparta\" ? conventions.spartaFolder : conventions.testsFolder;\n\n\t\t\treturn `${root}/${folder}/${request.slice(prefix.length)}`;\n\t\t}\n\t}\n\n\tif (request.startsWith(\".\")) return normalize(path.resolve(path.dirname(filename), request));\n\n\treturn undefined;\n}\n\nexport interface LayerFolderInfo {\n\t/** The folder name as it appears in the project. */\n\tname: string;\n\t/** The standard layer folder it follows, or `undefined` for folders SPARTA does not know. */\n\tstandard?: LayerFolder;\n}\n\n/** The layer folder a file lives in (`steppers`, `pages`, ...), with `sparta/scenarios/` counting as `scenarios`. */\nexport const layerFolder = (filename: string, conventions: Conventions, root: string): LayerFolderInfo | undefined => {\n\tconst file = projectPath(filename, root);\n\n\tif (file === undefined) return undefined;\n\tif (file.match(conventions.patterns.top)?.[1] === \"scenarios\") return { name: \"scenarios\", standard: \"scenarios\" };\n\n\tconst folder = file.match(conventions.patterns.layer)?.[1];\n\n\treturn folder === undefined ? undefined : { name: folder, standard: standardFolder(conventions, folder) };\n};\n\n/** The file name suffix the files in a layer folder must use (`stepper` for `steppers/`), if it has one. */\nexport const layerSuffix = (folder: LayerFolderInfo | undefined): string | undefined =>\n\tfolder?.standard === undefined ? undefined : (LAYER_FOLDERS[folder.standard] as { suffix?: string }).suffix;\n\n/** True for files that follow the layer naming convention (layer folders and fixtures). */\nexport const isLayerFile = (filename: string, conventions: Conventions, root: string): boolean =>\n\tlayerSuffix(layerFolder(filename, conventions, root)) !== undefined ||\n\tprojectPath(filename, root)?.match(conventions.patterns.top)?.[1] === \"fixtures\";\n","import { parseSettings } from \"./conventions\";\nimport type { Conventions } from \"./conventions\";\nimport { projectRoot } from \"./sparta-paths\";\nimport type { Rule } from \"./types\";\n\ntype Context = Parameters<Rule[\"create\"]>[0];\n\n/** Parsed settings per raw settings and working directory, kept for the lifetime of the linter process. */\nconst cache = new Map<string, Conventions>();\n\n/** The validated `settings.sparta` for this file. Throws a descriptive error for invalid settings. */\nexport function conventionsFor(context: Context): Conventions {\n\tconst raw: unknown = (context.settings as Record<string, unknown> | undefined)?.sparta;\n\tconst key = `${context.cwd}\\0${JSON.stringify(raw ?? null)}`;\n\tlet conventions = cache.get(key);\n\n\tif (conventions === undefined) {\n\t\tconventions = parseSettings(raw, context.cwd);\n\t\tcache.set(key, conventions);\n\t}\n\n\treturn conventions;\n}\n\n/**\n * The project root the aliases resolve against: `settings.sparta.root` when set (relative paths resolve against\n * the linter's working directory), otherwise the nearest folder with a `package.json`.\n */\nexport const rootFor = (context: Context, conventions = conventionsFor(context)): string =>\n\tconventions.root ?? projectRoot(context.filename);\n","import { stringValue } from \"../utils/ast\";\nimport type { Conventions } from \"../utils/conventions\";\nimport { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { classify, resolveImport } from \"../utils/sparta-paths\";\nimport type { Area, FileInfo, Kind } from \"../utils/sparta-paths\";\nimport type { AstNode, Rule } from \"../utils/types\";\n\ntype OrchestrationKind = Extract<Kind, \"top-scenario\" | \"test\">;\n\nconst DATABASE_LAYERS = [\n\t\"asserter\",\n\t\"base-repository\",\n\t\"base-service\",\n\t\"container\",\n\t\"database\",\n\t\"repository\",\n\t\"scenario\",\n\t\"service\",\n\t\"stepper\",\n];\n\n/** The UI layers; `view` is the area's name for a page (`page` for web, `screen` for mobile). */\nconst uiLayers = (view: \"page\" | \"screen\"): Record<string, Set<string>> => ({\n\tcomponent: new Set([view, \"stepper\", \"asserter\", \"scenario\", \"builder\", \"director\"]),\n\t[view]: new Set([\"stepper\", \"asserter\", \"scenario\", \"builder\", \"director\"]),\n\tstepper: new Set([\"asserter\", \"scenario\"]),\n\tasserter: new Set([\"stepper\", \"asserter\", \"scenario\"]),\n\tbuilder: new Set([view, \"component\", \"stepper\", \"asserter\", \"scenario\"]),\n\tdirector: new Set([view, \"component\", \"stepper\", \"asserter\", \"scenario\"]),\n\tscenario: new Set([view, \"component\"]),\n});\n\n/** Forbidden target layers inside the same area (API -> API, UI -> UI, database -> database, mobile -> mobile). */\nconst FORBIDDEN_LAYERS: Record<Area, Record<string, Set<string>>> = {\n\tapi: {\n\t\tclient: new Set([\"client\", \"service\", \"base-service\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\t\"base-client\": new Set([\"client\", \"base-client\", \"service\", \"base-service\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\tservice: new Set([\"service\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\t\"base-service\": new Set([\"service\", \"base-service\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\tstepper: new Set([\"client\", \"base-client\", \"asserter\", \"scenario\"]),\n\t\tasserter: new Set([\"stepper\", \"asserter\", \"scenario\"]),\n\t\tscenario: new Set([\"service\", \"base-service\", \"client\", \"base-client\"]),\n\t},\n\tdatabase: {\n\t\trepository: new Set([\"service\", \"base-service\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\t\"base-repository\": new Set([\n\t\t\t\"repository\",\n\t\t\t\"base-repository\",\n\t\t\t\"service\",\n\t\t\t\"base-service\",\n\t\t\t\"stepper\",\n\t\t\t\"asserter\",\n\t\t\t\"scenario\",\n\t\t]),\n\t\tservice: new Set([\"service\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\t\"base-service\": new Set([\"service\", \"base-service\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\tdatabase: new Set(DATABASE_LAYERS),\n\t\tcontainer: new Set(DATABASE_LAYERS.filter(layer => layer !== \"database\")),\n\t\tstepper: new Set([\"repository\", \"base-repository\", \"asserter\", \"scenario\"]),\n\t\tasserter: new Set([\"repository\", \"base-repository\", \"stepper\", \"asserter\", \"scenario\"]),\n\t\tscenario: new Set([\"service\", \"base-service\", \"repository\", \"base-repository\"]),\n\t},\n\tmobile: uiLayers(\"screen\"),\n\tui: uiLayers(\"page\"),\n};\n\nconst DATABASE_ACCESS = [\"repository\", \"base-repository\", \"service\", \"base-service\", \"container\", \"database\"];\n\n/** Layers that code orchestrating flows (top-level scenarios, tests) must not touch directly. */\nconst FORBIDDEN_FOR_ORCHESTRATION: Record<OrchestrationKind, Record<Area, Set<string>>> = {\n\t\"top-scenario\": {\n\t\tapi: new Set([\"client\", \"base-client\", \"service\", \"base-service\"]),\n\t\tdatabase: new Set(DATABASE_ACCESS),\n\t\tmobile: new Set([\"screen\", \"component\"]),\n\t\tui: new Set([\"page\", \"component\"]),\n\t},\n\ttest: {\n\t\tapi: new Set([\"client\", \"base-client\", \"service\", \"base-service\", \"stepper\", \"asserter\"]),\n\t\tdatabase: new Set([...DATABASE_ACCESS, \"stepper\", \"asserter\"]),\n\t\tmobile: new Set([\"screen\", \"component\", \"stepper\", \"asserter\"]),\n\t\tui: new Set([\"page\", \"component\", \"stepper\", \"asserter\"]),\n\t},\n};\n\nconst REEXPORT_LAYERS = new Set([\n\t\"asserter\",\n\t\"client\",\n\t\"base-client\",\n\t\"base-repository\",\n\t\"component\",\n\t\"page\",\n\t\"repository\",\n\t\"scenario\",\n\t\"screen\",\n\t\"service\",\n\t\"base-service\",\n\t\"stepper\",\n]);\n\nconst describe = (info: FileInfo, { spartaFolder, testsFolder }: Conventions): string =>\n\t({\n\t\tgroup: `${info.areaFolder}/${info.group}${info.layer ? ` ${info.layer}` : \"\"}`,\n\t\t\"area-common\": `${info.areaFolder}/common`,\n\t\t\"top-scenario\": `${spartaFolder}/scenarios`,\n\t\tfixture: `${spartaFolder}/fixtures`,\n\t\tshared: `${spartaFolder}/common|support`,\n\t\ttest: testsFolder,\n\t})[info.kind];\n\n/** Isolation compares area folders, not area types: `web/` and `ui/` are separate areas even when both follow `ui`. */\nfunction isolationViolation(source: FileInfo, target: FileInfo): boolean {\n\tif (target.kind === \"test\") return source.kind !== \"test\";\n\n\tif (source.kind === \"shared\") {\n\t\treturn [\"group\", \"area-common\", \"fixture\", \"top-scenario\"].includes(target.kind);\n\t}\n\n\tif (source.kind === \"area-common\") {\n\t\tif ([\"fixture\", \"top-scenario\", \"group\"].includes(target.kind)) return true;\n\n\t\treturn target.kind === \"area-common\" && target.areaFolder !== source.areaFolder;\n\t}\n\n\tif (source.kind === \"group\") {\n\t\tif ([\"fixture\", \"top-scenario\"].includes(target.kind)) return true;\n\t\tif (target.areaFolder === undefined) return false;\n\t\tif (target.areaFolder !== source.areaFolder) return true;\n\n\t\treturn target.kind === \"group\" && target.group !== source.group;\n\t}\n\n\treturn false;\n}\n\nfunction layerViolation(source: FileInfo, target: FileInfo): boolean {\n\tif (!target.layer || !target.area) return false;\n\n\tif (source.kind === \"group\" || source.kind === \"area-common\") {\n\t\tif (!source.area || !source.layer) return false;\n\n\t\treturn (\n\t\t\tsource.areaFolder === target.areaFolder && Boolean(FORBIDDEN_LAYERS[source.area][source.layer]?.has(target.layer))\n\t\t);\n\t}\n\n\tif (source.kind === \"top-scenario\" || source.kind === \"test\") {\n\t\treturn FORBIDDEN_FOR_ORCHESTRATION[source.kind][target.area].has(target.layer);\n\t}\n\n\treturn false;\n}\n\nconst isForbiddenReexport = (source: FileInfo, target: FileInfo): boolean =>\n\ttarget.layer !== undefined &&\n\tREEXPORT_LAYERS.has(target.layer) &&\n\ttarget.layer !== source.layer &&\n\t![\"fixture\", \"test\"].includes(source.kind);\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription: \"Enforce the SPARTA layer and isolation boundaries between imports.\",\n\t\t\turl: docsUrl(\"architecture-boundaries\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tisolation:\n\t\t\t\t\"{{source}} must not depend on {{target}} ({{request}}). Move shared code to the area's common/ folder or the top-level common/ folder.\",\n\t\t\tlayer: \"{{source}} must not depend on {{target}} ({{request}}).\",\n\t\t\treexport: \"Do not re-export {{target}} outside its layer; this bypasses the architecture boundaries.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst filename = context.filename;\n\t\tconst conventions = conventionsFor(context);\n\t\tconst root = rootFor(context, conventions);\n\t\tconst source = classify(filename, conventions, root);\n\n\t\tif (!source) return {};\n\n\t\tconst check = (node: AstNode, request: string | undefined, reexport = false): void => {\n\t\t\tif (request === undefined) return;\n\n\t\t\tconst resolved = resolveImport(filename, request, root, conventions);\n\t\t\tconst target = resolved ? classify(resolved, conventions, root) : undefined;\n\n\t\t\tif (!target) return;\n\n\t\t\tconst data = { source: describe(source, conventions), target: describe(target, conventions), request };\n\n\t\t\tif (isolationViolation(source, target)) {\n\t\t\t\tcontext.report({ node, messageId: \"isolation\", data });\n\t\t\t} else if (layerViolation(source, target)) {\n\t\t\t\tcontext.report({ node, messageId: \"layer\", data });\n\t\t\t} else if (reexport && isForbiddenReexport(source, target)) {\n\t\t\t\tcontext.report({ node, messageId: \"reexport\", data });\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\tImportDeclaration: node => check(node, stringValue(node.source)),\n\n\t\t\tExportNamedDeclaration: node => check(node, stringValue(node.source), true),\n\n\t\t\tExportAllDeclaration: node => check(node, stringValue(node.source), true),\n\n\t\t\tImportExpression: node => check(node, stringValue(node.source)),\n\n\t\t\tTSImportEqualsDeclaration(node): void {\n\t\t\t\tif (node.moduleReference.type === \"TSExternalModuleReference\") {\n\t\t\t\t\tcheck(node, stringValue(node.moduleReference.expression));\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tCallExpression(node): void {\n\t\t\t\tif (node.callee.type === \"Identifier\" && node.callee.name === \"require\") {\n\t\t\t\t\tcheck(node, stringValue(node.arguments[0]));\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import path from \"node:path\";\n\nimport { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { isLayerFile } from \"../utils/sparta-paths\";\nimport type { AstNode, NodeOfType, Rule } from \"../utils/types\";\n\ntype Statement = NodeOfType<\"Program\">[\"body\"][number];\n\ntype ClassDeclaration = Extract<AstNode, { type: \"ClassDeclaration\" | \"ClassExpression\" }>;\n\nconst toPascalCase = (name: string): string =>\n\tname\n\t\t.split(\"-\")\n\t\t.map(part => part.charAt(0).toUpperCase() + part.slice(1))\n\t\t.join(\"\");\n\nconst classOf = (statement: Statement): ClassDeclaration | undefined => {\n\tconst node: AstNode =\n\t\t(statement.type === \"ExportNamedDeclaration\" || statement.type === \"ExportDefaultDeclaration\") &&\n\t\tstatement.declaration\n\t\t\t? statement.declaration\n\t\t\t: statement;\n\n\treturn node.type === \"ClassDeclaration\" ? node : undefined;\n};\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"suggestion\",\n\t\tdocs: {\n\t\t\tdescription: \"Require a layer file to contain exactly one class, named after the file in PascalCase.\",\n\t\t\turl: docsUrl(\"class-matches-filename\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tname: \"Class '{{found}}' must be named '{{expected}}' to match the file name.\",\n\t\t\tsingle: \"A layer file contains exactly one class; move '{{found}}' to its own file.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst conventions = conventionsFor(context);\n\n\t\tif (!isLayerFile(context.filename, conventions, rootFor(context, conventions))) return {};\n\n\t\tconst expected = toPascalCase(path.basename(context.filename).replace(/\\.ts$/, \"\"));\n\n\t\treturn {\n\t\t\tProgram(program): void {\n\t\t\t\tconst classes = program.body.map(classOf).filter((node): node is ClassDeclaration => node !== undefined);\n\n\t\t\t\tclasses.forEach((node, index) => {\n\t\t\t\t\tconst found = node.id?.name ?? \"(anonymous)\";\n\n\t\t\t\t\tif (index > 0) {\n\t\t\t\t\t\tcontext.report({ node: node.id ?? node, messageId: \"single\", data: { found } });\n\t\t\t\t\t} else if (found !== expected) {\n\t\t\t\t\t\tcontext.report({ node: node.id ?? node, messageId: \"name\", data: { found, expected } });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Conventions } from \"../utils/conventions\";\nimport { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { projectPath } from \"../utils/sparta-paths\";\nimport type { Rule } from \"../utils/types\";\n\n/** Files inside the sparta folder, except its support folder (where `expect` itself is defined). */\nconst appliesTo = (filename: string, { patterns }: Conventions, root: string): boolean => {\n\tconst file = projectPath(filename, root);\n\n\treturn file !== undefined && patterns.sparta.test(file) && file.match(patterns.top)?.[1] !== \"support\";\n};\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription: \"Require `expect` to be imported from the support module (`@sparta/support`) inside sparta/.\",\n\t\t\turl: docsUrl(\"expect-from-support\"),\n\t\t},\n\t\tfixable: \"code\",\n\t\tschema: [],\n\t\tmessages: {\n\t\t\texpectFromSupport: \"Import expect from '{{module}}' instead of '{{source}}'.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst conventions = conventionsFor(context);\n\t\tconst { supportModule } = conventions;\n\n\t\tif (!appliesTo(context.filename, conventions, rootFor(context, conventions))) return {};\n\n\t\treturn {\n\t\t\tImportDeclaration(node): void {\n\t\t\t\tconst source = node.source.value;\n\n\t\t\t\tif (source === supportModule) return;\n\n\t\t\t\tconst specifier = node.specifiers.find(\n\t\t\t\t\titem =>\n\t\t\t\t\t\titem.type === \"ImportSpecifier\" && item.imported.type === \"Identifier\" && item.imported.name === \"expect\"\n\t\t\t\t);\n\n\t\t\t\tif (specifier === undefined) return;\n\n\t\t\t\tconst data = { source: String(source), module: supportModule };\n\n\t\t\t\tif (node.specifiers.length !== 1) {\n\t\t\t\t\tcontext.report({ node: specifier, messageId: \"expectFromSupport\", data });\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: specifier,\n\t\t\t\t\tmessageId: \"expectFromSupport\",\n\t\t\t\t\tdata,\n\n\t\t\t\t\tfix: fixer => fixer.replaceText(node.source, JSON.stringify(supportModule)),\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import path from \"node:path\";\n\nimport { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { layerFolder, layerSuffix } from \"../utils/sparta-paths\";\nimport type { Rule } from \"../utils/types\";\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"suggestion\",\n\t\tdocs: {\n\t\t\tdescription: \"Require files in a layer folder to end with the layer suffix (e.g. `*-stepper.ts`).\",\n\t\t\turl: docsUrl(\"file-naming\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tsuffix: \"Files in '{{folder}}/' must be named '*-{{suffix}}.ts' (found '{{name}}').\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst conventions = conventionsFor(context);\n\t\tconst folder = layerFolder(context.filename, conventions, rootFor(context, conventions));\n\t\tconst suffix = layerSuffix(folder);\n\t\tconst name = path.basename(context.filename);\n\n\t\t// `index.ts` is a barrel that re-exports the folder's own files, which architecture-boundaries allows.\n\t\tif (folder === undefined || suffix === undefined || name === \"index.ts\" || name.endsWith(`-${suffix}.ts`)) {\n\t\t\treturn {};\n\t\t}\n\n\t\treturn {\n\t\t\tProgram(node): void {\n\t\t\t\tcontext.report({ node, messageId: \"suffix\", data: { folder: folder.name, suffix, name } });\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { docsUrl } from \"../utils/docs\";\nimport type { Rule } from \"../utils/types\";\n\nconst BLANK_LINE = /\\r?\\n[\\t ]*\\r?\\n/;\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"layout\",\n\t\tdocs: {\n\t\t\tdescription: \"Require a blank line after every multi-line class member.\",\n\t\t\turl: docsUrl(\"lines-between-class-members\"),\n\t\t},\n\t\tfixable: \"whitespace\",\n\t\tschema: [],\n\t\tmessages: {\n\t\t\texpectedBlankLine: \"Expected a blank line between class members.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst { text } = context.sourceCode;\n\n\t\treturn {\n\t\t\tClassBody(node): void {\n\t\t\t\tfor (let index = 1; index < node.body.length; index++) {\n\t\t\t\t\tconst previous = node.body[index - 1];\n\t\t\t\t\tconst current = node.body[index];\n\n\t\t\t\t\tif (previous.loc.start.line === previous.loc.end.line) continue;\n\n\t\t\t\t\tconst textBetween = text.slice(previous.range[1], current.range[0]);\n\n\t\t\t\t\tif (BLANK_LINE.test(textBetween)) continue;\n\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode: current,\n\t\t\t\t\t\tmessageId: \"expectedBlankLine\",\n\n\t\t\t\t\t\tfix: fixer => {\n\t\t\t\t\t\t\tconst lineBreak = textBetween.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n\t\t\t\t\t\t\tconst replacement = textBetween.includes(lineBreak)\n\t\t\t\t\t\t\t\t? textBetween.replace(lineBreak, `${lineBreak}${lineBreak}`)\n\t\t\t\t\t\t\t\t: `${lineBreak}${lineBreak}${textBetween}`;\n\n\t\t\t\t\t\t\treturn fixer.replaceTextRange([previous.range[1], current.range[0]], replacement);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { classify } from \"../utils/sparta-paths\";\nimport type { Rule } from \"../utils/types\";\n\nconst LAYER_CLASS =\n\t/(Stepper|Asserter|Scenario|Service|Client|Repository|Page|Screen|Component|Builder|Director|Factory|Provider)$/;\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription: \"Disallow constructing SPARTA layer classes in tests; use the fixtures instead.\",\n\t\t\turl: docsUrl(\"no-direct-construction-in-tests\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tuseFixture: \"Do not construct '{{name}}' in a test; use it via the SPARTA fixtures.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst conventions = conventionsFor(context);\n\n\t\tif (classify(context.filename, conventions, rootFor(context, conventions))?.kind !== \"test\") return {};\n\n\t\treturn {\n\t\t\tNewExpression(node): void {\n\t\t\t\tconst { callee } = node;\n\n\t\t\t\tif (callee.type === \"Identifier\" && LAYER_CLASS.test(callee.name)) {\n\t\t\t\t\tcontext.report({ node, messageId: \"useFixture\", data: { name: callee.name } });\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { classify } from \"../utils/sparta-paths\";\nimport type { AstNode, Rule } from \"../utils/types\";\n\n/**\n * Names of `expect` and its extensions: `expect`, `expectly`, `expectlyLocator`, `expectApi`, `expect_soft`.\n * `expected`, `expecting` and the like are left alone. `settings.sparta.expectNames` adds exact names.\n */\nconst EXPECT_NAME = /^expect(?:ly)?(?:[A-Z_$\\d]|$)/;\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription: \"Disallow `expect` in test files; checks belong in steppers and asserters.\",\n\t\t\turl: docsUrl(\"no-expect-in-tests\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tnoExpect:\n\t\t\t\t\"Do not use expect in a test file. Put checkpoints in a stepper and technical or functional checks in an asserter.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst conventions = conventionsFor(context);\n\n\t\tif (classify(context.filename, conventions, rootFor(context, conventions))?.kind !== \"test\") return {};\n\n\t\tconst isExpectName = (name: string): boolean => EXPECT_NAME.test(name) || conventions.expectNames.has(name);\n\n\t\t/** Local names bound to an expect through a renamed import, such as `import { expect as check }`. */\n\t\tconst aliases = new Set<string>();\n\n\t\tconst isExpect = (node: AstNode): boolean =>\n\t\t\tnode.type === \"Identifier\" && (isExpectName(node.name) || aliases.has(node.name));\n\n\t\treturn {\n\t\t\tImportSpecifier(node): void {\n\t\t\t\tconst { imported, local } = node;\n\t\t\t\tconst importedName = imported.type === \"Identifier\" ? imported.name : String(imported.value);\n\n\t\t\t\tif (!isExpectName(importedName) && !isExpectName(local.name)) return;\n\n\t\t\t\taliases.add(local.name);\n\t\t\t\tcontext.report({ node, messageId: \"noExpect\" });\n\t\t\t},\n\n\t\t\tCallExpression(node): void {\n\t\t\t\tlet callee: AstNode = node.callee;\n\n\t\t\t\t// `expect.soft(...)`, `expect.poll(...)`, `expectly.locator.x(...)`: check the root of the member chain.\n\t\t\t\twhile (callee.type === \"MemberExpression\") callee = callee.object;\n\n\t\t\t\tif (isExpect(callee)) context.report({ node: node.callee, messageId: \"noExpect\" });\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { isIdentifier } from \"../utils/ast\";\nimport { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { projectPath } from \"../utils/sparta-paths\";\nimport type { AstNode, Rule } from \"../utils/types\";\n\nconst TIMER_MODULES = new Set([\"timers/promises\", \"node:timers/promises\"]);\n\nconst isSetTimeout = (callee: AstNode): boolean =>\n\tisIdentifier(callee, \"setTimeout\") ||\n\t(callee.type === \"MemberExpression\" &&\n\t\t(isIdentifier(callee.object, \"globalThis\") || isIdentifier(callee.object, \"window\")) &&\n\t\tisIdentifier(callee.property, \"setTimeout\"));\n\n/** The `resolve` parameter of the nearest enclosing `new Promise(resolve => ...)` executor. */\nconst promiseResolveName = (node: AstNode): string | undefined => {\n\tfor (let current: AstNode | null = node.parent; current; current = current.parent) {\n\t\tif (current.type !== \"ArrowFunctionExpression\" && current.type !== \"FunctionExpression\") continue;\n\n\t\tconst { parent } = current;\n\n\t\tif (parent.type === \"NewExpression\" && isIdentifier(parent.callee, \"Promise\") && parent.arguments[0] === current) {\n\t\t\tconst [resolve] = current.params;\n\n\t\t\treturn resolve?.type === \"Identifier\" ? resolve.name : undefined;\n\t\t}\n\t}\n\n\treturn undefined;\n};\n\n/** True when the timer callback only resolves the promise, i.e. the timer is a plain sleep. */\nconst resolvesPromise = (callback: AstNode | undefined, resolve: string): boolean => {\n\tif (!callback) return false;\n\tif (isIdentifier(callback, resolve)) return true;\n\tif (callback.type !== \"ArrowFunctionExpression\" && callback.type !== \"FunctionExpression\") return false;\n\n\tconst { body } = callback;\n\n\tif (!body) return false;\n\n\tconst call =\n\t\tbody.type === \"CallExpression\"\n\t\t\t? body\n\t\t\t: body.type === \"BlockStatement\" && body.body.length === 1 && body.body[0].type === \"ExpressionStatement\"\n\t\t\t\t? body.body[0].expression\n\t\t\t\t: undefined;\n\n\treturn call?.type === \"CallExpression\" && isIdentifier(call.callee, resolve);\n};\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription: \"Disallow fixed-time waits such as `waitForTimeout` and `setTimeout` sleeps.\",\n\t\t\turl: docsUrl(\"no-hard-waits\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\thardWait:\n\t\t\t\t\"Do not wait a fixed amount of time; wait for a state with web-first assertions or polling in a stepper or asserter.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst conventions = conventionsFor(context);\n\t\tconst { patterns } = conventions;\n\t\tconst file = projectPath(context.filename, rootFor(context, conventions));\n\n\t\tif (file === undefined || !patterns.checked.test(file) || patterns.framework.test(file)) return {};\n\n\t\treturn {\n\t\t\tImportDeclaration(node): void {\n\t\t\t\tif (typeof node.source.value !== \"string\" || !TIMER_MODULES.has(node.source.value)) return;\n\n\t\t\t\tfor (const specifier of node.specifiers) {\n\t\t\t\t\tif (specifier.type === \"ImportSpecifier\" && isIdentifier(specifier.imported, \"setTimeout\")) {\n\t\t\t\t\t\tcontext.report({ node: specifier, messageId: \"hardWait\" });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tCallExpression(node): void {\n\t\t\t\tconst { callee } = node;\n\n\t\t\t\tif (callee.type === \"MemberExpression\" && isIdentifier(callee.property, \"waitForTimeout\")) {\n\t\t\t\t\tcontext.report({ node, messageId: \"hardWait\" });\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!isSetTimeout(callee)) return;\n\n\t\t\t\tconst resolve = promiseResolveName(node);\n\n\t\t\t\tif (resolve !== undefined && resolvesPromise(node.arguments[0], resolve)) {\n\t\t\t\t\tcontext.report({ node, messageId: \"hardWait\" });\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { CallExpression, Node } from \"oxc-parser\";\n\n/**\n * Retrying assertions are recognised by method name only, so `expect`, `expect.soft`, `expectly` and wrappers all\n * match. The names come from the conventions: `toPass`, `toPassAndReturn`, `poll`, `pollAndReturn`, plus\n * `settings.sparta.pollingMethods`.\n */\n\n/** Methods that take the callback they retry as their own first argument (`expect.poll(cb)`). */\nconst CALLBACK_ARGUMENT_METHODS = new Set([\"poll\", \"pollAndReturn\"]);\n\n/** Methods that retry the callback given to the start of their chain (`expect(cb).toPass()`). */\nconst CALLBACK_SUBJECT_METHODS = new Set([\"toPass\", \"toPassAndReturn\"]);\n\n/** The static name of a member access (`a.b`, `a[\"b\"]`), or `undefined` for computed or private access. */\nexport const memberName = (node: Node): string | undefined => {\n\tif (node.type !== \"MemberExpression\") return undefined;\n\n\tconst { property } = node;\n\n\tif (!node.computed && property.type === \"Identifier\") return property.name;\n\tif (node.computed && property.type === \"Literal\" && typeof property.value === \"string\") return property.value;\n\n\treturn undefined;\n};\n\n/** The polling method a call invokes (`toPass` for `expect(cb).toPass()`), or `undefined` for any other node. */\nexport const pollingMethod = (node: Node, methods: ReadonlySet<string>): string | undefined => {\n\tif (node.type !== \"CallExpression\") return undefined;\n\n\tconst name = memberName(node.callee);\n\n\treturn name !== undefined && methods.has(name) ? name : undefined;\n};\n\nconst isFunction = (node: Node | undefined): boolean =>\n\tnode?.type === \"ArrowFunctionExpression\" || node?.type === \"FunctionExpression\";\n\nconst firstArgument = (call: CallExpression): Node | undefined => {\n\tconst [argument] = call.arguments;\n\n\treturn argument?.type === \"SpreadElement\" ? undefined : argument;\n};\n\n/** `X(cb).method()`: the first argument of the call the chain starts from, also through `.soft(cb)` and `.not`. */\nconst subjectCallback = (call: CallExpression): Node | undefined => {\n\tif (call.callee.type !== \"MemberExpression\") return undefined;\n\n\tlet object: Node = call.callee.object;\n\n\twhile (object.type === \"MemberExpression\") object = object.object;\n\n\treturn object.type === \"CallExpression\" ? firstArgument(object) : undefined;\n};\n\n/**\n * The callback that a polling call retries:\n * - `X.poll(cb)` and `X.pollAndReturn(cb)`: the first argument.\n * - `X(cb).toPass()` and `X(cb).toPassAndReturn()`: the first argument of the call the chain starts from,\n * also through `.soft(cb)` and `.not`.\n * - other configured methods: the first argument when it is a function, otherwise the start of the chain.\n */\nexport const pollCallback = (call: CallExpression, methods: ReadonlySet<string>): Node | undefined => {\n\tconst method = pollingMethod(call, methods);\n\n\tif (method === undefined || call.callee.type !== \"MemberExpression\") return undefined;\n\tif (CALLBACK_ARGUMENT_METHODS.has(method)) return firstArgument(call);\n\tif (CALLBACK_SUBJECT_METHODS.has(method)) return subjectCallback(call);\n\n\tconst argument = firstArgument(call);\n\n\treturn isFunction(argument) ? argument : subjectCallback(call);\n};\n","import { readFileSync, statSync } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { parseSync } from \"oxc-parser\";\nimport type {\n\tArrowFunctionExpression,\n\tCallExpression,\n\tClass,\n\tFunction as FunctionNode,\n\tMethodDefinition,\n\tNode,\n\tProgram,\n\tPropertyDefinition,\n\tTSTypeAnnotation,\n} from \"oxc-parser\";\n\nimport type { Conventions } from \"./conventions\";\nimport { memberName, pollingMethod } from \"./polling\";\nimport { normalize, resolveImport } from \"./sparta-paths\";\n\n/**\n * Follows calls across files without type information, using the conventions SPARTA projects follow:\n * dependencies are typed constructor parameter properties, typed fields or fields created with `new`,\n * and every type comes from a named import (relative or an alias such as `@sparta/*`). Classes are always\n * resolved through the import they came from, never by name, because class names repeat across folders.\n * Anything that cannot be resolved this way is ignored.\n */\n\ntype FunctionLike = FunctionNode | ArrowFunctionExpression;\n\ninterface ImportRef {\n\t/** Resolved file, or `undefined` for package imports, which are never followed. */\n\tmodule: string | undefined;\n\timported: string;\n}\n\ninterface ClassInfo {\n\tname: string;\n\tnode: Class;\n\t/** Local name of the base class in this file. */\n\tsuperClass?: string;\n\tmethods: Map<string, FunctionLike>;\n\t/** Field name to the local name of its type in this file. */\n\tfields: Map<string, string>;\n}\n\nexport interface FileSummary {\n\tfile: string;\n\t/** Project root the aliases resolve against. */\n\troot: string;\n\tconventions: Conventions;\n\timports: Map<string, ImportRef>;\n\tclasses: Map<string, ClassInfo>;\n\tfunctions: Map<string, FunctionLike>;\n\t/** Exported name to local name, for `export class X`, `export { X as Y }` and `export default`. */\n\texports: Map<string, string>;\n\treexports: Map<string, ImportRef>;\n\tstarExports: string[];\n}\n\nexport interface ClassRef {\n\tfile: string;\n\tinfo: ClassInfo;\n}\n\nexport type Target =\n\t| { kind: \"method\"; file: string; cls: ClassRef; name: string; fn: FunctionLike }\n\t| { kind: \"function\"; file: string; name: string; fn: FunctionLike };\n\nexport interface Scope {\n\tfile: string;\n\tcls?: ClassRef;\n\t/** Local variable name to the local name of its type, from `const x = new X()` or `const x: X = ...`. */\n\tlocals: Map<string, string>;\n}\n\n/** A call inside a poll callback that polls: either a polling call itself, or a call that leads to one. */\nexport type Hit = { node: CallExpression; method: string } | { node: CallExpression; path: string[] };\n\nconst MAX_DEPTH = 10;\n\nconst SKIPPED_KEYS = new Set([\"parent\", \"loc\", \"range\", \"start\", \"end\", \"typeAnnotation\", \"returnType\", \"decorators\"]);\n\nconst MODULE_EXTENSIONS = [\"\", \".ts\", \".tsx\", \".mts\", \".cts\", \"/index.ts\"];\n\nconst isNode = (value: unknown): value is Node =>\n\ttypeof value === \"object\" && value !== null && typeof (value as { type?: unknown }).type === \"string\";\n\n/** Visits `node` and its descendants depth-first. Returning `false` from `visit` skips the node's children. */\nexport function walk(node: Node, visit: (node: Node) => boolean | void): void {\n\tif (visit(node) === false) return;\n\n\tfor (const [key, value] of Object.entries(node)) {\n\t\tif (SKIPPED_KEYS.has(key)) continue;\n\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (const item of value) if (isNode(item)) walk(item, visit);\n\t\t} else if (isNode(value)) {\n\t\t\twalk(value, visit);\n\t\t}\n\t}\n}\n\nconst isFunctionLike = (node: Node | null | undefined): node is FunctionLike =>\n\tnode?.type === \"ArrowFunctionExpression\" ||\n\tnode?.type === \"FunctionExpression\" ||\n\tnode?.type === \"FunctionDeclaration\";\n\n/** `X` for a `: X` or `: X<T>` annotation. */\nconst typeName = (annotation: TSTypeAnnotation | null | undefined): string | undefined => {\n\tconst type = annotation?.typeAnnotation;\n\n\treturn type?.type === \"TSTypeReference\" && type.typeName.type === \"Identifier\" ? type.typeName.name : undefined;\n};\n\n/** `X` for `new X(...)`. */\nconst newName = (node: Node | null | undefined): string | undefined =>\n\tnode?.type === \"NewExpression\" && node.callee.type === \"Identifier\" ? node.callee.name : undefined;\n\nconst keyName = (key: Node): string | undefined =>\n\tkey.type === \"Identifier\"\n\t\t? key.name\n\t\t: key.type === \"Literal\" && typeof key.value === \"string\"\n\t\t\t? key.value\n\t\t\t: undefined;\n\nfunction summarizeClass(name: string, node: Class): ClassInfo {\n\tconst info: ClassInfo = {\n\t\tname,\n\t\tnode,\n\t\tsuperClass: node.superClass?.type === \"Identifier\" ? node.superClass.name : undefined,\n\t\tmethods: new Map(),\n\t\tfields: new Map(),\n\t};\n\n\tfor (const member of node.body.body) {\n\t\tif (member.type === \"PropertyDefinition\") summarizeField(info, member);\n\t\tif (member.type === \"MethodDefinition\") summarizeMethod(info, member);\n\t}\n\n\treturn info;\n}\n\n/** A typed field (`x: X`) or a field created with `new X()`. */\nfunction summarizeField(info: ClassInfo, member: PropertyDefinition): void {\n\tconst field = member.computed ? undefined : keyName(member.key);\n\tconst type = typeName(member.typeAnnotation) ?? newName(member.value);\n\n\tif (field !== undefined && type !== undefined) info.fields.set(field, type);\n}\n\n/** Methods, getters (whose return type acts as a field type) and the constructor. */\nfunction summarizeMethod(info: ClassInfo, member: MethodDefinition): void {\n\tconst name = member.computed ? undefined : keyName(member.key);\n\tconst { value } = member;\n\n\tif (name === undefined || value.type !== \"FunctionExpression\" || !value.body) return;\n\n\tif (member.kind === \"constructor\") {\n\t\tsummarizeConstructor(info, value);\n\t} else if (member.kind === \"get\") {\n\t\tconst type = typeName(value.returnType);\n\n\t\tif (type !== undefined) info.fields.set(name, type);\n\t} else if (member.kind === \"method\") {\n\t\tinfo.methods.set(name, value);\n\t}\n}\n\n/** Fields from constructor parameter properties and from `this.x = new X()` assignments. */\nfunction summarizeConstructor(info: ClassInfo, constructor: FunctionNode): void {\n\tfor (const param of constructor.params) {\n\t\tif (param.type !== \"TSParameterProperty\") continue;\n\n\t\tconst binding = param.parameter.type === \"AssignmentPattern\" ? param.parameter.left : param.parameter;\n\t\tconst type = binding.type === \"Identifier\" ? typeName(binding.typeAnnotation) : undefined;\n\n\t\tif (binding.type === \"Identifier\" && type !== undefined) info.fields.set(binding.name, type);\n\t}\n\n\tif (!constructor.body) return;\n\n\twalk(constructor.body, node => {\n\t\tif (node.type !== \"AssignmentExpression\" || node.left.type !== \"MemberExpression\") return;\n\t\tif (node.left.object.type !== \"ThisExpression\") return;\n\n\t\tconst field = memberName(node.left);\n\t\tconst type = newName(node.right);\n\n\t\tif (field !== undefined && type !== undefined && !info.fields.has(field)) info.fields.set(field, type);\n\t});\n}\n\nconst importedName = (node: Node): string =>\n\tnode.type === \"Identifier\" ? node.name : node.type === \"Literal\" ? String(node.value) : \"\";\n\nfunction summarizeDeclaration(summary: FileSummary, node: Node, exported: string | undefined): void {\n\tif ((node.type === \"ClassDeclaration\" || node.type === \"ClassExpression\") && node.id) {\n\t\tsummary.classes.set(node.id.name, summarizeClass(node.id.name, node));\n\t\tif (exported !== undefined) summary.exports.set(exported === \"\" ? node.id.name : exported, node.id.name);\n\t} else if (node.type === \"FunctionDeclaration\" && node.id) {\n\t\tsummary.functions.set(node.id.name, node);\n\t\tif (exported !== undefined) summary.exports.set(exported === \"\" ? node.id.name : exported, node.id.name);\n\t} else if (node.type === \"VariableDeclaration\") {\n\t\tfor (const declarator of node.declarations) {\n\t\t\tif (declarator.id.type !== \"Identifier\" || !isFunctionLike(declarator.init)) continue;\n\n\t\t\tsummary.functions.set(declarator.id.name, declarator.init);\n\t\t\tif (exported !== undefined) summary.exports.set(declarator.id.name, declarator.id.name);\n\t\t}\n\t}\n}\n\n/** Collects the imports, exports, classes and functions of a module. */\nexport function summarize(file: string, program: Program, root: string, conventions: Conventions): FileSummary {\n\tconst summary: FileSummary = {\n\t\tfile,\n\t\troot,\n\t\tconventions,\n\t\timports: new Map(),\n\t\tclasses: new Map(),\n\t\tfunctions: new Map(),\n\t\texports: new Map(),\n\t\treexports: new Map(),\n\t\tstarExports: [],\n\t};\n\tfor (const statement of program.body) {\n\t\tif (statement.type === \"ImportDeclaration\") {\n\t\t\tsummarizeImport(summary, statement);\n\t\t} else if (statement.type === \"ExportNamedDeclaration\") {\n\t\t\tsummarizeNamedExport(summary, statement);\n\t\t} else if (statement.type === \"ExportDefaultDeclaration\") {\n\t\t\tconst { declaration } = statement;\n\n\t\t\tif (declaration.type === \"Identifier\") summary.exports.set(\"default\", declaration.name);\n\t\t\telse summarizeDeclaration(summary, declaration, \"default\");\n\t\t} else if (statement.type === \"ExportAllDeclaration\") {\n\t\t\tconst module = resolveModule(file, statement.source.value, root, conventions);\n\n\t\t\tif (!statement.exported && module !== undefined) summary.starExports.push(module);\n\t\t} else {\n\t\t\tsummarizeDeclaration(summary, statement, undefined);\n\t\t}\n\t}\n\n\treturn summary;\n}\n\ntype Statement = Program[\"body\"][number];\n\nfunction summarizeImport(summary: FileSummary, statement: Extract<Statement, { type: \"ImportDeclaration\" }>): void {\n\tconst module = resolveModule(summary.file, statement.source.value, summary.root, summary.conventions);\n\n\tfor (const specifier of statement.specifiers) {\n\t\tif (specifier.type === \"ImportSpecifier\") {\n\t\t\tsummary.imports.set(specifier.local.name, { module, imported: importedName(specifier.imported) });\n\t\t} else if (specifier.type === \"ImportDefaultSpecifier\") {\n\t\t\tsummary.imports.set(specifier.local.name, { module, imported: \"default\" });\n\t\t}\n\t}\n}\n\n/** `export class X`, `export { X as Y }` and `export { X } from \"...\"`. */\nfunction summarizeNamedExport(\n\tsummary: FileSummary,\n\tstatement: Extract<Statement, { type: \"ExportNamedDeclaration\" }>\n): void {\n\tif (statement.declaration) {\n\t\tsummarizeDeclaration(summary, statement.declaration, \"\");\n\n\t\treturn;\n\t}\n\n\tconst module = statement.source\n\t\t? resolveModule(summary.file, statement.source.value, summary.root, summary.conventions)\n\t\t: undefined;\n\n\tfor (const specifier of statement.specifiers) {\n\t\tconst exported = importedName(specifier.exported);\n\t\tconst local = importedName(specifier.local);\n\n\t\tif (statement.source) summary.reexports.set(exported, { module, imported: local });\n\t\telse summary.exports.set(exported, local);\n\t}\n}\n\nconst isFile = (file: string): boolean => statSync(file, { throwIfNoEntry: false })?.isFile() ?? false;\n\n/** Resolves a relative or aliased import to a TypeScript file. Package imports resolve to `undefined`. */\nexport function resolveModule(\n\tfromFile: string,\n\trequest: string,\n\troot: string,\n\tconventions: Conventions\n): string | undefined {\n\tconst base = resolveImport(fromFile, request, root, conventions);\n\n\tif (base === undefined) return undefined;\n\n\tconst stripped = base.replace(/\\.(?:m|c)?js$/, \"\");\n\n\tfor (const candidate of [base, ...MODULE_EXTENSIONS.map(extension => `${stripped}${extension}`)]) {\n\t\tif (isFile(candidate)) return normalize(candidate);\n\t}\n\n\treturn undefined;\n}\n\n/**\n * Summaries of files on disk per project root and conventions (imports resolve against them), kept for the lifetime of the\n * linter process and refreshed when a file changes.\n */\nconst diskCache = new Map<string, { mtimeMs: number; summary: FileSummary }>();\n\nfunction diskSummary(file: string, root: string, conventions: Conventions): FileSummary | undefined {\n\tconst stats = statSync(file, { throwIfNoEntry: false });\n\n\tif (!stats?.isFile()) return undefined;\n\n\tconst key = `${conventions.key}\\0${root}\\0${file}`;\n\tconst cached = diskCache.get(key);\n\n\tif (cached?.mtimeMs === stats.mtimeMs) return cached.summary;\n\n\tconst { program } = parseSync(file, readFileSync(file, \"utf8\"));\n\tconst summary = summarize(file, program, root, conventions);\n\n\tdiskCache.set(key, { mtimeMs: stats.mtimeMs, summary });\n\n\treturn summary;\n}\n\n/** Shows paths relative to the project root (`sparta/...`) instead of absolute ones. */\nconst display = (file: string, root: string): string =>\n\tfile.startsWith(`${root}/`) ? file.slice(root.length + 1) : path.basename(file);\n\n/**\n * Cross-file view for one linted file. The linted file uses the linter's in-memory AST (so unsaved\n * changes count); every other file is parsed from disk.\n */\nexport class ProjectIndex {\n\tprivate readonly memo = new Map<string, string[] | null>();\n\n\tprivate readonly inProgress = new Set<string>();\n\n\t/** Summaries looked up while linting this file, so every other file is checked on disk at most once. */\n\tprivate readonly summaries = new Map<string, FileSummary | undefined>();\n\n\t/**\n\t * Counts the lookups cut short by a call cycle or by `MAX_DEPTH`. A \"does not poll\" answer computed while this\n\t * changed is only true for that call chain, so it is not cached.\n\t */\n\tprivate truncations = 0;\n\n\tconstructor(readonly current: FileSummary) {}\n\n\t/** Finds the polling calls, and the calls that lead to polling, inside `root`. Stops descending at a polling call. */\n\tcollectHits(root: Node, scope: Scope, depth = 0, firstOnly = false): Hit[] {\n\t\tconst hits: Hit[] = [];\n\n\t\twalk(root, node => {\n\t\t\tif (firstOnly && hits.length > 0) return false;\n\t\t\tif (node.type !== \"CallExpression\") return;\n\n\t\t\tconst method = pollingMethod(node, this.current.conventions.pollingMethods);\n\n\t\t\tif (method !== undefined) {\n\t\t\t\thits.push({ node, method });\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst target = this.resolveCall(node, scope);\n\t\t\tconst path = target ? this.pollingPath(target, depth + 1) : undefined;\n\n\t\t\tif (path) hits.push({ node, path });\n\t\t});\n\n\t\treturn hits;\n\t}\n\n\t/** The chain from `target` to a polling call, e.g. `[\"Page.open\", \"Page.find\", \"poll (sparta/.../page.ts)\"]`. */\n\tpollingPath(target: Target, depth = 0): string[] | undefined {\n\t\tconst label = target.kind === \"method\" ? `${target.cls.info.name}.${target.name}` : target.name;\n\t\tconst key = `${target.file}#${label}`;\n\t\tconst known = this.memo.get(key);\n\n\t\tif (known !== undefined) return known ?? undefined;\n\t\tif (!target.fn.body) return undefined;\n\n\t\tif (depth > MAX_DEPTH || this.inProgress.has(key)) {\n\t\t\tthis.truncations++;\n\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst truncationsBefore = this.truncations;\n\n\t\tthis.inProgress.add(key);\n\n\t\tconst scope: Scope = {\n\t\t\tfile: target.file,\n\t\t\tcls: target.kind === \"method\" ? target.cls : undefined,\n\t\t\tlocals: collectLocals(target.fn),\n\t\t};\n\t\tconst [hit] = this.collectHits(target.fn.body, scope, depth, true);\n\n\t\tthis.inProgress.delete(key);\n\n\t\tconst result = hit\n\t\t\t? \"method\" in hit\n\t\t\t\t? [label, `${hit.method} (${display(target.file, this.current.root)})`]\n\t\t\t\t: [label, ...hit.path]\n\t\t\t: undefined;\n\n\t\tif (result !== undefined) this.memo.set(key, result);\n\t\telse if (this.truncations === truncationsBefore) this.memo.set(key, null);\n\n\t\treturn result;\n\t}\n\n\t/** Resolves a call such as `fn()`, `this.method()`, `this.field.method()` or `local.method()`. */\n\tresolveCall(call: CallExpression, scope: Scope): Target | undefined {\n\t\treturn this.resolveReference(call.callee, scope);\n\t}\n\n\t/** Resolves a reference to a function or method, such as `fn` or `this.page.method`. */\n\tresolveReference(node: Node, scope: Scope): Target | undefined {\n\t\tif (node.type === \"Identifier\") {\n\t\t\tconst found = this.resolveLocal(scope.file, node.name);\n\t\t\tconst fn = found ? this.summary(found.file)?.functions.get(found.local) : undefined;\n\n\t\t\treturn found && fn ? { kind: \"function\", file: found.file, name: found.local, fn } : undefined;\n\t\t}\n\n\t\tconst method = memberName(node);\n\n\t\tif (method === undefined || node.type !== \"MemberExpression\") return undefined;\n\n\t\tconst receiver = this.receiverClass(node.object, scope);\n\n\t\treturn receiver ? this.findMethod(receiver, method) : undefined;\n\t}\n\n\t/** Builds the scope for code in the linted file, inside `classNode` and the function `fn` (whose locals count). */\n\tscopeFor(classNode: Node | undefined, fn: Node | undefined): Scope {\n\t\tconst cls = [...this.current.classes.values()].find(info => info.node === classNode);\n\n\t\treturn {\n\t\t\tfile: this.current.file,\n\t\t\tcls: cls ? { file: this.current.file, info: cls } : undefined,\n\t\t\tlocals: isFunctionLike(fn) ? collectLocals(fn) : new Map(),\n\t\t};\n\t}\n\n\tprivate summary(file: string): FileSummary | undefined {\n\t\tif (file === this.current.file) return this.current;\n\t\tif (this.summaries.has(file)) return this.summaries.get(file);\n\n\t\tconst summary = diskSummary(file, this.current.root, this.current.conventions);\n\n\t\tthis.summaries.set(file, summary);\n\n\t\treturn summary;\n\t}\n\n\tprivate receiverClass(node: Node, scope: Scope, depth = 0): ClassRef | undefined {\n\t\tif (depth > MAX_DEPTH) return undefined;\n\n\t\tswitch (node.type) {\n\t\t\tcase \"ThisExpression\":\n\t\t\t\treturn scope.cls;\n\t\t\tcase \"Identifier\": {\n\t\t\t\tconst type = scope.locals.get(node.name);\n\n\t\t\t\treturn type === undefined ? undefined : this.resolveClass(scope.file, type);\n\t\t\t}\n\t\t\tcase \"NewExpression\":\n\t\t\t\treturn node.callee.type === \"Identifier\" ? this.resolveClass(scope.file, node.callee.name) : undefined;\n\t\t\tcase \"TSNonNullExpression\":\n\t\t\tcase \"ParenthesizedExpression\":\n\t\t\t\treturn this.receiverClass(node.expression, scope, depth + 1);\n\t\t\tcase \"MemberExpression\": {\n\t\t\t\tconst field = memberName(node);\n\t\t\t\tconst owner = field === undefined ? undefined : this.receiverClass(node.object, scope, depth + 1);\n\n\t\t\t\treturn owner && field !== undefined ? this.fieldClass(owner, field) : undefined;\n\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate fieldClass(cls: ClassRef, field: string, depth = 0): ClassRef | undefined {\n\t\tif (depth > MAX_DEPTH) return undefined;\n\n\t\tconst type = cls.info.fields.get(field);\n\n\t\tif (type !== undefined) return this.resolveClass(cls.file, type);\n\n\t\tconst parent = this.superClass(cls);\n\n\t\treturn parent ? this.fieldClass(parent, field, depth + 1) : undefined;\n\t}\n\n\tprivate findMethod(cls: ClassRef, name: string, depth = 0): Target | undefined {\n\t\tif (depth > MAX_DEPTH) return undefined;\n\n\t\tconst fn = cls.info.methods.get(name);\n\n\t\tif (fn) return { kind: \"method\", file: cls.file, cls, name, fn };\n\n\t\tconst parent = this.superClass(cls);\n\n\t\treturn parent ? this.findMethod(parent, name, depth + 1) : undefined;\n\t}\n\n\tprivate superClass(cls: ClassRef): ClassRef | undefined {\n\t\treturn cls.info.superClass === undefined ? undefined : this.resolveClass(cls.file, cls.info.superClass);\n\t}\n\n\tprivate resolveClass(file: string, localName: string): ClassRef | undefined {\n\t\tconst found = this.resolveLocal(file, localName);\n\t\tconst info = found ? this.summary(found.file)?.classes.get(found.local) : undefined;\n\n\t\treturn found && info ? { file: found.file, info } : undefined;\n\t}\n\n\t/** Finds where a name used in `file` is declared, following imports and re-exports. */\n\tprivate resolveLocal(file: string, localName: string, depth = 0): { file: string; local: string } | undefined {\n\t\tconst summary = this.summary(file);\n\n\t\tif (!summary || depth > MAX_DEPTH) return undefined;\n\t\tif (summary.classes.has(localName) || summary.functions.has(localName)) return { file, local: localName };\n\n\t\tconst imported = summary.imports.get(localName);\n\n\t\treturn imported?.module === undefined\n\t\t\t? undefined\n\t\t\t: this.resolveExport(imported.module, imported.imported, depth + 1);\n\t}\n\n\tprivate resolveExport(file: string, exported: string, depth: number): { file: string; local: string } | undefined {\n\t\tconst summary = this.summary(file);\n\n\t\tif (!summary || depth > MAX_DEPTH) return undefined;\n\n\t\tconst local = summary.exports.get(exported);\n\n\t\tif (local !== undefined) return this.resolveLocal(file, local, depth + 1);\n\n\t\tconst reexport = summary.reexports.get(exported);\n\n\t\tif (reexport) {\n\t\t\treturn reexport.module === undefined\n\t\t\t\t? undefined\n\t\t\t\t: this.resolveExport(reexport.module, reexport.imported, depth + 1);\n\t\t}\n\n\t\tfor (const module of summary.starExports) {\n\t\t\tconst found = this.resolveExport(module, exported, depth + 1);\n\n\t\t\tif (found) return found;\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n\n/** Local variables whose class is known: `const x = new X()` and `const x: X = ...`. */\nfunction collectLocals(fn: FunctionLike): Map<string, string> {\n\tconst locals = new Map<string, string>();\n\n\tif (!fn.body) return locals;\n\n\twalk(fn.body, node => {\n\t\tif (node.type !== \"VariableDeclarator\" || node.id.type !== \"Identifier\") return;\n\n\t\tconst type = typeName(node.id.typeAnnotation) ?? newName(node.init);\n\n\t\tif (type !== undefined) locals.set(node.id.name, type);\n\t});\n\n\treturn locals;\n}\n","import type { CallExpression, Node, Program } from \"oxc-parser\";\n\nimport { docsUrl } from \"../utils/docs\";\nimport { pollCallback, pollingMethod } from \"../utils/polling\";\nimport { ProjectIndex, summarize } from \"../utils/project-index\";\nimport type { Hit, Scope } from \"../utils/project-index\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { normalize } from \"../utils/sparta-paths\";\nimport type { AstNode, Rule } from \"../utils/types\";\n\ntype FunctionNode = Extract<\n\tAstNode,\n\t{ type: \"ArrowFunctionExpression\" | \"FunctionExpression\" | \"FunctionDeclaration\" }\n>;\n\nconst isFunction = (node: AstNode): node is FunctionNode =>\n\tnode.type === \"ArrowFunctionExpression\" || node.type === \"FunctionExpression\" || node.type === \"FunctionDeclaration\";\n\n/** The class around `node`, and the outermost function inside that class (the method), for resolving `this` and locals. */\nfunction enclosing(node: AstNode): { classNode?: AstNode; fn?: FunctionNode } {\n\tlet fn: FunctionNode | undefined;\n\n\tfor (let current: AstNode | null = node.parent; current; current = current.parent) {\n\t\tif (current.type === \"ClassDeclaration\" || current.type === \"ClassExpression\") return { classNode: current, fn };\n\t\tif (isFunction(current)) fn = current;\n\t}\n\n\treturn { fn };\n}\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription:\n\t\t\t\t\"Disallow polling (`toPass`, `poll`, ...) inside the callback of another poll, also through calls into other files.\",\n\t\t\turl: docsUrl(\"no-nested-polling\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tnested:\n\t\t\t\t\"'{{inner}}' polls inside the callback of '{{outer}}'. Nested polling multiplies the timeouts; poll once, at the outermost level.\",\n\t\t\tnestedCall:\n\t\t\t\t\"'{{call}}' polls inside the callback of '{{outer}}' (via {{path}}). Nested polling multiplies the timeouts; poll once, at the outermost level.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst { sourceCode } = context;\n\t\tconst conventions = conventionsFor(context);\n\t\tconst { pollingMethods } = conventions;\n\n\t\tif (![...pollingMethods].some(method => sourceCode.text.includes(method))) return {};\n\n\t\tlet index: ProjectIndex | undefined;\n\n\t\tconst getIndex = (): ProjectIndex =>\n\t\t\t(index ??= new ProjectIndex(\n\t\t\t\tsummarize(\n\t\t\t\t\tnormalize(context.filename),\n\t\t\t\t\tsourceCode.ast as unknown as Program,\n\t\t\t\t\trootFor(context, conventions),\n\t\t\t\t\tconventions\n\t\t\t\t)\n\t\t\t));\n\n\t\tconst report = (hit: Hit, outer: string): void => {\n\t\t\tconst node = hit.node as unknown as AstNode;\n\n\t\t\tif (\"method\" in hit) {\n\t\t\t\tcontext.report({ node, messageId: \"nested\", data: { inner: hit.method, outer } });\n\t\t\t} else {\n\t\t\t\tconst callee = sourceCode.getText(hit.node.callee as unknown as AstNode);\n\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode,\n\t\t\t\t\tmessageId: \"nestedCall\",\n\t\t\t\t\tdata: { call: `${callee}()`, outer, path: hit.path.join(\" → \") },\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\tCallExpression(node): void {\n\t\t\t\tconst call = node as unknown as CallExpression;\n\t\t\t\tconst outer = pollingMethod(call, pollingMethods);\n\t\t\t\tconst callback = outer === undefined ? undefined : pollCallback(call, pollingMethods);\n\n\t\t\t\tif (outer === undefined || callback === undefined) return;\n\n\t\t\t\tconst { classNode, fn } = enclosing(node);\n\t\t\t\tconst projectIndex = getIndex();\n\t\t\t\t// Locals come from the enclosing method, or from the callback itself for module-level polls.\n\t\t\t\tconst scope: Scope = projectIndex.scopeFor(\n\t\t\t\t\tclassNode as unknown as Node | undefined,\n\t\t\t\t\tfn ? (fn as unknown as Node) : callback\n\t\t\t\t);\n\n\t\t\t\tif (callback.type === \"ArrowFunctionExpression\" || callback.type === \"FunctionExpression\") {\n\t\t\t\t\tfor (const hit of projectIndex.collectHits(callback.body as Node, scope)) report(hit, outer);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// A reference such as `this.fetchStatus` or `fetchStatus`: the referenced function is the callback.\n\t\t\t\tconst target = projectIndex.resolveReference(callback, scope);\n\t\t\t\tconst path = target ? projectIndex.pollingPath(target) : undefined;\n\n\t\t\t\tif (path) {\n\t\t\t\t\tcontext.report({\n\t\t\t\t\t\tnode: callback as unknown as AstNode,\n\t\t\t\t\t\tmessageId: \"nestedCall\",\n\t\t\t\t\t\tdata: { call: sourceCode.getText(callback as unknown as AstNode), outer, path: path.join(\" → \") },\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { docsUrl } from \"../utils/docs\";\nimport type { AstNode, NodeOfType, Rule } from \"../utils/types\";\n\ntype Statement = NodeOfType<\"Program\">[\"body\"][number];\n\ntype ObjectMember = NodeOfType<\"ObjectExpression\">[\"properties\"][number];\n\ntype MessageId = \"afterImports\" | \"aroundFunctions\" | \"betweenObjectMethods\";\n\nconst BLANK_LINE = /\\r?\\n[\\t ]*\\r?\\n/;\n\nconst unwrapExport = (node: Statement): AstNode =>\n\t(node.type === \"ExportNamedDeclaration\" || node.type === \"ExportDefaultDeclaration\") && node.declaration\n\t\t? node.declaration\n\t\t: node;\n\nconst isFunctionValue = (node: AstNode | null | undefined): boolean =>\n\tnode?.type === \"ArrowFunctionExpression\" ||\n\tnode?.type === \"FunctionExpression\" ||\n\tnode?.type === \"TSEmptyBodyFunctionExpression\";\n\nconst isImport = (node: Statement): boolean =>\n\tnode.type === \"ImportDeclaration\" ||\n\t(node.type === \"TSImportEqualsDeclaration\" && node.moduleReference.type === \"TSExternalModuleReference\");\n\nconst isFunctionStatement = (node: Statement): boolean => {\n\tconst statement = unwrapExport(node);\n\n\tif (\n\t\tstatement.type === \"FunctionDeclaration\" ||\n\t\tstatement.type === \"TSDeclareFunction\" ||\n\t\tisFunctionValue(statement)\n\t) {\n\t\treturn true;\n\t}\n\n\treturn statement.type === \"VariableDeclaration\" && statement.declarations.some(({ init }) => isFunctionValue(init));\n};\n\nconst functionStatementName = (node: Statement): string | undefined => {\n\tconst statement = unwrapExport(node);\n\n\treturn (statement.type === \"FunctionDeclaration\" || statement.type === \"TSDeclareFunction\") && statement.id\n\t\t? statement.id.name\n\t\t: undefined;\n};\n\nconst isOverloadPair = (previous: Statement, current: Statement): boolean => {\n\tconst name = functionStatementName(previous);\n\n\treturn (\n\t\tunwrapExport(previous).type === \"TSDeclareFunction\" && name !== undefined && name === functionStatementName(current)\n\t);\n};\n\nconst isMethodProperty = (property: ObjectMember): boolean =>\n\tproperty.type === \"Property\" && (property.method || property.kind !== \"init\" || isFunctionValue(property.value));\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"layout\",\n\t\tdocs: {\n\t\t\tdescription: \"Require blank lines after imports, around top-level functions and around object methods.\",\n\t\t\turl: docsUrl(\"padding-lines\"),\n\t\t},\n\t\tfixable: \"whitespace\",\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tafterImports: \"Expected a blank line after the import declarations.\",\n\t\t\taroundFunctions: \"Expected a blank line between a function and the adjacent statement.\",\n\t\t\tbetweenObjectMethods: \"Expected a blank line around methods in an object literal.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst { text } = context.sourceCode;\n\t\tconst lineBreak = text.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n\n\t\tconst requireBlankLine = (previous: AstNode, current: AstNode, messageId: MessageId): void => {\n\t\t\tconst textBetween = text.slice(previous.range[1], current.range[0]);\n\n\t\t\tif (BLANK_LINE.test(textBetween)) return;\n\n\t\t\tcontext.report({\n\t\t\t\tnode: current,\n\t\t\t\tmessageId,\n\n\t\t\t\tfix: fixer => {\n\t\t\t\t\tconst firstBreak = textBetween.search(/\\r?\\n/);\n\n\t\t\t\t\tif (firstBreak === -1) {\n\t\t\t\t\t\treturn fixer.insertTextAfterRange(previous.range, `${lineBreak}${lineBreak}`);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn fixer.insertTextAfterRange([0, previous.range[1] + firstBreak], lineBreak);\n\t\t\t\t},\n\t\t\t});\n\t\t};\n\n\t\tconst checkStatements = (statements: readonly Statement[]): void => {\n\t\t\tfor (let index = 1; index < statements.length; index++) {\n\t\t\t\tconst previous = statements[index - 1];\n\t\t\t\tconst current = statements[index];\n\n\t\t\t\tif (isImport(previous) && !isImport(current)) {\n\t\t\t\t\trequireBlankLine(previous, current, \"afterImports\");\n\t\t\t\t} else if (\n\t\t\t\t\t(isFunctionStatement(previous) || isFunctionStatement(current)) &&\n\t\t\t\t\t!isOverloadPair(previous, current)\n\t\t\t\t) {\n\t\t\t\t\trequireBlankLine(previous, current, \"aroundFunctions\");\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\tProgram: node => checkStatements(node.body),\n\n\t\t\tTSModuleBlock: node => checkStatements(node.body),\n\n\t\t\tObjectExpression(node): void {\n\t\t\t\tfor (let index = 1; index < node.properties.length; index++) {\n\t\t\t\t\tconst previous = node.properties[index - 1];\n\t\t\t\t\tconst current = node.properties[index];\n\n\t\t\t\t\tif (previous.loc.end.line === current.loc.start.line) continue;\n\n\t\t\t\t\tif (isMethodProperty(previous) || isMethodProperty(current)) {\n\t\t\t\t\t\trequireBlankLine(previous, current, \"betweenObjectMethods\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { docsUrl } from \"../utils/docs\";\nimport type { AstNode, NodeOfType, Rule } from \"../utils/types\";\n\ntype ClassMember = NodeOfType<\"ClassBody\">[\"body\"][number];\n\nconst isMethodLike = (member: ClassMember): boolean =>\n\t(member.type === \"MethodDefinition\" || member.type === \"TSAbstractMethodDefinition\") && member.kind !== \"constructor\";\n\nconst isPrivate = (member: ClassMember): boolean =>\n\t(\"accessibility\" in member && member.accessibility === \"private\") ||\n\t(\"key\" in member && member.key.type === \"PrivateIdentifier\");\n\nconst memberName = (member: ClassMember): string => {\n\tconst key: AstNode | undefined = \"key\" in member ? member.key : undefined;\n\n\tif (key && \"name\" in key && typeof key.name === \"string\") return key.name;\n\tif (key && \"value\" in key && typeof key.value === \"string\") return key.value;\n\n\treturn \"<computed>\";\n};\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"suggestion\",\n\t\tdocs: {\n\t\t\tdescription: \"Require public methods to be placed above private methods.\",\n\t\t\turl: docsUrl(\"private-members-last\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tprivateMembersLast:\n\t\t\t\t\"Public method '{{name}}' must be placed above all private methods (private method '{{privateName}}' comes first).\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\treturn {\n\t\t\tClassBody(node): void {\n\t\t\t\tlet firstPrivate: ClassMember | undefined;\n\n\t\t\t\tfor (const member of node.body) {\n\t\t\t\t\tif (!isMethodLike(member)) continue;\n\n\t\t\t\t\tif (isPrivate(member)) {\n\t\t\t\t\t\tfirstPrivate ??= member;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (firstPrivate !== undefined) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tnode: member,\n\t\t\t\t\t\t\tmessageId: \"privateMembersLast\",\n\t\t\t\t\t\t\tdata: { name: memberName(member), privateName: memberName(firstPrivate) },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { isStepDecorator } from \"../utils/ast\";\nimport { docsUrl } from \"../utils/docs\";\nimport { conventionsFor } from \"../utils/settings\";\nimport type { AstNode, Rule } from \"../utils/types\";\n\n/** The same pattern `@step` uses at runtime: the path is taken as written, so `{{ name }}` looks up \" name \". */\nconst NAMED = /\\{\\{(.*?)\\}\\}/g;\n\nconst INDEX = /\\[\\[(\\d+)\\]\\]/g;\n\nconst SINGLE_BRACES = /(^|[^{])\\{([A-Za-z_$][\\w$]*(?:\\.[\\w$]+)*)\\}(?!\\})/g;\n\nconst findAll = (pattern: RegExp, text: string): RegExpExecArray[] => {\n\tconst regex = new RegExp(pattern.source, \"g\");\n\tconst found: RegExpExecArray[] = [];\n\n\tfor (let match = regex.exec(text); match !== null; match = regex.exec(text)) {\n\t\tfound.push(match);\n\t}\n\n\treturn found;\n};\n\nconst paramName = (param: AstNode): string | undefined => {\n\tconst target = param.type === \"TSParameterProperty\" ? param.parameter : param;\n\tconst binding =\n\t\ttarget.type === \"AssignmentPattern\" ? target.left : target.type === \"RestElement\" ? target.argument : target;\n\n\treturn binding.type === \"Identifier\" ? binding.name : undefined;\n};\n\n/**\n * What is wrong with the path of a `{{path}}` placeholder, if anything. `@step` reads the path exactly as written,\n * so spaces around it either fail the parameter lookup or read a property that does not exist.\n */\nconst namedProblem = (\n\tpath: string,\n\tnames: readonly (string | undefined)[]\n): \"whitespace\" | \"unknownParameter\" | undefined => {\n\tconst trimmed = path.trim();\n\tconst isParameter = (value: string): boolean => names.includes(value.split(\".\")[0]);\n\n\tif (trimmed !== path && isParameter(trimmed)) return \"whitespace\";\n\n\treturn trimmed === path && isParameter(path) ? undefined : \"unknownParameter\";\n};\n\nconst isLiteralDescription = (node: AstNode): boolean =>\n\t(node.type === \"Literal\" && typeof node.value === \"string\") ||\n\t(node.type === \"TemplateLiteral\" && node.expressions.length === 0);\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"problem\",\n\t\tdocs: {\n\t\t\tdescription: \"Validate the placeholders in `@step` descriptions against the method parameters.\",\n\t\t\turl: docsUrl(\"step-placeholders\"),\n\t\t},\n\t\tfixable: \"code\",\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tsingleBraces: \"'{{found}}' is printed literally; use '{{expected}}' for a named placeholder.\",\n\t\t\twhitespace:\n\t\t\t\t\"'{{found}}' does not resolve, because @step does not trim the spaces inside placeholders; use '{{expected}}'.\",\n\t\t\tunknownParameter: \"Placeholder '{{found}}' does not match a parameter of '{{method}}' ({{params}}).\",\n\t\t\tindexOutOfRange: \"Placeholder '{{found}}' is out of range; '{{method}}' has {{count}} parameter(s).\",\n\t\t\tnotLast: \"@step must be the decorator directly above the method, otherwise placeholders cannot be resolved.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst { stepDecorators } = conventionsFor(context);\n\n\t\t/** Reports a `{{path}}` placeholder in `description` that `@step` cannot resolve. */\n\t\tconst checkNamed = (\n\t\t\tdescription: AstNode,\n\t\t\tmatch: RegExpExecArray,\n\t\t\tnames: readonly (string | undefined)[],\n\t\t\tmethodName: string\n\t\t): void => {\n\t\t\tconst problem = namedProblem(match[1], names);\n\n\t\t\tif (problem === \"whitespace\") {\n\t\t\t\tconst from = description.range[0] + match.index;\n\t\t\t\tconst range: [number, number] = [from, from + match[0].length];\n\t\t\t\tconst expected = `{{${match[1].trim()}}}`;\n\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: description,\n\t\t\t\t\tmessageId: \"whitespace\",\n\t\t\t\t\tdata: { found: match[0], expected },\n\n\t\t\t\t\tfix: fixer => fixer.replaceTextRange(range, expected),\n\t\t\t\t});\n\t\t\t} else if (problem === \"unknownParameter\") {\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: description,\n\t\t\t\t\tmessageId: \"unknownParameter\",\n\t\t\t\t\tdata: { found: match[0], method: methodName, params: names.filter(Boolean).join(\", \") || \"none\" },\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\tDecorator(node): void {\n\t\t\t\tif (!isStepDecorator(node, stepDecorators)) return;\n\n\t\t\t\tconst method = node.parent;\n\n\t\t\t\tif (method.type !== \"MethodDefinition\") return;\n\n\t\t\t\tconst { decorators } = method;\n\n\t\t\t\tif (decorators[decorators.length - 1] !== node) {\n\t\t\t\t\tcontext.report({ node, messageId: \"notLast\" });\n\t\t\t\t}\n\n\t\t\t\tconst { expression } = node;\n\t\t\t\tconst description = expression.type === \"CallExpression\" ? expression.arguments[0] : undefined;\n\n\t\t\t\tif (!description || !isLiteralDescription(description)) return;\n\n\t\t\t\tconst { params } = method.value;\n\t\t\t\tconst names = params.map(paramName);\n\t\t\t\tconst hasRest = params.some(param => param.type === \"RestElement\");\n\t\t\t\tconst methodName = context.sourceCode.getText(method.key);\n\t\t\t\tconst raw = context.sourceCode.getText(description);\n\t\t\t\tconst start = description.range[0];\n\n\t\t\t\tfor (const match of findAll(NAMED, raw)) checkNamed(description, match, names, methodName);\n\n\t\t\t\tfor (const match of findAll(INDEX, raw)) {\n\t\t\t\t\tconst index = Number(match[1]);\n\n\t\t\t\t\tif (!hasRest && index >= params.length) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tnode: description,\n\t\t\t\t\t\t\tmessageId: \"indexOutOfRange\",\n\t\t\t\t\t\t\tdata: { found: match[0], method: methodName, count: String(params.length) },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (const match of findAll(SINGLE_BRACES, raw)) {\n\t\t\t\t\tconst placeholder = match[2];\n\t\t\t\t\tconst from = start + match.index + match[1].length;\n\t\t\t\t\tconst range: [number, number] = [from, from + placeholder.length + 2];\n\t\t\t\t\tconst data = { found: `{${placeholder}}`, expected: `{{${placeholder}}}` };\n\n\t\t\t\t\tif (names.includes(placeholder.split(\".\")[0])) {\n\t\t\t\t\t\tcontext.report({\n\t\t\t\t\t\t\tnode: description,\n\t\t\t\t\t\t\tmessageId: \"singleBraces\",\n\t\t\t\t\t\t\tdata,\n\n\t\t\t\t\t\t\tfix: fixer => fixer.replaceTextRange(range, data.expected),\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontext.report({ node: description, messageId: \"singleBraces\", data });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import { isStepDecorator } from \"../utils/ast\";\nimport { docsUrl } from \"../utils/docs\";\nimport { conventionsFor, rootFor } from \"../utils/settings\";\nimport { classify } from \"../utils/sparta-paths\";\nimport type { Rule } from \"../utils/types\";\n\nconst STEP_LAYERS = new Set([\"stepper\", \"asserter\", \"scenario\"]);\n\nconst rule: Rule = {\n\tmeta: {\n\t\ttype: \"suggestion\",\n\t\tdocs: {\n\t\t\tdescription: \"Require a `@step` decorator on public methods of steppers, asserters and scenarios.\",\n\t\t\turl: docsUrl(\"step-required\"),\n\t\t},\n\t\tschema: [],\n\t\tmessages: {\n\t\t\tmissingStep: \"Public method '{{method}}' in a {{layer}} needs a @step decorator so it is visible in the report.\",\n\t\t},\n\t},\n\n\tcreate(context) {\n\t\tconst conventions = conventionsFor(context);\n\t\tconst info = classify(context.filename, conventions, rootFor(context, conventions));\n\t\tconst layer = info?.kind === \"top-scenario\" ? \"scenario\" : info?.layer;\n\n\t\tif (layer === undefined || !STEP_LAYERS.has(layer)) return {};\n\n\t\treturn {\n\t\t\tMethodDefinition(node): void {\n\t\t\t\tif (\n\t\t\t\t\tnode.kind !== \"method\" ||\n\t\t\t\t\tnode.key.type === \"PrivateIdentifier\" ||\n\t\t\t\t\tnode.accessibility === \"private\" ||\n\t\t\t\t\tnode.accessibility === \"protected\" ||\n\t\t\t\t\tnode.value.type === \"TSEmptyBodyFunctionExpression\" ||\n\t\t\t\t\tnode.decorators.some(decorator => isStepDecorator(decorator, conventions.stepDecorators))\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tcontext.report({\n\t\t\t\t\tnode: node.key,\n\t\t\t\t\tmessageId: \"missingStep\",\n\t\t\t\t\tdata: { method: context.sourceCode.getText(node.key), layer },\n\t\t\t\t});\n\t\t\t},\n\t\t};\n\t},\n};\n\nexport default rule;\n","import type { Rule } from \"../utils/types\";\n\nimport architectureBoundaries from \"./architecture-boundaries\";\nimport classMatchesFilename from \"./class-matches-filename\";\nimport expectFromSupport from \"./expect-from-support\";\nimport fileNaming from \"./file-naming\";\nimport linesBetweenClassMembers from \"./lines-between-class-members\";\nimport noDirectConstructionInTests from \"./no-direct-construction-in-tests\";\nimport noExpectInTests from \"./no-expect-in-tests\";\nimport noHardWaits from \"./no-hard-waits\";\nimport noNestedPolling from \"./no-nested-polling\";\nimport paddingLines from \"./padding-lines\";\nimport privateMembersLast from \"./private-members-last\";\nimport stepPlaceholders from \"./step-placeholders\";\nimport stepRequired from \"./step-required\";\n\nexport const rules = {\n\t\"architecture-boundaries\": architectureBoundaries,\n\t\"class-matches-filename\": classMatchesFilename,\n\t\"expect-from-support\": expectFromSupport,\n\t\"file-naming\": fileNaming,\n\t\"lines-between-class-members\": linesBetweenClassMembers,\n\t\"no-direct-construction-in-tests\": noDirectConstructionInTests,\n\t\"no-expect-in-tests\": noExpectInTests,\n\t\"no-hard-waits\": noHardWaits,\n\t\"no-nested-polling\": noNestedPolling,\n\t\"padding-lines\": paddingLines,\n\t\"private-members-last\": privateMembersLast,\n\t\"step-placeholders\": stepPlaceholders,\n\t\"step-required\": stepRequired,\n} satisfies Record<string, Rule>;\n\nexport type RuleName = keyof typeof rules;\n\nexport const PLUGIN_NAME = \"sparta\";\n\nexport type Severity = \"error\" | \"warn\";\n\n/** Recommended severities: `problem` rules are errors, `suggestion` and `layout` rules are warnings. */\nexport const recommendedRules = Object.fromEntries(\n\tObject.entries(rules).map(([name, rule]) => [\n\t\t`${PLUGIN_NAME}/${name}`,\n\t\trule.meta?.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