lint-suite 1.6.2 → 1.6.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/README.md +149 -2
- package/eslint.cjs +1049 -309
- package/eslint.cjs.map +4 -4
- package/eslint.js +938 -175
- package/eslint.js.map +4 -4
- package/lib/angular-template.d.ts +1 -0
- package/lib/angular-template.d.ts.map +1 -1
- package/lib/angular.d.ts.map +1 -1
- package/lib/base-practices.d.ts.map +1 -1
- package/lib/line-length.const.d.ts +2 -0
- package/lib/line-length.const.d.ts.map +1 -0
- package/lib/rules/common/class-usage.type.d.ts +25 -0
- package/lib/rules/common/class-usage.type.d.ts.map +1 -0
- package/lib/rules/component-metadata.d.ts +5 -0
- package/lib/rules/component-metadata.d.ts.map +1 -0
- package/lib/rules/no-unstyled-classes/common/no-unstyled-classes.type.d.ts +33 -0
- package/lib/rules/no-unstyled-classes/common/no-unstyled-classes.type.d.ts.map +1 -0
- package/lib/rules/no-unstyled-classes/no-unstyled-classes.d.ts +8 -0
- package/lib/rules/no-unstyled-classes/no-unstyled-classes.d.ts.map +1 -0
- package/lib/rules/no-unstyled-classes/styles/component-stylesheets.d.ts +4 -0
- package/lib/rules/no-unstyled-classes/styles/component-stylesheets.d.ts.map +1 -0
- package/lib/rules/no-unstyled-classes/styles/stylesheet-classes.d.ts +3 -0
- package/lib/rules/no-unstyled-classes/styles/stylesheet-classes.d.ts.map +1 -0
- package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts +4 -0
- package/lib/rules/no-unstyled-classes/styles/stylesheet-collection.d.ts.map +1 -0
- package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts +2 -0
- package/lib/rules/no-unstyled-classes/styles/stylesheet-imports.d.ts.map +1 -0
- package/lib/rules/no-unstyled-classes/styles/template-stylesheets.d.ts +3 -0
- package/lib/rules/no-unstyled-classes/styles/template-stylesheets.d.ts.map +1 -0
- package/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-literals.d.ts.map +1 -1
- package/lib/rules/no-unused-classes/common/no-unused-classes.type.d.ts +24 -0
- package/lib/rules/no-unused-classes/common/no-unused-classes.type.d.ts.map +1 -0
- package/lib/rules/no-unused-classes/no-unused-classes.d.ts +8 -0
- package/lib/rules/no-unused-classes/no-unused-classes.d.ts.map +1 -0
- package/lib/rules/no-unused-classes/styles/component-descriptors.d.ts +3 -0
- package/lib/rules/no-unused-classes/styles/component-descriptors.d.ts.map +1 -0
- package/lib/rules/no-unused-classes/styles/stylesheet-components.d.ts +3 -0
- package/lib/rules/no-unused-classes/styles/stylesheet-components.d.ts.map +1 -0
- package/lib/rules/no-unused-classes/template/template-usage.d.ts +3 -0
- package/lib/rules/no-unused-classes/template/template-usage.d.ts.map +1 -0
- package/lib/rules/one-line-guard/one-line-guard.d.ts +10 -0
- package/lib/rules/one-line-guard/one-line-guard.d.ts.map +1 -0
- package/lib/rules/utils/class-expression-literals.util.d.ts +4 -0
- package/lib/rules/utils/class-expression-literals.util.d.ts.map +1 -0
- package/lib/rules/utils/resolved-rules.util.d.ts +5 -0
- package/lib/rules/utils/resolved-rules.util.d.ts.map +1 -0
- package/lib/rules/utils/selector-classes.util.d.ts +7 -0
- package/lib/rules/utils/selector-classes.util.d.ts.map +1 -0
- package/lib/rules/utils/template-classes.util.d.ts +3 -0
- package/lib/rules/utils/template-classes.util.d.ts.map +1 -0
- package/lib/typescript-local-plugin.d.ts.map +1 -1
- package/lib/typescript-safety.d.ts.map +1 -1
- package/package.json +4 -1
- package/prettier.cjs +6 -1
- package/prettier.cjs.map +3 -3
- package/prettier.d.ts.map +1 -1
- package/prettier.js +4 -1
- package/prettier.js.map +3 -3
- package/stylelint.cjs +680 -4
- package/stylelint.cjs.map +4 -4
- package/stylelint.d.ts.map +1 -1
- package/stylelint.js +708 -4
- package/stylelint.js.map +4 -4
package/eslint.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../packages/lint-suite/src/eslint.ts", "../../../../packages/lint-suite/src/lib/angular-template.ts", "../../../../packages/lint-suite/src/lib/
|
|
4
|
-
"sourcesContent": ["import type { ConfigArray } from 'typescript-eslint';\n\nimport { angularTemplate } from './lib/angular-template.ts';\nimport { angular } from './lib/angular.ts';\nimport { base } from './lib/base.ts';\nimport { boundaries } from './lib/boundaries.ts';\nimport { javascript } from './lib/javascript.ts';\nimport { json } from './lib/json.ts';\nimport { playwright } from './lib/playwright.ts';\nimport { prettier } from './lib/prettier.ts';\nimport { rxjs } from './lib/rxjs.ts';\nimport { storybook } from './lib/storybook.ts';\nimport { typescript } from './lib/typescript.ts';\nimport { vitest } from './lib/vitest.ts';\n\nexport const recommended: ConfigArray = [\n ...base,\n ...javascript,\n ...typescript,\n ...json,\n ...boundaries,\n ...prettier // Must be last to disable formatting rules that conflict with Prettier\n];\n\nexport {\n base,\n javascript,\n typescript,\n angular,\n angularTemplate,\n rxjs,\n json,\n boundaries,\n storybook,\n vitest,\n playwright,\n prettier\n};\n", "import { configs } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\n\nexport const angularTemplate = defineConfig([\n {\n files: ['**/*.html'],\n extends: [...configs.templateAccessibility, ...configs.templateRecommended],\n rules: {\n '@angular-eslint/template/prefer-template-literal': 'error',\n '@angular-eslint/template/no-any': 'error',\n '@angular-eslint/template/no-duplicate-attributes': 'error',\n '@angular-eslint/template/button-has-type': 'error',\n '@angular-eslint/template/no-positive-tabindex': 'error',\n '@angular-eslint/template/valid-aria': 'error',\n '@angular-eslint/template/alt-text': 'error',\n '@angular-eslint/template/elements-content': 'error',\n '@angular-eslint/template/click-events-have-key-events': 'error',\n '@angular-eslint/template/mouse-events-have-key-events': 'error',\n '@angular-eslint/template/table-scope': 'error',\n '@angular-eslint/template/no-autofocus': 'error',\n '@angular-eslint/template/no-distracting-elements': 'error',\n '@angular-eslint/template/prefer-control-flow': 'error',\n '@angular-eslint/template/prefer-self-closing-tags': 'error',\n '@angular-eslint/template/prefer-ngsrc': 'error',\n '@angular-eslint/template/prefer-built-in-pipes': 'error',\n '@angular-eslint/template/no-interpolation-in-attributes': 'error',\n '@angular-eslint/template/no-nested-tags': 'error',\n '@angular-eslint/template/use-track-by-function': 'error',\n '@angular-eslint/template/label-has-associated-control': 'error',\n '@angular-eslint/template/prefer-at-else': 'error', // v21: @if/@else syntax\n '@angular-eslint/template/prefer-at-empty': 'error', // v21: @for/@empty syntax\n '@angular-eslint/template/prefer-contextual-for-variables': 'error', // v21: Use $index, $first, etc.\n '@angular-eslint/template/no-empty-control-flow': 'error', // v21: Catch incomplete refactoring\n '@angular-eslint/template/prefer-class-binding': 'error', // v21.2.0: Prefer [class] over ngClass\n '@angular-eslint/template/prefer-static-string-properties': 'error', // Reduce change detection\n '@angular-eslint/template/no-non-null-assertion': 'error', // Forbid `!` assertions in templates\n '@angular-eslint/template/no-inline-styles': 'error', // Forbid inline style=\"...\" attributes\n '@angular-eslint/template/conditional-complexity': [\n 'warn',\n { maxComplexity: 5 }\n ], // Template readability\n '@angular-eslint/template/attributes-order': [\n 'error',\n {\n alphabetical: true,\n order: [\n 'STRUCTURAL_DIRECTIVE', // e.g. `*ngIf=\"true\"`, `*ngFor=\"let item of items\"`\n 'TEMPLATE_REFERENCE', // e.g. `<input #inputRef>`\n 'INPUT_BINDING', // e.g. `[id]=\"3\"`, `[attr.colspan]=\"colspan\"`, [style.width.%]=\"100\", [@triggerName]=\"expression\", `bind-id=\"handleChange()\"`\n 'TWO_WAY_BINDING', // e.g. `[(id)]=\"id\"`, `bindon-id=\"id\"\n 'ATTRIBUTE_BINDING', // e.g. `<input required>`, `id=\"3\"`\n 'OUTPUT_BINDING' // e.g. `(idChange)=\"handleChange()\"`, `on-id=\"handleChange()\"`\n ]\n }\n ]\n }\n }\n]);\n", "import { configs, processInlineTemplates } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\nimport globals from 'globals';\n\nimport { definePlugin } from './rules/define-plugin.util.ts';\nimport noUnusedInstanceFieldsRule from './rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.ts';\n\nexport const lintSuiteAngularPlugin = definePlugin('lint-suite-angular', {\n 'no-unused-instance-fields': noUnusedInstanceFieldsRule\n});\n\nexport const angular = defineConfig([\n {\n files: ['**/*.ts'],\n extends: [...configs.tsRecommended],\n plugins: {\n 'lint-suite-angular': lintSuiteAngularPlugin\n },\n languageOptions: {\n globals: {\n ...globals.browser,\n ...globals.es2025,\n ...globals.node\n },\n parserOptions: {\n projectService: true\n }\n },\n processor: processInlineTemplates,\n rules: {\n 'lint-suite-angular/no-unused-instance-fields': [\n 'error',\n { analysis: 'project' }\n ],\n '@angular-eslint/prefer-on-push-component-change-detection': 'error', // v22: flags only explicit opt-out of OnPush (omission now means OnPush)\n '@angular-eslint/prefer-signals': 'error',\n '@angular-eslint/use-injectable-provided-in': 'error',\n '@angular-eslint/prefer-signal-model': 'error',\n '@angular-eslint/no-uncalled-signals': 'error',\n '@angular-eslint/prefer-host-metadata-property': 'error',\n '@angular-eslint/no-implicit-take-until-destroyed': 'error', // v21.2.0: Enforce explicit DestroyRef\n '@angular-eslint/no-async-lifecycle-method': 'error', // Prevent async lifecycle hooks\n '@angular-eslint/prefer-output-readonly': 'warn', // Prevent accidental reassignment\n '@angular-eslint/prefer-output-emitter-ref': 'warn', // Modern output() function over @Output()\n '@angular-eslint/sort-lifecycle-methods': 'warn', // Consistent lifecycle method ordering\n '@angular-eslint/computed-must-return': 'error', // Catch silent computed() bugs missing a return\n '@angular-eslint/no-duplicates-in-metadata-arrays': 'error', // Catch duplicate imports/providers in @Component/@NgModule\n '@angular-eslint/no-lifecycle-call': 'error', // Forbid manual this.ngOnInit() calls\n '@angular-eslint/require-lifecycle-on-prototype': 'error', // Lifecycle hooks must be methods, not arrow-fn fields\n '@angular-eslint/relative-url-prefix': 'error', // Require ./ in templateUrl/styleUrl for portability\n '@angular-eslint/use-component-selector': 'error', // All components must declare a selector\n '@angular-eslint/no-developer-preview': 'warn', // Flag APIs marked @developerPreview (no breaking-change policy)\n '@angular-eslint/no-experimental': 'warn' // Flag APIs marked @experimental\n }\n }\n]);\n", "import type { TSESLint } from '@typescript-eslint/utils';\nimport type { CompatiblePlugin } from 'typescript-eslint';\n\ntype Rules = NonNullable<TSESLint.FlatConfig.Plugin['rules']>;\n\nexport const definePlugin = (name: string, rules: Rules): CompatiblePlugin => {\n const meta = { name };\n const plugin = { meta, rules };\n\n return plugin;\n};\n", "import { ESLintUtils } from '@typescript-eslint/utils';\nimport type {\n JSONSchema,\n ParserServicesWithTypeInformation,\n TSESLint,\n TSESTree\n} from '@typescript-eslint/utils';\n\nimport { reportUnusedMembers } from './angular/angular-class-fields.ts';\nimport { angularClassImports } from './angular/angular-imports.ts';\nimport type {\n ClassEntry,\n DynamicClasses,\n MessageIds,\n ProjectMemberUsed,\n ReportUnusedMembersOptions,\n RuleContext,\n RuleOptions\n} from './common/no-unused-angular-instance-fields.type.ts';\nimport { classReadVisitor } from './typescript/typescript-class-read-visitor.ts';\nimport type { ProjectUsageIndex } from '../project-usage/common/project-index.type.ts';\nimport {\n projectUsage,\n projectUsageIsCurrent\n} from '../project-usage/project-usage.ts';\nimport { isSpecFile } from '../project-usage/utils/spec-file.util.ts';\n\ntype Options = [RuleOptions];\ntype Analysis = NonNullable<RuleOptions['analysis']>;\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow unread instance fields and methods in Angular components and directives'\n};\n\nconst messages: Record<MessageIds, string> = {\n unusedField: \"Angular instance field '{{name}}' is never read.\",\n unusedMethod: \"Angular instance method '{{name}}' is never read.\"\n};\n\nconst allowEffectFieldsSchema: JSONSchema.JSONSchema4 = {\n type: 'boolean',\n description: 'Allow Angular effect() fields with automatic cleanup.'\n};\n\nconst analysisSchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['local', 'project'],\n description: 'Choose local-file or typed whole-project analysis.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n allowEffectFields: allowEffectFieldsSchema,\n analysis: analysisSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = {\n allowEffectFields: false,\n analysis: 'local'\n};\n\nconst defaultOptions: Options = [ruleDefaults];\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://eslint.org/docs/latest/rules/no-unused-private-class-members'\n);\n\nconst projectParserServices = (\n context: RuleContext,\n analysis: Analysis\n): ParserServicesWithTypeInformation | undefined => {\n if (analysis !== 'project') return undefined;\n\n try {\n return ESLintUtils.getParserServices(context);\n } catch {\n throw new Error(\n 'Project analysis requires parser services with type information.'\n );\n }\n};\n\nconst projectMemberUsedFor = (\n parserServices: ParserServicesWithTypeInformation | undefined\n): ProjectMemberUsed | undefined => {\n if (parserServices === undefined) return undefined;\n\n let usage: ProjectUsageIndex | null | undefined;\n\n const memberUsed = (node: TSESTree.ClassElement): boolean => {\n if (usage === undefined) {\n usage = projectUsage(parserServices.program);\n }\n\n return usage?.has(parserServices.esTreeNodeToTSNodeMap.get(node)) ?? true;\n };\n\n return memberUsed;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-unused-instance-fields',\n meta,\n defaultOptions,\n create(context, [options]): TSESLint.RuleListener {\n const analysis = options.analysis ?? 'local';\n const isSpec = isSpecFile(context.filename);\n const noListeners: TSESLint.RuleListener = {};\n\n if (analysis === 'project' && isSpec) return noListeners;\n\n const parserServices = projectParserServices(context, analysis);\n const imports = angularClassImports(context.sourceCode.ast);\n\n if (!imports) return noListeners;\n\n const classes: ClassEntry[] = [];\n const stack: ClassEntry[] = [];\n const dynamicClasses: DynamicClasses = new Set();\n\n const projectIndexed = (): boolean => {\n if (parserServices === undefined) return false;\n\n return projectUsageIsCurrent(parserServices.program);\n };\n\n const reportOptions: ReportUnusedMembersOptions = {\n allowEffectFields: options.allowEffectFields ?? false,\n classes,\n context,\n dynamicClasses,\n imports,\n projectIndexed,\n projectMemberUsed: projectMemberUsedFor(parserServices)\n };\n\n const readListeners = classReadVisitor(classes, stack, dynamicClasses);\n const listeners: TSESLint.RuleListener = {\n ...readListeners,\n 'Program:exit'(): void {\n reportUnusedMembers(reportOptions);\n }\n };\n\n return listeners;\n }\n});\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n AngularImport,\n AngularImports\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst calleeRoot = (\n node: TSESTree.Expression\n): TSESTree.Identifier | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) return node;\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.object.type === TSESTree.AST_NODE_TYPES.Super\n ) {\n return undefined;\n }\n\n return calleeRoot(node.object);\n};\n\nexport const angularName = (\n node: TSESTree.Expression,\n imports: AngularImports\n): AngularImport | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imports.get(node.name);\n }\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.computed ||\n node.property.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return null;\n }\n\n if (node.object.type === TSESTree.AST_NODE_TYPES.Identifier) {\n const namespaceAlias = imports.get(node.object.name);\n\n if (namespaceAlias === null) return node.property.name;\n }\n\n return angularName(node.object, imports);\n};\n\nexport const isImportBinding = (\n node: TSESTree.Expression,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const root = calleeRoot(node);\n\n if (!root) return false;\n\n for (\n let scope: TSESLint.Scope.Scope | null = sourceCode.getScope(root);\n scope;\n scope = scope.upper\n ) {\n const variable = scope.set.get(root.name);\n\n if (variable) return variable.defs[0]?.type === 'ImportBinding';\n }\n\n return false;\n};\n\nexport const addAngularImport = (\n node: TSESTree.ImportDeclaration,\n imports: AngularImports\n): void => {\n if (node.source.value !== '@angular/core' || node.importKind === 'type') {\n return;\n }\n\n for (const specifier of node.specifiers) {\n if (specifier.type === TSESTree.AST_NODE_TYPES.ImportNamespaceSpecifier) {\n imports.set(specifier.local.name, null);\n } else if (\n specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier &&\n specifier.importKind !== 'type'\n ) {\n const { imported } = specifier;\n const isIdentifier = imported.type === TSESTree.AST_NODE_TYPES.Identifier;\n const importedName = isIdentifier ? imported.name : imported.value;\n\n imports.set(specifier.local.name, importedName);\n }\n }\n};\n\nexport const angularClassMetadata = (\n node: AngularClassNode,\n imports: AngularImports\n): AngularClassMetadata | null => {\n for (const decorator of node.decorators) {\n if (decorator.expression.type !== TSESTree.AST_NODE_TYPES.CallExpression) {\n continue;\n }\n\n const kind = angularName(decorator.expression.callee, imports);\n const metadata = decorator.expression.arguments.at(0);\n\n const isComponentOrDirective = kind === 'Component' || kind === 'Directive';\n\n if (\n isComponentOrDirective &&\n metadata?.type === TSESTree.AST_NODE_TYPES.ObjectExpression\n ) {\n const classMetadata: AngularClassMetadata | null = {\n component: kind === 'Component',\n metadata\n };\n\n return classMetadata;\n }\n }\n\n return null;\n};\n\nexport const angularClassImports = (\n ast: TSESTree.Program\n): AngularImports | null => {\n const imports: AngularImports = new Map();\n\n for (const node of ast.body) {\n if (node.type === TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n addAngularImport(node, imports);\n }\n }\n\n for (const imported of imports.values()) {\n const isNamespaceImport = imported === null;\n const isComponent = imported === 'Component';\n const isDirective = imported === 'Directive';\n const isAngularClassImport =\n isNamespaceImport || isComponent || isDirective;\n\n if (isAngularClassImport) return imports;\n }\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n isAngularComponentRefField,\n isManagedField\n} from './angular-managed-fields.ts';\nimport type {\n AngularClassNode,\n FieldCandidateOptions,\n InstanceField,\n InstanceMethod,\n MemberCandidate\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst lifecycleHooks: ReadonlySet<string> = new Set([\n 'ngOnChanges',\n 'ngOnInit',\n 'ngDoCheck',\n 'ngAfterContentInit',\n 'ngAfterContentChecked',\n 'ngAfterViewInit',\n 'ngAfterViewChecked',\n 'ngOnDestroy'\n]);\n\nconst formsInterfaceMethods: Readonly<Record<string, string[]>> = {\n AsyncValidator: ['validate', 'registerOnValidatorChange'],\n ControlValueAccessor: [\n 'writeValue',\n 'registerOnChange',\n 'registerOnTouched',\n 'setDisabledState'\n ],\n Validator: ['validate', 'registerOnValidatorChange']\n};\n\nconst isInstanceField = (\n node: TSESTree.ClassElement\n): node is InstanceField => {\n if (node.type !== TSESTree.AST_NODE_TYPES.PropertyDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isInstanceMethod = (\n node: TSESTree.ClassElement\n): node is InstanceMethod => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isExcludedField = (\n node: InstanceField,\n localPrivateOnly: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const isModified = node.static || node.declare || node.override;\n const isDecorated = node.decorators.length > 0;\n\n if (isModified || isDecorated) return true;\n\n const isComponentRef = isAngularComponentRefField(node, sourceCode);\n\n if (isComponentRef) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nconst isExcludedMethod = (\n node: InstanceMethod,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): boolean => {\n const isModified = node.static || node.override || node.computed;\n const isDecorated = node.decorators.length > 0;\n const isPlainMethod = node.kind === 'method';\n\n if (isModified || isDecorated || !isPlainMethod) return true;\n\n const hasNoBody = node.value.body === null;\n const isLifecycleHook = lifecycleHooks.has(node.key.name);\n\n if (hasNoBody || isLifecycleHook) return true;\n\n const isImplemented = implementedMethods.has(node.key.name);\n\n if (isImplemented) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nexport const implementedFormsMethods = (\n node: AngularClassNode\n): Set<string> => {\n const methods = new Set<string>();\n\n for (const heritage of node.implements) {\n if (heritage.expression.type !== TSESTree.AST_NODE_TYPES.Identifier) {\n continue;\n }\n\n for (const name of formsInterfaceMethods[heritage.expression.name] ?? []) {\n methods.add(name);\n }\n }\n\n return methods;\n};\n\nexport const fieldCandidate = (\n node: TSESTree.ClassElement,\n options: FieldCandidateOptions\n): MemberCandidate | null => {\n const isField = isInstanceField(node);\n\n if (!isField) return null;\n\n const { localPrivateOnly, sourceCode } = options;\n const isExcluded = isExcludedField(node, localPrivateOnly, sourceCode);\n\n if (isExcluded) return null;\n\n const isManaged = isManagedField(\n node,\n options.imports,\n options.allowEffectFields,\n sourceCode\n );\n\n if (isManaged) return null;\n\n const unusedFieldCandidate: MemberCandidate | null = {\n messageId: 'unusedField',\n name: node.key.name,\n node\n };\n\n return unusedFieldCandidate;\n};\n\nexport const methodCandidate = (\n node: TSESTree.ClassElement,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): MemberCandidate | null => {\n const isMethod = isInstanceMethod(node);\n\n if (!isMethod) return null;\n\n const isExcluded = isExcludedMethod(\n node,\n localPrivateOnly,\n implementedMethods\n );\n\n if (isExcluded) return null;\n\n const unusedMethodCandidate: MemberCandidate | null = {\n messageId: 'unusedMethod',\n name: node.key.name,\n node\n };\n\n return unusedMethodCandidate;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularName, isImportBinding } from './angular-imports.ts';\nimport type {\n AngularImports,\n InstanceField\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst managedApis: ReadonlySet<string> = new Set([\n 'input',\n 'model',\n 'output',\n 'viewChild',\n 'viewChildren',\n 'contentChild',\n 'contentChildren'\n]);\n\nconst hasAutomaticEffectCleanup = (node: TSESTree.CallExpression): boolean => {\n const options = node.arguments.at(1);\n\n if (options === undefined) return true;\n\n if (options.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n return options.properties.every((property) => {\n if (\n property.type !== TSESTree.AST_NODE_TYPES.Property ||\n property.computed\n ) {\n return false;\n }\n\n const manualCleanup =\n (property.key.type === TSESTree.AST_NODE_TYPES.Identifier &&\n property.key.name === 'manualCleanup') ||\n (property.key.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.key.value === 'manualCleanup');\n\n return (\n !manualCleanup ||\n (property.value.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.value.value === false)\n );\n });\n};\n\nconst angularCoreImportedName = (\n definition: TSESLint.Scope.Definition | undefined\n): string | null => {\n if (definition?.type !== 'ImportBinding') return null;\n\n if (definition.node.type !== TSESTree.AST_NODE_TYPES.ImportSpecifier) {\n return null;\n }\n\n if (definition.parent.type !== TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n return null;\n }\n\n if (definition.parent.source.value !== '@angular/core') return null;\n\n const { imported } = definition.node;\n\n if (imported.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imported.name;\n }\n\n return imported.value;\n};\n\nexport const isAngularComponentRefField = (\n node: InstanceField,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const type = node.typeAnnotation?.typeAnnotation;\n\n if (\n type?.type !== TSESTree.AST_NODE_TYPES.TSTypeReference ||\n type.typeName.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return false;\n }\n\n const reference = sourceCode\n .getScope(type.typeName)\n .references.find(({ identifier }) => identifier === type.typeName);\n const definition = reference?.resolved?.defs[0];\n\n return angularCoreImportedName(definition) === 'ComponentRef';\n};\n\nexport const isManagedField = (\n node: InstanceField,\n imports: AngularImports,\n allowEffectFields: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n if (node.value?.type !== TSESTree.AST_NODE_TYPES.CallExpression) return false;\n\n const name = angularName(node.value.callee, imports);\n const isString = typeof name === 'string';\n\n if (!isString) return false;\n\n const isManagedApi = managedApis.has(name);\n\n if (isManagedApi) return true;\n\n if (!allowEffectFields) return false;\n\n if (name !== 'effect') return false;\n\n const isImported = isImportBinding(node.value.callee, sourceCode);\n\n if (!isImported) return false;\n\n return hasAutomaticEffectCleanup(node.value);\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport { TSESTree } from '@typescript-eslint/utils';\n\nimport { key, metadataValue, text } from './angular-metadata-literals.ts';\nimport {\n expressionReads,\n externalTemplateReads,\n templateReads\n} from './angular-template-parsing.ts';\nimport type { MetadataReadsOptions } from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst addReads = (target: Set<string>, source: Set<string> | null): boolean => {\n if (!source) return false;\n\n for (const name of source) {\n target.add(name);\n }\n\n return true;\n};\n\nconst hostPropertyReads = (\n property: TSESTree.Property,\n reads: Set<string>,\n filename: string\n): boolean => {\n const name = key(property);\n const expression = text(property.value);\n\n if (name === null || expression === null) return false;\n\n const isPropertyBinding = name.startsWith('[');\n\n if (isPropertyBinding) {\n return addReads(reads, expressionReads(expression, filename, false));\n }\n\n const isEventBinding = name.startsWith('(');\n\n if (isEventBinding) {\n return addReads(reads, expressionReads(expression, filename, true));\n }\n\n return true;\n};\n\nconst hostReads = (\n host: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!host) return true;\n\n if (host.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n const hasUnreadableKey = host.properties.some(\n (property) => key(property) === null\n );\n\n if (hasUnreadableKey) return false;\n\n for (const property of host.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) return false;\n\n const hasPropertyReads = hostPropertyReads(property, reads, filename);\n\n if (!hasPropertyReads) return false;\n }\n\n return true;\n};\n\nconst inlineTemplateReads = (\n template: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!template) return true;\n\n const source = text(template);\n\n return source !== null && addReads(reads, templateReads(source, filename));\n};\n\nconst externalTemplatePropertyReads = (\n templateUrl: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!templateUrl) return true;\n\n const url = text(templateUrl);\n\n return (\n url !== null &&\n addReads(reads, externalTemplateReads(resolve(dirname(filename), url)))\n );\n};\n\nconst componentTemplateReads = (\n metadata: TSESTree.ObjectExpression,\n reads: Set<string>,\n filename: string\n): boolean => {\n const template = metadataValue(metadata, 'template');\n const templateUrl = metadataValue(metadata, 'templateUrl');\n\n return (\n inlineTemplateReads(template, reads, filename) &&\n externalTemplatePropertyReads(templateUrl, reads, filename)\n );\n};\n\n/**\n * Names read by a class's host bindings and, for components, its template.\n * Returns null when the metadata cannot be read statically; with\n * `requireTemplate` false an unreadable template keeps the host reads\n * instead, for callers that resolve template reads elsewhere.\n */\nexport const metadataReads = (\n options: MetadataReadsOptions\n): Set<string> | null => {\n const { filename, metadata } = options;\n const isUnreadableKey = (\n property: TSESTree.ObjectLiteralElement\n ): boolean => {\n return key(property) === null;\n };\n const hasUnreadableKey = metadata.properties.some(isUnreadableKey);\n\n if (hasUnreadableKey) return null;\n\n const reads = new Set<string>();\n const hostValue = metadataValue(metadata, 'host');\n const hasHostReads = hostReads(hostValue, reads, filename);\n\n if (!hasHostReads) return null;\n\n if (!options.component) return reads;\n\n const isRead = (name: string): boolean => reads.has(name);\n const hasRemainingReads = options.remainingNames.every(isRead);\n\n if (hasRemainingReads) return reads;\n\n const hasTemplateReads = componentTemplateReads(metadata, reads, filename);\n\n if (hasTemplateReads) return reads;\n\n if (!options.requireTemplate) return reads;\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nexport const text = (node: TSESTree.Node | null | undefined): string | null => {\n if (\n node?.type === TSESTree.AST_NODE_TYPES.Literal &&\n typeof node.value === 'string'\n ) {\n return node.value;\n }\n\n if (node?.type !== TSESTree.AST_NODE_TYPES.TemplateLiteral) return null;\n\n const hasExpressions = node.expressions.length > 0;\n\n if (hasExpressions) return null;\n\n return node.quasis[0].value.cooked;\n};\n\nexport const key = (property: TSESTree.ObjectLiteralElement): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n return text(property.key);\n};\n\nexport const metadataValue = (\n metadata: TSESTree.ObjectExpression,\n name: string\n): TSESTree.Property['value'] | undefined => {\n for (const property of metadata.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) continue;\n\n const propertyKey = key(property);\n\n if (propertyKey === name) return property.value;\n }\n\n return undefined;\n};\n", "import {\n Lexer,\n ParseLocation,\n ParseSourceFile,\n ParseSourceSpan,\n Parser,\n R3TargetBinder,\n parseTemplate\n} from '@angular/compiler';\nimport type { ASTWithSource, DirectiveMeta } from '@angular/compiler';\n\nimport { readFileSync, statSync } from 'node:fs';\n\nimport { collectAngularExpressionReads } from './angular-expression-reads.ts';\n\ntype ExternalTemplateCache = {\n readonly reads: Set<string> | null;\n readonly version: string;\n};\n\nconst externalTemplates = new Map<string, ExternalTemplateCache>();\nconst parser = new Parser(new Lexer());\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\n\nexport const templateReads = (\n template: string,\n filename: string\n): Set<string> | null => {\n try {\n const result = parseTemplate(template, filename);\n\n if (result.errors?.length) return null;\n\n return collectAngularExpressionReads(\n result.nodes,\n templateBinder.bind({ template: result.nodes }),\n false\n );\n } catch {\n return null;\n }\n};\n\nexport const externalTemplateReads = (filename: string): Set<string> | null => {\n try {\n const stats = statSync(filename, { bigint: true });\n const version = `${stats.mtimeNs}:${stats.size}`;\n const cached = externalTemplates.get(filename);\n\n if (cached?.version === version) return cached.reads;\n\n const reads = templateReads(readFileSync(filename, 'utf8'), filename);\n\n externalTemplates.set(filename, { reads, version });\n\n return reads;\n } catch {\n return null;\n }\n};\n\nconst parseExpression = (\n expression: string,\n span: ParseSourceSpan,\n action: boolean\n): ASTWithSource => {\n if (action) return parser.parseAction(expression, span, 0);\n\n return parser.parseBinding(expression, span, 0);\n};\n\nexport const expressionReads = (\n expression: string,\n filename: string,\n action: boolean\n): Set<string> | null => {\n try {\n const file = new ParseSourceFile(expression, filename);\n const start = new ParseLocation(file, 0, 0, 0);\n const span = new ParseSourceSpan(start, start.moveBy(expression.length));\n const result = parseExpression(expression, span, action);\n\n if (result.errors.length > 0) return null;\n\n return collectAngularExpressionReads([result], undefined, action);\n } catch {\n return null;\n }\n};\n", "import {\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n SafeKeyedRead,\n ThisReceiver\n} from '@angular/compiler';\nimport type {\n Binary,\n BoundTarget,\n DirectiveMeta,\n PropertyRead,\n SafePropertyRead\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\n\ntype VisitableNode = Parameters<CombinedRecursiveAstVisitor['visit']>[0];\n\nclass ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads = new Set<string>();\n private readonly boundTarget: BoundTarget<DirectiveMeta> | undefined;\n private readonly action: boolean;\n\n public constructor(\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n ) {\n super();\n this.boundTarget = boundTarget;\n this.action = action;\n }\n\n private record(node: PropertyRead | SafePropertyRead): void {\n if (node.receiver instanceof ThisReceiver) {\n this.reads.add(node.name);\n\n return;\n }\n\n if (!(node.receiver instanceof ImplicitReceiver)) return;\n\n const isBindableName = !this.action || node.name !== '$event';\n\n if (!isBindableName) return;\n\n const expressionTarget = this.boundTarget?.getExpressionTarget(node);\n\n if (expressionTarget) return;\n\n this.reads.add(node.name);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n\nexport const collectAngularExpressionReads = (\n nodes: VisitableNode[],\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n): Set<string> => {\n const collector = new ReadCollector(boundTarget, action);\n\n for (const node of nodes) {\n collector.visit(node);\n }\n\n return collector.reads;\n};\n", "import {\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead\n} from '@angular/compiler';\nimport type { AST } from '@angular/compiler';\n\nexport const isReadTarget = (\n node: AST\n): node is PropertyRead | SafePropertyRead | KeyedRead | SafeKeyedRead => {\n const isPropertyRead = node instanceof PropertyRead;\n const isSafePropertyRead = node instanceof SafePropertyRead;\n const isKeyedRead = node instanceof KeyedRead;\n const isSafeKeyedRead = node instanceof SafeKeyedRead;\n\n return isPropertyRead || isSafePropertyRead || isKeyedRead || isSafeKeyedRead;\n};\n", "import type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularClassMetadata } from './angular-imports.ts';\nimport {\n fieldCandidate,\n implementedFormsMethods,\n methodCandidate\n} from './angular-member-candidates.ts';\nimport { metadataReads } from './angular-metadata-reads.ts';\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n ClassEntry,\n FieldCandidateOptions,\n MemberCandidate,\n MessageIds,\n MetadataReadsOptions,\n ReportContext,\n ReportUnusedMembersOptions\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype ClassReportOptions = {\n readonly localTemplates: boolean;\n readonly options: ReportUnusedMembersOptions;\n readonly projectAnalysis: boolean;\n};\n\nconst memberCandidates = (\n node: AngularClassNode,\n options: FieldCandidateOptions\n): MemberCandidate[] => {\n const implementedMethods = implementedFormsMethods(node);\n const members: MemberCandidate[] = [];\n\n for (const element of node.body.body) {\n const candidate =\n fieldCandidate(element, options) ??\n methodCandidate(element, options.localPrivateOnly, implementedMethods);\n\n if (candidate) {\n members.push(candidate);\n }\n }\n\n return members;\n};\n\nconst reportMember = (\n context: ReportContext,\n candidate: MemberCandidate\n): void => {\n const data = { name: candidate.name };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n data,\n messageId: candidate.messageId,\n node: candidate.node.key\n };\n\n context.report(report);\n};\n\nconst reportUnreadMembers = (\n members: MemberCandidate[],\n reads: Set<string>,\n options: ReportUnusedMembersOptions\n): void => {\n for (const candidate of members) {\n const isTemplateRead = reads.has(candidate.name);\n\n if (isTemplateRead) continue;\n\n const isProjectUsed = options.projectMemberUsed?.(candidate.node) === true;\n\n if (isProjectUsed) continue;\n\n reportMember(options.context, candidate);\n }\n};\n\nconst reportClassMembers = (\n entry: ClassEntry,\n ngClass: AngularClassMetadata,\n report: ClassReportOptions\n): void => {\n const { options, projectAnalysis } = report;\n const isLocalOnlyClass = !ngClass.component || entry.node.abstract === true;\n const candidateOptions: FieldCandidateOptions = {\n allowEffectFields: options.allowEffectFields,\n imports: options.imports,\n localPrivateOnly: !projectAnalysis && isLocalOnlyClass,\n sourceCode: options.context.sourceCode\n };\n const members = memberCandidates(entry.node, candidateOptions);\n const unreadMembers = members.filter(\n (candidate) => !entry.reads.has(candidate.name)\n );\n\n if (unreadMembers.length === 0) return;\n\n const remainingNames = unreadMembers.map((candidate) => candidate.name);\n const readsOptions: MetadataReadsOptions = {\n component: ngClass.component && report.localTemplates,\n filename: options.context.filename,\n metadata: ngClass.metadata,\n remainingNames,\n requireTemplate: !projectAnalysis\n };\n const reads = metadataReads(readsOptions);\n\n if (!reads) return;\n\n reportUnreadMembers(unreadMembers, reads, options);\n};\n\nexport const reportUnusedMembers = (\n options: ReportUnusedMembersOptions\n): void => {\n const projectAnalysis = options.projectMemberUsed !== undefined;\n const localTemplates = !projectAnalysis || !options.projectIndexed();\n const report: ClassReportOptions = {\n localTemplates,\n options,\n projectAnalysis\n };\n\n for (const entry of options.classes) {\n const ngClass = angularClassMetadata(entry.node, options.imports);\n const isDynamicClass = options.dynamicClasses.has(entry);\n\n if (!ngClass || isDynamicClass) continue;\n\n reportClassMembers(entry, ngClass, report);\n }\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n destructuredThisReads,\n isThisExpression\n} from './typescript-field-reads.ts';\nimport { lexicalThisVisitor } from './typescript-lexical-this.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type {\n AngularClassNode,\n ClassEntry,\n DynamicClasses\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\nconst enterClass = (\n node: AngularClassNode,\n classes: ClassEntry[],\n stack: ClassEntry[],\n thisStack: boolean[]\n): void => {\n const entry: ClassEntry = {\n node,\n reads: new Set<string>()\n };\n\n classes.push(entry);\n stack.push(entry);\n thisStack.push(true);\n};\n\nconst trackMemberRead = (\n node: TSESTree.MemberExpression,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const receiverIsThis = isThisExpression(node.object);\n\n if (node.computed && receiverIsThis) {\n dynamicClasses.add(current);\n }\n\n if (!receiverIsThis || node.computed) return;\n\n const isWriteOnlyTarget = isWriteOnly(node);\n\n if (isWriteOnlyTarget) return;\n\n if (node.property.type === TSESTree.AST_NODE_TYPES.Identifier) {\n current.reads.add(node.property.name);\n }\n};\n\nconst trackDestructuringRead = (\n node: DestructuringNode,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const reads = destructuredThisReads(node);\n\n if (reads === undefined) return;\n\n if (reads === null) {\n dynamicClasses.add(current);\n\n return;\n }\n\n for (const name of reads) {\n current.reads.add(name);\n }\n};\n\nexport const classReadVisitor = (\n classes: ClassEntry[],\n stack: ClassEntry[],\n dynamicClasses: DynamicClasses\n): TSESLint.RuleListener => {\n const thisStack: boolean[] = [];\n\n const listeners: TSESLint.RuleListener = {\n ClassDeclaration(node: TSESTree.ClassDeclaration): void {\n enterClass(node, classes, stack, thisStack);\n },\n ClassExpression(node: TSESTree.ClassExpression): void {\n enterClass(node, classes, stack, thisStack);\n },\n 'ClassDeclaration:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n 'ClassExpression:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n ...lexicalThisVisitor(thisStack),\n AssignmentExpression(node: TSESTree.AssignmentExpression): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n },\n MemberExpression(node: TSESTree.MemberExpression): void {\n trackMemberRead(node, stack, thisStack, dynamicClasses);\n },\n VariableDeclarator(node: TSESTree.VariableDeclarator): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\ntype TypeScriptExpressionWrapper =\n | TSESTree.TSAsExpression\n | TSESTree.TSInstantiationExpression\n | TSESTree.TSNonNullExpression\n | TSESTree.TSSatisfiesExpression\n | TSESTree.TSTypeAssertion;\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\ntype DestructuringParts = {\n readonly pattern: TSESTree.BindingName | TSESTree.Expression;\n readonly source: TSESTree.Expression | null;\n};\n\nconst expressionWrapperTypes: ReadonlySet<TSESTree.AST_NODE_TYPES> = new Set([\n TSESTree.AST_NODE_TYPES.TSAsExpression,\n TSESTree.AST_NODE_TYPES.TSInstantiationExpression,\n TSESTree.AST_NODE_TYPES.TSNonNullExpression,\n TSESTree.AST_NODE_TYPES.TSSatisfiesExpression,\n TSESTree.AST_NODE_TYPES.TSTypeAssertion\n]);\n\nexport const isTypeScriptExpressionWrapper = (\n node: TSESTree.Node\n): node is TypeScriptExpressionWrapper => {\n return expressionWrapperTypes.has(node.type);\n};\n\nconst unwrapTypeScriptExpression = (\n node: TSESTree.Expression | null\n): TSESTree.Expression | null => {\n let current = node;\n\n while (current && isTypeScriptExpressionWrapper(current)) {\n current = current.expression;\n }\n\n return current;\n};\n\nexport const isThisExpression = (node: TSESTree.Expression | null): boolean => {\n const unwrapped = unwrapTypeScriptExpression(node);\n\n return unwrapped?.type === TSESTree.AST_NODE_TYPES.ThisExpression;\n};\n\nconst destructuringParts = (\n node: DestructuringNode\n): DestructuringParts | null => {\n if (node.type === TSESTree.AST_NODE_TYPES.VariableDeclarator) {\n const variableParts: DestructuringParts | null = {\n pattern: node.id,\n source: node.init\n };\n\n return variableParts;\n }\n\n if (node.operator === '=') {\n const assignmentParts: DestructuringParts | null = {\n pattern: node.left,\n source: node.right\n };\n\n return assignmentParts;\n }\n\n return null;\n};\n\nconst propertyName = (\n property: TSESTree.Property | TSESTree.RestElement\n): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n const { value } = property.key;\n\n if (typeof value !== 'string') return null;\n\n return value;\n};\n\nexport const destructuredThisReads = (\n node: DestructuringNode\n): string[] | null | undefined => {\n const parts = destructuringParts(node);\n\n if (!parts) return undefined;\n\n if (parts.pattern.type !== TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return undefined;\n }\n\n const isThisSource = isThisExpression(parts.source);\n\n if (!isThisSource) return undefined;\n\n const reads: string[] = [];\n\n for (const property of parts.pattern.properties) {\n const name = propertyName(property);\n\n if (name === null) return null;\n\n reads.push(name);\n }\n\n return reads;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype FunctionNode =\n | TSESTree.ArrowFunctionExpression\n | TSESTree.FunctionDeclaration\n | TSESTree.FunctionExpression;\n\nconst componentThis = (node: FunctionNode, thisStack: boolean[]): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.ArrowFunctionExpression) {\n return thisStack.at(-1) ?? false;\n }\n\n const { parent } = node;\n\n if (parent.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return !parent.static;\n};\n\nexport const lexicalThisVisitor = (\n thisStack: boolean[]\n): TSESLint.RuleListener => {\n const listeners: TSESLint.RuleListener = {\n FunctionDeclaration(node: TSESTree.FunctionDeclaration): void {\n thisStack.push(componentThis(node, thisStack));\n },\n FunctionExpression(node: TSESTree.FunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n 'FunctionDeclaration:exit'(): void {\n thisStack.pop();\n },\n 'FunctionExpression:exit'(): void {\n thisStack.pop();\n },\n 'ArrowFunctionExpression:exit'(): void {\n thisStack.pop();\n },\n StaticBlock(): void {\n thisStack.push(false);\n },\n 'StaticBlock:exit'(): void {\n thisStack.pop();\n },\n PropertyDefinition(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.push(false);\n }\n },\n 'PropertyDefinition:exit'(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.pop();\n }\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nimport { isTypeScriptExpressionWrapper } from './typescript-field-reads.ts';\n\nconst parentOf = (node: TSESTree.Node): TSESTree.Node | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Program) return undefined;\n\n return node.parent;\n};\n\nconst isPatternTarget = (\n parent: TSESTree.Node | undefined,\n child: TSESTree.Node\n): boolean => {\n if (parent === undefined) return false;\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ArrayPattern) {\n return parent.elements.some((element) => element === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parent.left === child;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return parent.properties.some((property) => property === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.Property) {\n const isObjectPattern =\n parent.parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern;\n\n return parent.value === child && isObjectPattern;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.RestElement) {\n return parent.argument === child;\n }\n\n return false;\n};\n\nconst isSimpleAssignmentTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n if (parent?.type !== TSESTree.AST_NODE_TYPES.AssignmentExpression) {\n return false;\n }\n\n return parent.left === current && parent.operator === '=';\n};\n\nconst isLoopTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n const isForIn = parent?.type === TSESTree.AST_NODE_TYPES.ForInStatement;\n const isForOf = parent?.type === TSESTree.AST_NODE_TYPES.ForOfStatement;\n const isLoop = isForIn || isForOf;\n\n if (!isLoop) return false;\n\n return parent.left === current;\n};\n\nconst isWrapping = (parent: TSESTree.Node, child: TSESTree.Node): boolean => {\n const isWrapper = isTypeScriptExpressionWrapper(parent);\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isDirectWrite = (node: TSESTree.MemberExpression): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n\n while (\n parent &&\n isTypeScriptExpressionWrapper(parent) &&\n parent.expression === current\n ) {\n current = parent;\n parent = parentOf(parent);\n }\n\n const isDeleteExpression =\n parent?.type === TSESTree.AST_NODE_TYPES.UnaryExpression &&\n parent.operator === 'delete';\n const isAssignment = isSimpleAssignmentTarget(parent, current);\n\n return isAssignment || isDeleteExpression;\n};\n\nconst isDestructuringOrLoopTarget = (\n node: TSESTree.MemberExpression\n): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n let patternTarget = false;\n\n while (parent) {\n const wrapper = isWrapping(parent, current);\n const pattern = isPatternTarget(parent, current);\n\n if (!wrapper && !pattern) break;\n\n if (pattern) {\n patternTarget = true;\n }\n\n current = parent;\n parent = parentOf(parent);\n }\n\n const isSimpleTarget = isSimpleAssignmentTarget(parent, current);\n const isAssignedPattern = patternTarget && isSimpleTarget;\n\n return isAssignedPattern || isLoopTarget(parent, current);\n};\n\nexport const isWriteOnly = (node: TSESTree.MemberExpression): boolean => {\n const isWrite = isDirectWrite(node);\n\n if (isWrite) return true;\n\n return isDestructuringOrLoopTarget(node);\n};\n", "import { isClassElement, isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { Node, Program } from 'typescript';\n\nimport { buildDirectiveIndex } from './angular/angular-directive-index.ts';\nimport type {\n ProjectIndex,\n ProjectUsageIndex\n} from './common/project-index.type.ts';\nimport { reconcile } from './project-index-reconciliation.ts';\n\nconst indexes = new Map<string, ProjectIndex>();\n\nconst memberName = (node: Node): string | null => {\n const isMember = isClassElement(node);\n\n if (!isMember) return null;\n\n if (!node.name) return null;\n\n const isIdentifierName = isIdentifier(node.name);\n const isStringName = isStringLiteralLike(node.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (!isNamedMember) return null;\n\n return node.name.text;\n};\n\nconst usageOf = (index: ProjectIndex): ProjectUsageIndex => {\n if (index.usage !== undefined) return index.usage;\n\n const declarations = new Set<Node>();\n const fallbackNames = new Set<string>();\n\n for (const entry of index.entries.values()) {\n for (const declaration of entry.declarations) {\n declarations.add(declaration);\n }\n\n for (const name of entry.fallbackNames) {\n fallbackNames.add(name);\n }\n }\n\n index.usage = {\n has: (node): boolean => {\n const hasDeclaration = declarations.has(node);\n\n if (hasDeclaration) return true;\n\n if (fallbackNames.size === 0) return false;\n\n const name = memberName(node);\n\n return name !== null && fallbackNames.has(name);\n }\n };\n\n return index.usage;\n};\n\nconst createIndex = (): ProjectIndex => {\n const emptyIndex: ProjectIndex = {\n candidateNames: new Set(),\n classes: new Map(),\n directives: buildDirectiveIndex([]),\n directiveShape: '',\n entries: new Map(),\n program: null,\n templateCheckDuration: 0,\n templateCheckedAt: 0,\n usage: undefined\n };\n\n return emptyIndex;\n};\n\n/**\n * True when the index already reflects this exact Program, so callers can\n * skip local work the index duplicates (such as parsing a component's own\n * template) without ever triggering a build.\n */\nexport const projectUsageIsCurrent = (program: Program): boolean => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n return (\n typeof configFilePath === 'string' &&\n indexes.get(configFilePath)?.program === program\n );\n};\n\n/**\n * Member declarations read anywhere in the Program's non-spec TypeScript\n * and Angular templates, or null when the project cannot be indexed\n * reliably. Indexes are kept per tsconfig and updated incrementally: a new\n * Program (an edit in the editor) only re-indexes the files that changed\n * and the files whose resolutions depended on them.\n */\nexport const projectUsage = (program: Program): ProjectUsageIndex | null => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n if (typeof configFilePath !== 'string') return null;\n\n let index = indexes.get(configFilePath);\n\n if (!index) {\n index = createIndex();\n indexes.set(configFilePath, index);\n }\n\n try {\n reconcile(index, program);\n\n return usageOf(index);\n } catch {\n indexes.delete(configFilePath);\n\n return null;\n }\n};\n", "import { CssSelector, SelectorMatcher } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport type {\n AngularClass,\n DirectiveIndex\n} from '../common/project-usage.type.ts';\n\n/**\n * A description of every directive's selector and exportAs; when it changes\n * between programs, cached template reference resolutions are stale.\n */\nconst classShape = ({\n component,\n declaration,\n exportAs,\n hostDirectives,\n name,\n selector\n}: AngularClass): string => {\n const fields = [\n declaration.getSourceFile().fileName,\n name,\n String(component),\n String(hostDirectives),\n selector ?? '',\n exportAs.join(',')\n ];\n\n return fields.join('\\0');\n};\n\nexport const directiveShape = (classes: Iterable<AngularClass>): string => {\n const shapes = [...classes].map(classShape);\n\n return shapes.sort().join('\\n');\n};\n\nconst parseSelector = (selector: string): CssSelector[] | null => {\n try {\n return CssSelector.parse(selector);\n } catch {\n return null;\n }\n};\n\nexport const buildDirectiveIndex = (\n classes: Iterable<AngularClass>\n): DirectiveIndex => {\n const byDeclaration = new Map<ClassLikeDeclaration, AngularClass>();\n const byExportAs = new Map<string, ClassLikeDeclaration[]>();\n const componentMatcher = new SelectorMatcher<ClassLikeDeclaration[]>();\n\n for (const angularClass of classes) {\n const { component, declaration, exportAs, selector } = angularClass;\n\n byDeclaration.set(declaration, angularClass);\n\n for (const name of exportAs) {\n const declarations = byExportAs.get(name) ?? [];\n\n declarations.push(declaration);\n byExportAs.set(name, declarations);\n }\n\n if (component && selector !== null) {\n const selectors = parseSelector(selector);\n\n if (selectors) {\n componentMatcher.addSelectables(selectors, [declaration]);\n }\n }\n }\n\n const directiveIndex: DirectiveIndex = {\n byDeclaration,\n byExportAs,\n componentMatcher\n };\n\n return directiveIndex;\n};\n", "import { readFileSync, statSync } from 'node:fs';\n\nimport { isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { ClassElement, ClassLikeDeclaration } from 'typescript';\n\nimport { addTemplateReads } from './angular-template-read-resolution.ts';\nimport type {\n TemplateFileVersion,\n TemplateReads\n} from '../common/project-index.type.ts';\nimport type {\n AngularClass,\n CandidateNames,\n CollectTemplateReadsOptions,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype TemplateSource = {\n readonly fileName: string;\n readonly source: string;\n};\n\nconst memberNameOf = (member: ClassElement): string[] => {\n const name = member.name;\n\n if (!name) return [];\n\n const isIdentifierName = isIdentifier(name);\n const isStringName = isStringLiteralLike(name);\n const isTextName = isIdentifierName || isStringName;\n\n if (!isTextName) return [];\n\n const names = [name.text];\n\n return names;\n};\n\nconst memberNames = (declaration: ClassLikeDeclaration): string[] => {\n return declaration.members.flatMap(memberNameOf);\n};\n\n/**\n * What a template we cannot read might reference: the component's own\n * members and those of every class in its scope, or every candidate name\n * when the scope is unknown.\n */\nconst unknownTemplateNames = (\n { declaration, scope }: AngularClass,\n allNames: CandidateNames\n): Iterable<string> => {\n if (scope === null) return allNames;\n\n const scopeNames = scope.flatMap(memberNames);\n const names = [...memberNames(declaration), ...scopeNames];\n\n return names;\n};\n\nconst templateFileVersion = (fileName: string): TemplateFileVersion => {\n const { mtimeNs, size } = statSync(fileName, { bigint: true });\n\n const version: TemplateFileVersion = { fileName, mtimeNs, size };\n\n return version;\n};\n\nexport const templateFileIsCurrent = (\n version: TemplateFileVersion\n): boolean => {\n try {\n const current = statSync(version.fileName, { bigint: true });\n\n return current.mtimeNs === version.mtimeNs && current.size === version.size;\n } catch {\n return false;\n }\n};\n\nconst templateSourceOf = (\n angularClass: AngularClass,\n allNames: CandidateNames,\n sink: ReadSink,\n versions: TemplateFileVersion[]\n): TemplateSource | null => {\n const { declaration, template, valid } = angularClass;\n const fileName = declaration.getSourceFile().fileName;\n const className = declaration.name?.text ?? '(anonymous)';\n\n if (!valid) {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: metadata of ${className} is not static (template, templateUrl)`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n\n if (!template) return null;\n\n if (template.kind === 'inline') {\n const inlineSource: TemplateSource = { fileName, source: template.source };\n\n return inlineSource;\n }\n\n const templateFileName = template.fileName;\n\n try {\n versions.push(templateFileVersion(templateFileName));\n\n const source = readFileSync(templateFileName, 'utf8');\n const externalSource: TemplateSource = {\n fileName: templateFileName,\n source\n };\n\n return externalSource;\n } catch {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: templateUrl of ${className} cannot be read (${templateFileName})`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n};\n\n/** Reads made by the templates of the components declared in one file. */\nexport const collectAngularTemplateReads = ({\n allNames,\n checker,\n classes,\n directives,\n sink\n}: CollectTemplateReadsOptions): TemplateReads => {\n const templateVersions: TemplateFileVersion[] = [];\n let usedDirectiveIndex = false;\n\n for (const angularClass of classes) {\n const template = templateSourceOf(\n angularClass,\n allNames,\n sink,\n templateVersions\n );\n\n if (template === null) continue;\n\n const result = addTemplateReads({\n angularClass,\n checker,\n directives,\n fileName: template.fileName,\n sink,\n source: template.source\n });\n\n usedDirectiveIndex ||= result.usedDirectiveIndex;\n }\n\n const templateReads: TemplateReads = {\n templateVersions,\n usedDirectiveIndex\n };\n\n return templateReads;\n};\n", "import {\n R3TargetBinder,\n ThisReceiver,\n TmplAstReference,\n parseTemplate\n} from '@angular/compiler';\nimport type {\n BoundTarget,\n DirectiveMeta,\n TemplateEntity\n} from '@angular/compiler';\n\nimport { addResolvedPath } from './angular-resolved-path.ts';\nimport { ReadCollector } from './angular-template-read-chains.ts';\nimport { addReferenceRead } from './angular-template-references.ts';\nimport type {\n ReadChain,\n ReadSegment,\n ResolvedPathOptions,\n TemplateReadContext,\n TemplateReadsOptions\n} from '../common/project-usage.type.ts';\nimport { chainText } from '../utils/read-chain-text.util.ts';\n\ntype TemplateReadResult = {\n /** True when a `#reference` was resolved through the directive index. */\n readonly usedDirectiveIndex: boolean;\n};\n\n/** Every identifier-like token in a text: a superset of what it can read. */\nconst identifierNames = (text: string): Set<string> => {\n const matches = text.match(/[A-Za-z_$][\\w$]*/gu) ?? [];\n\n return new Set(matches);\n};\n\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\n\nconst unparsedTemplateReads = (\n context: TemplateReadContext,\n source: string,\n error: string | undefined\n): TemplateReadResult => {\n const names = identifierNames(source);\n const message = error ?? 'unknown error';\n const reason = `${context.fileName}: template of ${context.className} does not parse (${message})`;\n\n context.sink.addFallbackNames(names, reason);\n\n const unparsedReads: TemplateReadResult = { usedDirectiveIndex: false };\n\n return unparsedReads;\n};\n\nconst addComponentRead = (\n context: TemplateReadContext,\n names: ReadSegment[]\n): void => {\n const { checker, className, declaration, fileName, sink } = context;\n const options: ResolvedPathOptions = {\n allowMissingRoot: true,\n checker,\n declaration,\n names,\n sink\n };\n const isResolved = addResolvedPath(options);\n\n if (isResolved) return;\n\n const fallbackNames = names.map((segment) => segment.name);\n const reason = `${fileName}: cannot resolve '${chainText(names)}' on ${className}`;\n\n sink.addFallbackNames(fallbackNames, reason);\n};\n\nconst chainEntity = (\n boundTarget: BoundTarget<DirectiveMeta>,\n chain: ReadChain\n): TemplateEntity | null => {\n const isThisRead = chain.root.receiver instanceof ThisReceiver;\n\n if (isThisRead) return null;\n\n return boundTarget.getExpressionTarget(chain.root);\n};\n\nconst addChainRead = (\n context: TemplateReadContext,\n reads: ReadCollector,\n boundTarget: BoundTarget<DirectiveMeta>,\n chain: ReadChain\n): boolean => {\n const entity = chainEntity(boundTarget, chain);\n\n if (entity === null) {\n addComponentRead(context, chain.names);\n\n return false;\n }\n\n if (!(entity instanceof TmplAstReference)) return false;\n\n const owner = reads.referenceOwners.get(entity);\n const names = chain.names.slice(1);\n\n addReferenceRead(context, entity, owner, names);\n\n return true;\n};\n\nexport const addTemplateReads = ({\n angularClass,\n checker,\n directives,\n fileName,\n sink,\n source\n}: TemplateReadsOptions): TemplateReadResult => {\n const { declaration, scope } = angularClass;\n const className = declaration.name?.text ?? '(anonymous)';\n const context: TemplateReadContext = {\n checker,\n className,\n declaration,\n directives,\n fileName,\n scope,\n sink\n };\n const parsed = parseTemplate(source, fileName);\n\n if (parsed.errors?.length) {\n const error = parsed.errors[0]?.msg;\n\n return unparsedTemplateReads(context, source, error);\n }\n\n const boundTarget = templateBinder.bind({ template: parsed.nodes });\n const reads = new ReadCollector();\n\n for (const node of parsed.nodes) {\n reads.visit(node);\n }\n\n let usedDirectiveIndex = false;\n\n for (const chain of reads.reads) {\n const usedIndex = addChainRead(context, reads, boundTarget, chain);\n\n usedDirectiveIndex ||= usedIndex;\n }\n\n const templateReads: TemplateReadResult = { usedDirectiveIndex };\n\n return templateReads;\n};\n", "import { SignatureKind, TypeFlags } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport type {\n ReadSink,\n ResolvedPathOptions\n} from '../common/project-usage.type.ts';\nimport {\n stringIndexTypes,\n symbolsForName\n} from '../utils/type-property-symbols.util.ts';\n\nconst hasAnyOrUnknownFlag = (type: { flags: TypeFlags }): boolean => {\n const anyOrUnknown = TypeFlags.Any | TypeFlags.Unknown;\n\n return (type.flags & anyOrUnknown) !== 0;\n};\n\nconst isAnyOrUnknown = (types: { flags: TypeFlags }[]): boolean => {\n return types.some(hasAnyOrUnknownFlag);\n};\n\nconst addTypes = (sink: ReadSink, types: Type[]): void => {\n for (const type of types) {\n sink.addType(type);\n }\n};\n\nconst callReturnTypes = (checker: TypeChecker, type: Type): Type[] => {\n const signatures = checker.getSignaturesOfType(type, SignatureKind.Call);\n\n return signatures.map((signature) => signature.getReturnType());\n};\n\nconst memberTypes = (\n symbols: Set<Symbol>,\n declaration: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): Type[] => {\n const types: Type[] = [];\n\n for (const symbol of symbols) {\n for (const memberDeclaration of symbol.declarations ?? []) {\n sink.addDeclaration(memberDeclaration);\n }\n\n types.push(checker.getTypeOfSymbolAtLocation(symbol, declaration));\n }\n\n return types;\n};\n\nexport const addResolvedPath = ({\n allowMissingRoot,\n checker,\n declaration,\n names,\n sink\n}: ResolvedPathOptions): boolean => {\n let types = [checker.getTypeAtLocation(declaration)];\n const indexTypesOf = (type: Type): Type[] => stringIndexTypes(checker, type);\n const returnTypesOf = (type: Type): Type[] => callReturnTypes(checker, type);\n\n for (const [index, segment] of names.entries()) {\n addTypes(sink, types);\n\n const symbolsOf = (type: Type): Symbol[] => {\n return symbolsForName(checker, type, segment.name);\n };\n const symbols = new Set(types.flatMap(symbolsOf));\n\n if (symbols.size === 0) {\n const indexedTypes = types.flatMap(indexTypesOf);\n\n if (indexedTypes.length > 0) {\n types = indexedTypes;\n continue;\n }\n\n const isAnyOrUnknownType = isAnyOrUnknown(types);\n\n if (isAnyOrUnknownType) return true;\n\n return index === 0 && allowMissingRoot;\n }\n\n types = memberTypes(symbols, declaration, checker, sink);\n\n if (segment.called) {\n const returnTypes = types.flatMap(returnTypesOf);\n\n if (returnTypes.length === 0) return isAnyOrUnknown(types);\n\n types = returnTypes;\n }\n }\n\n return true;\n};\n", "import { IndexKind } from 'typescript';\nimport type { Symbol, Type, TypeChecker } from 'typescript';\n\nexport const symbolsForName = (\n checker: TypeChecker,\n type: Type,\n name: string\n): Symbol[] => {\n const symbol = checker.getPropertyOfType(checker.getApparentType(type), name);\n\n if (symbol) return [symbol];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const symbols = new Set<Symbol>();\n\n for (const member of type.types) {\n for (const memberSymbol of symbolsForName(checker, member, name)) {\n symbols.add(memberSymbol);\n }\n }\n\n return [...symbols];\n};\n\nexport const stringIndexTypes = (checker: TypeChecker, type: Type): Type[] => {\n const indexedType = checker.getIndexTypeOfType(\n checker.getApparentType(type),\n IndexKind.String\n );\n\n if (indexedType) return [indexedType];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const indexedTypes = new Set<Type>();\n\n for (const member of type.types) {\n for (const memberIndexedType of stringIndexTypes(checker, member)) {\n indexedTypes.add(memberIndexedType);\n }\n }\n\n return [...indexedTypes];\n};\n", "import type {\n AST,\n Binary,\n TmplAstComponent,\n TmplAstDirective,\n TmplAstElement,\n TmplAstReference,\n TmplAstTemplate\n} from '@angular/compiler';\nimport {\n Call,\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead,\n ThisReceiver\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\nimport type {\n ReadChain,\n ReadSegment,\n ReferenceOwner\n} from '../common/project-usage.type.ts';\n\ntype ChainStep = {\n readonly called: boolean;\n readonly next: PropertyRead | SafePropertyRead;\n};\n\nconst isPropertyReadLike = (\n node: AST\n): node is PropertyRead | SafePropertyRead => {\n const isPlainRead = node instanceof PropertyRead;\n const isSafeRead = node instanceof SafePropertyRead;\n\n return isPlainRead || isSafeRead;\n};\n\nconst isRootRead = (read: PropertyRead | SafePropertyRead): boolean => {\n const isImplicitReceiver = read.receiver instanceof ImplicitReceiver;\n const isThisReceiver = read.receiver instanceof ThisReceiver;\n\n return isImplicitReceiver || isThisReceiver;\n};\n\nconst chainStep = (read: PropertyRead | SafePropertyRead): ChainStep | null => {\n const receiver = read.receiver;\n const isReadReceiver = isPropertyReadLike(receiver);\n\n if (isReadReceiver) {\n const readStep: ChainStep = { called: false, next: receiver };\n\n return readStep;\n }\n\n const isCallReceiver = receiver instanceof Call;\n\n if (!isCallReceiver) return null;\n\n const target = receiver.receiver;\n const isReadLikeTarget = isPropertyReadLike(target);\n\n if (!isReadLikeTarget) return null;\n\n const calledStep: ChainStep = { called: true, next: target };\n\n return calledStep;\n};\n\nconst readChain = (node: PropertyRead | SafePropertyRead): ReadChain | null => {\n const leaf: ReadSegment = { called: false, name: node.name };\n const names: ReadSegment[] = [leaf];\n let current = node;\n\n while (!isRootRead(current)) {\n const step = chainStep(current);\n\n if (step === null) return null;\n\n current = step.next;\n names.unshift({ called: step.called, name: current.name });\n }\n\n if (!(current instanceof PropertyRead)) return null;\n\n const chain: ReadChain = { names, root: current };\n\n return chain;\n};\n\nexport class ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads: ReadChain[] = [];\n public readonly referenceOwners = new Map<TmplAstReference, ReferenceOwner>();\n\n private record(node: PropertyRead | SafePropertyRead): void {\n const chain = readChain(node);\n\n if (chain) {\n this.reads.push(chain);\n }\n }\n\n private recordReferences(owner: ReferenceOwner): void {\n for (const reference of owner.references) {\n this.referenceOwners.set(reference, owner);\n }\n }\n\n public override visitElement(element: TmplAstElement): void {\n this.recordReferences(element);\n super.visitElement(element);\n }\n\n public override visitTemplate(template: TmplAstTemplate): void {\n this.recordReferences(template);\n super.visitTemplate(template);\n }\n\n public override visitComponent(component: TmplAstComponent): void {\n this.recordReferences(component);\n super.visitComponent(component);\n }\n\n public override visitDirective(directive: TmplAstDirective): void {\n this.recordReferences(directive);\n super.visitDirective(directive);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n", "import { TmplAstElement, createCssSelectorFromNode } from '@angular/compiler';\nimport type { TmplAstReference } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport { addResolvedPath } from './angular-resolved-path.ts';\nimport type {\n DirectiveIndex,\n ReadSegment,\n ReferenceOwner,\n ResolvedPathOptions,\n TemplateReadContext\n} from '../common/project-usage.type.ts';\nimport { chainText } from '../utils/read-chain-text.util.ts';\n\n/**\n * Classes a `#reference` can resolve to. Candidates come from the whole\n * Program and are narrowed to the component's standalone `imports` when\n * that scope is known; a scope member with `hostDirectives` may expose\n * exportAs names that are not modelled, so it keeps the wider set. Extra\n * candidates only add reads.\n */\nconst referenceTargets = (\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n directives: DirectiveIndex,\n scope: ClassLikeDeclaration[] | null\n): ClassLikeDeclaration[] => {\n const exportAs = reference.value.trim();\n let targets: ClassLikeDeclaration[] = [];\n\n if (exportAs !== '') {\n const exportedTargets = directives.byExportAs.get(exportAs) ?? [];\n\n targets = [...exportedTargets];\n } else if (owner instanceof TmplAstElement) {\n directives.componentMatcher.match(\n createCssSelectorFromNode(owner),\n (_selector, declarations) => {\n targets.push(...declarations);\n }\n );\n }\n\n const scoped =\n scope !== null &&\n !scope.some(\n (declaration) => directives.byDeclaration.get(declaration)?.hostDirectives\n );\n\n if (!scoped) return targets;\n\n const scopedTargets = targets.filter((target) => scope.includes(target));\n\n return scopedTargets;\n};\n\n/** Reads made on the classes a template `#reference` resolves to. */\nexport const addReferenceRead = (\n context: TemplateReadContext,\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n names: ReadSegment[]\n): void => {\n const { checker, className, directives, fileName, scope, sink } = context;\n const targets = referenceTargets(reference, owner, directives, scope);\n const isTargetResolved = (target: ClassLikeDeclaration): boolean => {\n const options: ResolvedPathOptions = {\n allowMissingRoot: false,\n checker,\n declaration: target,\n names,\n sink\n };\n\n return addResolvedPath(options);\n };\n const resolved = targets.map(isTargetResolved);\n const hasResolvedTarget = resolved.includes(true);\n\n if (resolved.length === 0) return;\n\n if (hasResolvedTarget) return;\n\n const fallbackNames = names.map((segment) => segment.name);\n const reason = `${fileName}: cannot resolve '#${reference.name}.${chainText(names)}' in ${className}`;\n\n sink.addFallbackNames(fallbackNames, reason);\n};\n", "import type { ReadSegment } from '../common/project-usage.type.ts';\n\nconst segmentText = (segment: ReadSegment): string => {\n const call = segment.called ? '()' : '';\n\n return `${segment.name}${call}`;\n};\n\n/** A read chain rendered the way it appeared in the template. */\nexport const chainText = (names: ReadSegment[]): string => {\n const texts = names.map(segmentText);\n\n return texts.join('.');\n};\n", "import {\n forEachChild,\n isClassLike,\n isElementAccessExpression,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ElementAccessExpression,\n Node,\n PropertyAccessExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { collectAngularInterfaceMethods } from './typescript-angular-interface-methods.ts';\nimport { collectDestructuringReads } from './typescript-destructuring-reads.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n literalPropertyNames\n} from './typescript-symbol-reads.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type { CandidateNames, ReadSink } from '../common/project-usage.type.ts';\n\nconst addPropertyAccessRead = (\n node: PropertyAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const isCandidateName = candidateNames.has(node.name.text);\n\n if (!isCandidateName) return;\n\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n sink.addType(checker.getTypeAtLocation(node.expression));\n\n const symbol = checker.getSymbolAtLocation(node.name);\n\n if (symbol) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n};\n\nconst addElementAccessRead = (\n node: ElementAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n const argumentType = checker.getTypeAtLocation(node.argumentExpression);\n const names = literalPropertyNames(argumentType);\n\n if (names) {\n const hasCandidateName = names.some((name) => candidateNames.has(name));\n\n if (!hasCandidateName) return;\n }\n\n const targetType = checker.getTypeAtLocation(node.expression);\n\n addNamedProperties(checker, targetType, names, sink);\n};\n\nexport const collectTypeScriptReads = (\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const visit = (node: Node): void => {\n const isPropertyAccess = isPropertyAccessExpression(node);\n const isElementAccess = isElementAccessExpression(node);\n const isClass = isClassLike(node);\n\n if (isPropertyAccess) {\n addPropertyAccessRead(node, checker, sink, candidateNames);\n } else if (isElementAccess) {\n addElementAccessRead(node, checker, sink, candidateNames);\n } else if (isClass) {\n collectAngularInterfaceMethods(node, checker, sink);\n }\n\n collectDestructuringReads(node, checker, sink, candidateNames);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n};\n", "import { SyntaxKind, isMethodSignature } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport { addSymbolDeclarations } from './typescript-symbol-reads.ts';\nimport type { ReadSink } from '../common/project-usage.type.ts';\n\nconst isAngularMethodSignature = (declaration: Declaration): boolean => {\n const isMethod = isMethodSignature(declaration);\n\n if (!isMethod) return false;\n\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/');\n};\n\nconst isAngularInterfaceMethod = (symbol: Symbol): boolean => {\n const declarations = symbol.declarations ?? [];\n\n return declarations.some(isAngularMethodSignature);\n};\n\nconst addImplementations = (\n heritageType: Type,\n classType: Type,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n for (const interfaceMethod of heritageType.getProperties()) {\n const isInterfaceMethod = isAngularInterfaceMethod(interfaceMethod);\n\n if (!isInterfaceMethod) continue;\n\n const implementation = classType.getProperty(interfaceMethod.name);\n\n if (implementation) {\n addSymbolDeclarations(checker, implementation, sink);\n }\n }\n};\n\n/**\n * Angular calls lifecycle and forms methods through the interfaces a class\n * implements, so an implementation of one counts as read.\n */\nexport const collectAngularInterfaceMethods = (\n node: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n const heritageClauses = node.heritageClauses ?? [];\n const implementsClauses = heritageClauses.filter(\n (clause) => clause.token === SyntaxKind.ImplementsKeyword\n );\n\n if (implementsClauses.length === 0) return;\n\n const classType = checker.getTypeAtLocation(node);\n\n for (const clause of implementsClauses) {\n for (const heritageType of clause.types) {\n const type = checker.getTypeAtLocation(heritageType);\n\n sink.addType(type);\n addImplementations(type, classType, checker, sink);\n }\n }\n};\n", "import {\n SymbolFlags,\n isBigIntLiteral,\n isIdentifier,\n isNumericLiteral,\n isPrivateIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { PropertyName, Symbol, Type, TypeChecker } from 'typescript';\n\nimport type { ReadSink } from '../common/project-usage.type.ts';\nimport { symbolsForName } from '../utils/type-property-symbols.util.ts';\n\nconst aliasTarget = (checker: TypeChecker, symbol: Symbol): Symbol => {\n const isAlias = (symbol.flags & SymbolFlags.Alias) !== 0;\n\n if (!isAlias) return symbol;\n\n return checker.getAliasedSymbol(symbol);\n};\n\nexport const addSymbolDeclarations = (\n checker: TypeChecker,\n symbol: Symbol,\n sink: ReadSink\n): void => {\n const resolved = aliasTarget(checker, symbol);\n\n for (const declaration of resolved.declarations ?? []) {\n sink.addDeclaration(declaration);\n }\n};\n\nexport const allPropertySymbols = (\n checker: TypeChecker,\n type: Type\n): Symbol[] => {\n const symbols = new Set(\n checker.getPropertiesOfType(checker.getApparentType(type))\n );\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n for (const symbol of allPropertySymbols(checker, member)) {\n symbols.add(symbol);\n }\n }\n }\n\n return [...symbols];\n};\n\nconst namedPropertySymbols = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null\n): Symbol[] => {\n if (names === null) return allPropertySymbols(checker, type);\n\n return names.flatMap((name) => symbolsForName(checker, type, name));\n};\n\nexport const addNamedProperties = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null,\n sink: ReadSink\n): Symbol[] => {\n sink.addType(type);\n\n const symbols = namedPropertySymbols(checker, type, names);\n\n for (const symbol of symbols) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n\n return symbols;\n};\n\nexport const literalPropertyNames = (type: Type): string[] | null => {\n const isStringLiteral = type.isStringLiteral();\n const isNumberLiteral = type.isNumberLiteral();\n const isLiteralType = isStringLiteral || isNumberLiteral;\n\n if (isLiteralType) return [String(type.value)];\n\n const isUnion = type.isUnion();\n\n if (!isUnion) return null;\n\n const names: string[] = [];\n\n for (const member of type.types) {\n const memberNames = literalPropertyNames(member);\n\n if (!memberNames) return null;\n\n names.push(...memberNames);\n }\n\n return names;\n};\n\nexport const propertyName = (\n checker: TypeChecker,\n node: PropertyName\n): string[] | null => {\n const isIdentifierName = isIdentifier(node);\n const isPrivateName = isPrivateIdentifier(node);\n const isStringName = isStringLiteralLike(node);\n const isNumericName = isNumericLiteral(node);\n const isBigIntName = isBigIntLiteral(node);\n const isLiteralName =\n isIdentifierName ||\n isPrivateName ||\n isStringName ||\n isNumericName ||\n isBigIntName;\n\n if (isLiteralName) return [node.text];\n\n return literalPropertyNames(checker.getTypeAtLocation(node.expression));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isBinaryExpression,\n isBindingElement,\n isObjectLiteralExpression,\n isVariableDeclaration\n} from 'typescript';\nimport type { Node, Type, TypeChecker } from 'typescript';\n\nimport { assignmentPatternElements } from './typescript-assignment-pattern-elements.ts';\nimport {\n bindingPatternElements,\n isBindingPattern\n} from './typescript-binding-pattern-elements.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n allPropertySymbols\n} from './typescript-symbol-reads.ts';\nimport type {\n CandidateNames,\n DestructuringPattern,\n PatternElementRead,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype LazyType = () => Type;\n\ntype PatternReadContext = {\n readonly checker: TypeChecker;\n readonly sink: ReadSink;\n readonly candidateNames: CandidateNames;\n};\n\nconst lazyType = (compute: () => Type): LazyType => {\n let type: Type | undefined;\n\n return () => (type ??= compute());\n};\n\nconst isSkippable = (\n read: PatternElementRead,\n candidateNames: CandidateNames\n): boolean => {\n if (read.nested !== null) return false;\n\n if (read.names === null) return false;\n\n const hasCandidateName = read.names.some((name) => candidateNames.has(name));\n\n return !hasCandidateName;\n};\n\nconst patternElements = (\n pattern: DestructuringPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isBinding = isBindingPattern(pattern);\n\n if (isBinding) return bindingPatternElements(pattern, checker);\n\n return assignmentPatternElements(pattern, checker);\n};\n\nconst addRestReads = (\n type: Type,\n consumed: Set<string>,\n context: PatternReadContext\n): void => {\n context.sink.addType(type);\n\n for (const symbol of allPropertySymbols(context.checker, type)) {\n const isConsumed = consumed.has(symbol.name);\n\n if (isConsumed) continue;\n\n addSymbolDeclarations(context.checker, symbol, context.sink);\n }\n};\n\nconst collectPatternReads = (\n pattern: DestructuringPattern,\n type: LazyType,\n context: PatternReadContext\n): void => {\n const { checker, sink, candidateNames } = context;\n const consumed = new Set<string>();\n const reads = patternElements(pattern, checker);\n\n for (const read of reads) {\n if (read.rest) {\n addRestReads(type(), consumed, context);\n continue;\n }\n\n for (const name of read.names ?? []) {\n consumed.add(name);\n }\n\n const skip = isSkippable(read, candidateNames);\n\n if (skip) continue;\n\n const symbols = addNamedProperties(checker, type(), read.names, sink);\n const nested = read.nested;\n\n if (nested === null) continue;\n\n for (const symbol of symbols) {\n const nestedType = lazyType(() => {\n return checker.getTypeOfSymbolAtLocation(symbol, read.location);\n });\n\n collectPatternReads(nested, nestedType, context);\n }\n }\n};\n\nconst collectBindingReads = (node: Node, context: PatternReadContext): void => {\n const isBinding = isBindingPattern(node);\n\n if (!isBinding) return;\n\n const isBindingElementParent = isBindingElement(node.parent);\n const isNestedBindingName =\n isBindingElementParent && node.parent.name === node;\n\n if (isNestedBindingName) return;\n\n const declaration = node.parent;\n const isDeclaration = isVariableDeclaration(declaration);\n const isInitializedDeclaration =\n isDeclaration && declaration.initializer !== undefined;\n const source = isInitializedDeclaration\n ? declaration.initializer\n : declaration;\n const sourceTypeOf = (): Type => context.checker.getTypeAtLocation(source);\n const sourceType = lazyType(sourceTypeOf);\n\n collectPatternReads(node, sourceType, context);\n};\n\nconst collectAssignmentReads = (\n node: Node,\n context: PatternReadContext\n): void => {\n const isBinary = isBinaryExpression(node);\n\n if (!isBinary) return;\n\n const isEqualsAssignment = node.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (!isEqualsAssignment) return;\n\n const isArrayTarget = isArrayLiteralExpression(node.left);\n const isObjectTarget = isObjectLiteralExpression(node.left);\n const isDestructuringAssignment = isArrayTarget || isObjectTarget;\n\n if (!isDestructuringAssignment) return;\n\n const rightTypeOf = (): Type => context.checker.getTypeAtLocation(node.right);\n const sourceType = lazyType(rightTypeOf);\n\n collectPatternReads(node.left, sourceType, context);\n};\n\nexport const collectDestructuringReads = (\n node: Node,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const context: PatternReadContext = { checker, sink, candidateNames };\n\n collectBindingReads(node, context);\n collectAssignmentReads(node, context);\n};\n", "import {\n isArrayLiteralExpression,\n isObjectLiteralExpression,\n isOmittedExpression,\n isPropertyAssignment,\n isSpreadAssignment,\n isSpreadElement\n} from 'typescript';\nimport type {\n Expression,\n ObjectLiteralElementLike,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n AssignmentPattern,\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nconst nestedPattern = (expression: Expression): DestructuringPattern | null => {\n const isArrayLiteral = isArrayLiteralExpression(expression);\n const isObjectLiteral = isObjectLiteralExpression(expression);\n const isNested = isArrayLiteral || isObjectLiteral;\n\n if (!isNested) return null;\n\n return expression;\n};\n\nconst nestedPropertyPattern = (\n property: ObjectLiteralElementLike\n): DestructuringPattern | null => {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) return null;\n\n return nestedPattern(property.initializer);\n};\n\nconst arrayElementRead = (\n element: Expression,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = isSpreadElement(element);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst propertyRead = (\n property: ObjectLiteralElementLike,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestProperty = isSpreadAssignment(property);\n\n if (isRestProperty) {\n const restRead: PatternElementRead = {\n location: property,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: property,\n names: propertyName(checker, property.name),\n nested: nestedPropertyPattern(property),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one destructuring assignment target. */\nexport const assignmentPatternElements = (\n pattern: AssignmentPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayLiteralExpression(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.properties.map((property) => propertyRead(property, checker));\n};\n", "import {\n isArrayBindingPattern,\n isIdentifier,\n isObjectBindingPattern,\n isOmittedExpression\n} from 'typescript';\nimport type {\n ArrayBindingElement,\n BindingElement,\n BindingPattern,\n Node,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nexport const isBindingPattern = (node: Node): node is BindingPattern => {\n const isArrayPattern = isArrayBindingPattern(node);\n const isObjectPattern = isObjectBindingPattern(node);\n\n return isArrayPattern || isObjectPattern;\n};\n\nconst nestedPattern = (\n element: BindingElement\n): DestructuringPattern | null => {\n const isNested = isBindingPattern(element.name);\n\n if (!isNested) return null;\n\n return element.name;\n};\n\nconst bindingNames = (\n checker: TypeChecker,\n element: BindingElement\n): string[] | null => {\n if (element.propertyName) return propertyName(checker, element.propertyName);\n\n const isIdentifierName = isIdentifier(element.name);\n\n if (!isIdentifierName) return null;\n\n return [element.name.text];\n};\n\nconst arrayElementRead = (\n element: ArrayBindingElement,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = Boolean(element.dotDotDotToken);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst objectElementRead = (\n element: BindingElement,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestElement = Boolean(element.dotDotDotToken);\n\n if (isRestElement) {\n const restRead: PatternElementRead = {\n location: element,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: element,\n names: bindingNames(checker, element),\n nested: nestedPattern(element),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one array or object binding pattern. */\nexport const bindingPatternElements = (\n pattern: BindingPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayBindingPattern(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.elements.map((element) => objectElementRead(element, checker));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isAsExpression,\n isBinaryExpression,\n isDeleteExpression,\n isForInStatement,\n isForOfStatement,\n isNonNullExpression,\n isObjectLiteralExpression,\n isParenthesizedExpression,\n isPropertyAssignment,\n isSatisfiesExpression,\n isSpreadAssignment,\n isTypeAssertionExpression\n} from 'typescript';\nimport type { Expression, Node } from 'typescript';\n\nconst isExpressionWrapper = (parent: Node, child: Node): boolean => {\n const isParenthesized = isParenthesizedExpression(parent);\n const isAs = isAsExpression(parent);\n const isTypeAssertion = isTypeAssertionExpression(parent);\n const isNonNull = isNonNullExpression(parent);\n const isSatisfies = isSatisfiesExpression(parent);\n const isCast = isAs || isTypeAssertion || isSatisfies;\n const isWrapper = isParenthesized || isNonNull || isCast;\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isPatternContainer = (parent: Node, child: Node): boolean => {\n const isArrayLiteral = isArrayLiteralExpression(parent);\n\n if (isArrayLiteral) {\n return parent.elements.some((element) => element === child);\n }\n\n const isObjectLiteral = isObjectLiteralExpression(parent);\n\n if (isObjectLiteral) {\n return parent.properties.some((property) => property === child);\n }\n\n const isAssignment = isPropertyAssignment(parent);\n\n if (isAssignment) return parent.initializer === child;\n\n const isSpread = isSpreadAssignment(parent);\n\n if (!isSpread) return false;\n\n return parent.expression === child;\n};\n\nconst isWriteTarget = (parent: Node, current: Node): boolean => {\n const isBinary = isBinaryExpression(parent);\n const isBinaryTarget =\n isBinary &&\n parent.left === current &&\n parent.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (isBinaryTarget) return true;\n\n const isDelete = isDeleteExpression(parent);\n const isDeleteTarget = isDelete && parent.expression === current;\n\n if (isDeleteTarget) return true;\n\n const isForIn = isForInStatement(parent);\n const isForOf = isForOfStatement(parent);\n const isIteration = isForIn || isForOf;\n\n return isIteration && parent.initializer === current;\n};\n\n/**\n * True when every use of `node` up through its wrapping expressions and\n * destructuring patterns writes to it rather than reading it.\n */\nexport const isWriteOnly = (node: Expression): boolean => {\n let current: Node = node;\n let parent = node.parent;\n\n while (\n isExpressionWrapper(parent, current) ||\n isPatternContainer(parent, current)\n ) {\n current = parent;\n parent = parent.parent;\n }\n\n return isWriteTarget(parent, current);\n};\n", "import { ObjectFlags, TypeFlags } from 'typescript';\nimport type {\n InterfaceType,\n ObjectType,\n SourceFile,\n Type,\n TypeChecker,\n TypeReference\n} from 'typescript';\n\nconst isObjectType = (type: Type): type is ObjectType => {\n return (type.flags & TypeFlags.Object) !== 0;\n};\n\nconst isTypeReference = (type: ObjectType): type is TypeReference => {\n return (type.objectFlags & ObjectFlags.Reference) !== 0;\n};\n\nconst isInterfaceType = (type: ObjectType): type is InterfaceType => {\n return (type.objectFlags & ObjectFlags.ClassOrInterface) !== 0;\n};\n\nconst addDeclarationFiles = (\n type: Type,\n dependencies: Set<SourceFile>\n): void => {\n for (const symbol of [type.getSymbol(), type.aliasSymbol]) {\n const declarations = symbol?.declarations ?? [];\n\n for (const declaration of declarations) {\n dependencies.add(declaration.getSourceFile());\n }\n }\n};\n\nconst baseTypesOf = (checker: TypeChecker, type: Type): Type[] => {\n const isObject = isObjectType(type);\n\n if (!isObject) return [];\n\n const isReference = isTypeReference(type);\n const target = isReference ? type.target : type;\n const isClassOrInterface = isInterfaceType(target);\n\n if (!isClassOrInterface) return [];\n\n return checker.getBaseTypes(target);\n};\n\nexport const addTypeDependencies = (\n checker: TypeChecker,\n type: Type,\n dependencies: Set<SourceFile>,\n seen: Set<Type>\n): void => {\n const isSeen = seen.has(type);\n\n if (isSeen) return;\n\n seen.add(type);\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n addTypeDependencies(checker, member, dependencies, seen);\n }\n\n return;\n }\n\n addDeclarationFiles(type, dependencies);\n\n const isTypeParameter = (type.flags & TypeFlags.TypeParameter) !== 0;\n\n if (isTypeParameter) {\n const constraint = checker.getBaseConstraintOfType(type);\n\n if (constraint) {\n addTypeDependencies(checker, constraint, dependencies, seen);\n }\n\n return;\n }\n\n for (const base of baseTypesOf(checker, type)) {\n addTypeDependencies(checker, base, dependencies, seen);\n }\n};\n", "import type { Node, SourceFile, Type, TypeChecker } from 'typescript';\n\nimport { collectAngularTemplateReads } from './angular/angular-template-reads.ts';\nimport type {\n FileEntry,\n ProjectIndex,\n TemplateReads\n} from './common/project-index.type.ts';\nimport type { ReadSink } from './common/project-usage.type.ts';\nimport { collectTypeScriptReads } from './typescript/typescript-reads.ts';\nimport { addTypeDependencies } from './typescript/typescript-type-dependencies.ts';\n\nconst failureText = (error: unknown): string => {\n if (error instanceof Error) return error.message;\n\n return String(error);\n};\n\nconst collectFileReads = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink\n): TemplateReads => {\n try {\n collectTypeScriptReads(sourceFile, checker, sink, index.candidateNames);\n\n const classes = index.classes.get(sourceFile.fileName)?.classes ?? [];\n\n return collectAngularTemplateReads({\n allNames: index.candidateNames,\n checker,\n classes,\n directives: index.directives,\n sink\n });\n } catch (error) {\n const errorMessage = failureText(error);\n\n sink.addFallbackNames(\n index.candidateNames,\n `${sourceFile.fileName}: indexing failed (${errorMessage})`\n );\n\n const noTemplateReads: TemplateReads = {\n templateVersions: [],\n usedDirectiveIndex: false\n };\n\n return noTemplateReads;\n }\n};\n\nexport const computeEntry = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker\n): FileEntry => {\n const declarations = new Set<Node>();\n const dependencies = new Set<SourceFile>();\n const fallbackNames = new Set<string>();\n const seenTypes = new Set<Type>();\n const sink: ReadSink = {\n addDeclaration: (declaration) => {\n declarations.add(declaration);\n dependencies.add(declaration.getSourceFile());\n },\n addFallbackNames: (names) => {\n for (const name of names) {\n fallbackNames.add(name);\n }\n },\n addType: (type) => {\n addTypeDependencies(checker, type, dependencies, seenTypes);\n }\n };\n const reads = collectFileReads(index, sourceFile, checker, sink);\n\n dependencies.delete(sourceFile);\n\n const fileEntry: FileEntry = {\n ...reads,\n declarations,\n dependencies,\n fallbackNames,\n sourceFile\n };\n\n return fileEntry;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isCallExpression,\n isClassLike,\n isObjectLiteralExpression\n} from 'typescript';\nimport type {\n CallExpression,\n ClassLikeDeclaration,\n Node,\n ObjectLiteralExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { scopeOf } from './angular-component-scope.ts';\nimport { angularDecoratorKind } from './angular-decorator-kind.ts';\nimport {\n exportAsOf,\n metadataProperty,\n stringValue,\n templateOf\n} from './angular-metadata-values.ts';\nimport type {\n AngularClass,\n DiscoveredClasses,\n Discovery\n} from '../common/project-usage.type.ts';\n\ntype UndecidedClass = Omit<AngularClass, 'valid'>;\n\nconst describedClass = (\n base: UndecidedClass,\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): AngularClass => {\n const selector = metadataProperty(metadata, 'selector');\n const described = {\n ...base,\n exportAs: exportAsOf(metadata, discovery),\n hostDirectives: metadataProperty(metadata, 'hostDirectives') !== undefined,\n selector: stringValue(selector, discovery)\n };\n\n if (!base.component) {\n const directiveDiscovery: AngularClass = { ...described, valid: true };\n\n return directiveDiscovery;\n }\n\n const fileName = base.declaration.getSourceFile().fileName;\n const template = templateOf(metadata, fileName, discovery);\n const componentDiscovery: AngularClass = {\n ...described,\n scope: scopeOf(metadata, discovery),\n template: template ?? null,\n valid: template !== undefined\n };\n\n return componentDiscovery;\n};\n\nconst decoratedClass = (\n declaration: ClassLikeDeclaration,\n call: CallExpression,\n discovery: Discovery\n): AngularClass | null => {\n const kind = angularDecoratorKind(call.expression, discovery);\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n const component = kind === 'Component';\n const base: UndecidedClass = {\n component,\n declaration,\n exportAs: [],\n hostDirectives: false,\n name: declaration.name?.text ?? '',\n scope: null,\n selector: null,\n template: null\n };\n const metadata = call.arguments.at(0);\n\n if (metadata === undefined) {\n const bareDiscovery: AngularClass = { ...base, valid: !component };\n\n return bareDiscovery;\n }\n\n const isMetadataObject = isObjectLiteralExpression(metadata);\n\n if (!isMetadataObject) {\n const invalidDiscovery: AngularClass = { ...base, valid: false };\n\n return invalidDiscovery;\n }\n\n return describedClass(base, metadata, discovery);\n};\n\nconst angularClass = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): AngularClass | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const found = decoratedClass(declaration, decorator.expression, discovery);\n\n if (found) return found;\n }\n\n return null;\n};\n\n/** Angular components and directives declared in one source file. */\nexport const angularClasses = (\n sourceFile: SourceFile,\n checker: TypeChecker\n): DiscoveredClasses => {\n const classes: AngularClass[] = [];\n const discovery: Discovery = { checker, dependencies: new Set() };\n\n const visit = (node: Node): void => {\n const isClass = isClassLike(node);\n\n if (isClass) {\n const found = angularClass(node, discovery);\n\n if (found) {\n classes.push(found);\n }\n }\n\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n discovery.dependencies.delete(sourceFile);\n\n const discovered: DiscoveredClasses = {\n classes,\n dependencies: discovery.dependencies\n };\n\n return discovered;\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isClassLike,\n isIdentifier,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Expression,\n ObjectLiteralExpression,\n Symbol\n} from 'typescript';\n\nimport { classDecoratorKind, resolveAlias } from './angular-decorator-kind.ts';\nimport { metadataProperty } from './angular-metadata-values.ts';\nimport type { Discovery } from '../common/project-usage.type.ts';\n\nconst booleanValue = (node: Expression | undefined): boolean | undefined => {\n if (!node) return undefined;\n\n if (node.kind === SyntaxKind.TrueKeyword) return true;\n\n if (node.kind === SyntaxKind.FalseKeyword) return false;\n\n return undefined;\n};\n\nconst classesOf = (\n symbol: Symbol,\n discovery: Discovery\n): ClassLikeDeclaration[] => {\n const resolved = resolveAlias(symbol, discovery);\n const declarations = resolved.declarations ?? [];\n\n return declarations.filter(isClassLike);\n};\n\nconst scopedClasses = (\n classes: ClassLikeDeclaration[],\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const scoped: ClassLikeDeclaration[] = [];\n\n for (const declaration of classes) {\n if (declaration.getSourceFile().isDeclarationFile) continue;\n\n const kind = classDecoratorKind(declaration, discovery);\n\n if (kind === 'Pipe') continue;\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n scoped.push(declaration);\n }\n\n return scoped;\n};\n\nconst importedClasses = (\n element: Expression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const isIdentifierElement = isIdentifier(element);\n const isPropertyAccessElement = isPropertyAccessExpression(element);\n\n if (!isIdentifierElement && !isPropertyAccessElement) return null;\n\n const target = isIdentifierElement ? element : element.name;\n const symbol = discovery.checker.getSymbolAtLocation(target);\n\n if (!symbol) return null;\n\n const classes = classesOf(symbol, discovery);\n\n if (classes.length === 0) return null;\n\n return scopedClasses(classes, discovery);\n};\n\n/**\n * Resolves a standalone component's `imports` to program classes. Library\n * classes and pipes are skipped; anything that cannot be classified (an\n * NgModule, a spread, a `forwardRef`) makes the scope unknown.\n */\nexport const scopeOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const standalone = booleanValue(metadataProperty(metadata, 'standalone'));\n const imports = metadataProperty(metadata, 'imports');\n const isModuleDeclared = standalone === undefined && !imports;\n\n if (standalone === false || isModuleDeclared) return null;\n\n if (!imports) return [];\n\n const isImportsArray = isArrayLiteralExpression(imports);\n\n if (!isImportsArray) return null;\n\n const scope: ClassLikeDeclaration[] = [];\n\n for (const element of imports.elements) {\n const classes = importedClasses(element, discovery);\n\n if (classes === null) return null;\n\n scope.push(...classes);\n }\n\n return scope;\n};\n", "import {\n SymbolFlags,\n canHaveDecorators,\n getDecorators,\n isCallExpression,\n isImportDeclaration,\n isStringLiteralLike\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Expression,\n Node,\n Symbol\n} from 'typescript';\n\nimport type { DecoratorKind, Discovery } from '../common/project-usage.type.ts';\n\nconst decoratorKinds: DecoratorKind[] = [\n 'Component',\n 'Directive',\n 'NgModule',\n 'Pipe'\n];\n\nconst isDecoratorKind = (name: string): name is DecoratorKind => {\n return decoratorKinds.some((kind) => kind === name);\n};\n\nconst isAngularCoreFile = (declaration: Declaration): boolean => {\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/core/');\n};\n\nconst parentOf = (node: Node): Node | undefined => {\n return node.parent;\n};\n\nconst importedFromAngularCore = (declaration: Declaration): boolean => {\n let current = parentOf(declaration);\n\n while (current) {\n if (isImportDeclaration(current)) {\n return (\n isStringLiteralLike(current.moduleSpecifier) &&\n current.moduleSpecifier.text === '@angular/core'\n );\n }\n\n current = parentOf(current);\n }\n\n return false;\n};\n\n/**\n * Follows an alias one hop at a time so every re-exporting file on the way\n * to the target becomes a dependency of the discovery result.\n */\nexport const resolveAlias = (symbol: Symbol, discovery: Discovery): Symbol => {\n let current = symbol;\n\n for (let hop = 0; hop < 32; hop += 1) {\n for (const declaration of current.declarations ?? []) {\n discovery.dependencies.add(declaration.getSourceFile());\n }\n\n if ((current.flags & SymbolFlags.Alias) === 0) return current;\n\n const next = discovery.checker.getImmediateAliasedSymbol(current);\n\n if (!next || next === current) return current;\n\n current = next;\n }\n\n return current;\n};\n\nexport const angularDecoratorKind = (\n expression: Expression,\n discovery: Discovery\n): DecoratorKind | null => {\n const unresolved = discovery.checker.getSymbolAtLocation(expression);\n\n if (!unresolved) return null;\n\n const symbol = resolveAlias(unresolved, discovery);\n const name = symbol.getName();\n const isKind = isDecoratorKind(name);\n\n if (!isKind) return null;\n\n const unresolvedDeclarations = unresolved.declarations ?? [];\n const symbolDeclarations = symbol.declarations ?? [];\n const isCoreImport = unresolvedDeclarations.some(importedFromAngularCore);\n const isCoreDeclaration = symbolDeclarations.some(isAngularCoreFile);\n const fromAngularCore = isCoreImport || isCoreDeclaration;\n\n if (!fromAngularCore) return null;\n\n return name;\n};\n\nexport const classDecoratorKind = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): DecoratorKind | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const kind = angularDecoratorKind(\n decorator.expression.expression,\n discovery\n );\n\n if (kind !== null) return kind;\n }\n\n return null;\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport {\n isIdentifier,\n isNumericLiteral,\n isPropertyAccessExpression,\n isPropertyAssignment,\n isStringLiteralLike\n} from 'typescript';\nimport type { Expression, ObjectLiteralExpression } from 'typescript';\n\nimport { resolveAlias } from './angular-decorator-kind.ts';\nimport type {\n AngularTemplate,\n Discovery\n} from '../common/project-usage.type.ts';\n\n/**\n * The string an expression evaluates to: a literal, or a constant whose\n * type is a single string literal (`const URL = './x.html'`, imported or\n * not). The constant's declaration file becomes a dependency.\n */\nexport const stringValue = (\n node: Expression | undefined,\n discovery: Discovery\n): string | null => {\n if (!node) return null;\n\n const isStringLiteral = isStringLiteralLike(node);\n\n if (isStringLiteral) return node.text;\n\n const isIdentifierNode = isIdentifier(node);\n const isPropertyAccessNode = isPropertyAccessExpression(node);\n\n if (isIdentifierNode || isPropertyAccessNode) {\n const symbol = discovery.checker.getSymbolAtLocation(\n isIdentifier(node) ? node : node.name\n );\n\n if (symbol) {\n resolveAlias(symbol, discovery);\n }\n }\n\n const type = discovery.checker.getTypeAtLocation(node);\n\n return type.isStringLiteral() ? type.value : null;\n};\n\nexport const metadataProperty = (\n metadata: ObjectLiteralExpression,\n name: string\n): Expression | undefined => {\n for (const property of metadata.properties) {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) continue;\n\n const isIdentifierName = isIdentifier(property.name);\n const isStringName = isStringLiteralLike(property.name);\n const isNumericName = isNumericLiteral(property.name);\n const isLiteralName = isIdentifierName || isStringName || isNumericName;\n const isPropertyNamed = isLiteralName && property.name.text === name;\n\n if (isPropertyNamed) return property.initializer;\n }\n\n return undefined;\n};\n\nexport const templateOf = (\n metadata: ObjectLiteralExpression,\n fileName: string,\n discovery: Discovery\n): AngularTemplate | null | undefined => {\n const inline = metadataProperty(metadata, 'template');\n\n if (inline) {\n const source = stringValue(inline, discovery);\n\n if (source === null) return undefined;\n\n const inlineTemplate: AngularTemplate = { kind: 'inline', source };\n\n return inlineTemplate;\n }\n\n const url = metadataProperty(metadata, 'templateUrl');\n\n if (url) {\n const text = stringValue(url, discovery);\n\n if (text === null) return undefined;\n\n const externalFileName = resolve(dirname(fileName), text);\n const externalTemplate: AngularTemplate = {\n fileName: externalFileName,\n kind: 'external'\n };\n\n return externalTemplate;\n }\n\n return null;\n};\n\nexport const exportAsOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): string[] => {\n const exportAsProperty = metadataProperty(metadata, 'exportAs');\n const exportAs = stringValue(exportAsProperty, discovery) ?? '';\n const names = exportAs.split(',').map((name) => name.trim());\n\n return names.filter(Boolean);\n};\n", "const specFilePattern = /\\.spec\\.[cm]?[tj]sx?$/u;\n\nexport const isSpecFile = (fileName: string): boolean => {\n return specFilePattern.test(fileName);\n};\n", "import type { Program, SourceFile } from 'typescript';\n\nimport { templateFileIsCurrent } from './angular/angular-template-reads.ts';\nimport type {\n FileEntry,\n ProjectIndex,\n SourceFileMaps,\n TemplateFileVersion\n} from './common/project-index.type.ts';\nimport { isSpecFile } from './utils/spec-file.util.ts';\n\nconst typeScriptFilePattern = /\\.(?:[cm]?ts|tsx)$/u;\n\nconst isIndexable = (program: Program, sourceFile: SourceFile): boolean => {\n if (sourceFile.isDeclarationFile) return false;\n\n const isExternal = program.isSourceFileFromExternalLibrary(sourceFile);\n\n if (isExternal) return false;\n\n const isSpec = isSpecFile(sourceFile.fileName);\n\n if (isSpec) return false;\n\n return typeScriptFilePattern.test(sourceFile.fileName);\n};\n\nexport const indexableSourceFiles = (program: Program): SourceFile[] => {\n const sourceFiles = program.getSourceFiles();\n\n return sourceFiles.filter((sourceFile) => isIndexable(program, sourceFile));\n};\n\nexport const sourceFileMaps = (program: Program): SourceFileMaps => {\n const all = new Map<string, SourceFile>();\n const current = new Map<string, SourceFile>();\n\n for (const sourceFile of program.getSourceFiles()) {\n all.set(sourceFile.fileName, sourceFile);\n }\n\n for (const sourceFile of indexableSourceFiles(program)) {\n current.set(sourceFile.fileName, sourceFile);\n }\n\n const maps: SourceFileMaps = { all, current };\n\n return maps;\n};\n\nexport const dropEntries = (\n index: ProjectIndex,\n stale: (entry: FileEntry) => boolean\n): void => {\n for (const [fileName, entry] of index.entries) {\n const isStale = stale(entry);\n\n if (isStale) {\n index.entries.delete(fileName);\n }\n }\n};\n\nexport const isReplaced = (\n sourceFile: SourceFile,\n dependencies: ReadonlySet<SourceFile>,\n maps: SourceFileMaps\n): boolean => {\n const indexedSourceFile = maps.current.get(sourceFile.fileName);\n\n if (indexedSourceFile !== sourceFile) return true;\n\n for (const dependency of dependencies) {\n const indexedDependency = maps.all.get(dependency.fileName);\n\n if (indexedDependency !== dependency) return true;\n }\n\n return false;\n};\n\nexport const dropReplacedEntries = (\n index: ProjectIndex,\n maps: SourceFileMaps\n): void => {\n const isEntryReplaced = (entry: FileEntry): boolean => {\n return isReplaced(entry.sourceFile, entry.dependencies, maps);\n };\n\n dropEntries(index, isEntryReplaced);\n};\n\nexport const dropEntriesMentioning = (\n index: ProjectIndex,\n names: ReadonlySet<string>\n): void => {\n if (names.size === 0) return;\n\n if (index.entries.size === 0) return;\n\n const nameList = [...names];\n const mentionsName = (entry: FileEntry): boolean => {\n return nameList.some((name) => entry.sourceFile.text.includes(name));\n };\n\n dropEntries(index, mentionsName);\n};\n\nconst templateVersionChecker = (): ((\n version: TemplateFileVersion\n) => boolean) => {\n const checked = new Map<string, boolean>();\n\n return (version: TemplateFileVersion): boolean => {\n const key = `${version.fileName}\\0${version.mtimeNs}\\0${version.size}`;\n const known = checked.get(key);\n\n if (known !== undefined) return known;\n\n const current = templateFileIsCurrent(version);\n\n checked.set(key, current);\n\n return current;\n };\n};\n\nexport const dropStaleTemplateEntries = (\n index: ProjectIndex,\n force: boolean\n): void => {\n const now = performance.now();\n const sinceLastCheck = now - index.templateCheckedAt;\n const isThrottled =\n !force && sinceLastCheck < index.templateCheckDuration * 100;\n\n if (isThrottled) return;\n\n const isCurrent = templateVersionChecker();\n const hasStaleTemplate = (entry: FileEntry): boolean => {\n return !entry.templateVersions.every(isCurrent);\n };\n\n dropEntries(index, hasStaleTemplate);\n\n index.templateCheckedAt = now;\n index.templateCheckDuration = performance.now() - now;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isClassLike,\n isIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { ClassLikeDeclaration, Node, SourceFile } from 'typescript';\n\nconst isDecoratedClass = (node: ClassLikeDeclaration): boolean => {\n const isDecoratable = canHaveDecorators(node);\n\n if (!isDecoratable) return false;\n\n const decorators = getDecorators(node);\n const decoratorCount = decorators?.length ?? 0;\n\n return decoratorCount > 0;\n};\n\nconst addMemberNames = (node: Node, names: Set<string>): void => {\n const isClass = isClassLike(node);\n\n if (!isClass) return;\n\n const isDecorated = isDecoratedClass(node);\n\n if (!isDecorated) return;\n\n for (const member of node.members) {\n if (!member.name) continue;\n\n const isIdentifierName = isIdentifier(member.name);\n const isStringName = isStringLiteralLike(member.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (isNamedMember) {\n names.add(member.name.text);\n }\n }\n};\n\n/** Names of members declared by decorated classes in one source file. */\nexport const collectCandidateNames = (sourceFile: SourceFile): Set<string> => {\n const names = new Set<string>();\n\n const visit = (node: Node): void => {\n addMemberNames(node, names);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return names;\n};\n", "import type { SourceFile } from 'typescript';\n\nimport { angularClasses } from './angular/angular-component-discovery.ts';\nimport {\n buildDirectiveIndex,\n directiveShape\n} from './angular/angular-directive-index.ts';\nimport type {\n FileClasses,\n LazyChecker,\n ProjectIndex,\n SourceFileMaps\n} from './common/project-index.type.ts';\nimport { dropEntries, isReplaced } from './project-index-staleness.ts';\nimport { collectCandidateNames } from './typescript/typescript-candidate-names.ts';\n\nconst dropReplacedClasses = (\n index: ProjectIndex,\n maps: SourceFileMaps\n): boolean => {\n let changed = false;\n\n for (const [fileName, fileClasses] of index.classes) {\n const replaced = isReplaced(\n fileClasses.sourceFile,\n fileClasses.dependencies,\n maps\n );\n\n if (!replaced) continue;\n\n index.classes.delete(fileName);\n changed = true;\n }\n\n return changed;\n};\n\nconst addCandidateNames = (\n index: ProjectIndex,\n candidateNames: ReadonlySet<string>,\n newNames: Set<string>\n): void => {\n for (const name of candidateNames) {\n const isKnownName = index.candidateNames.has(name);\n\n if (isKnownName) continue;\n\n index.candidateNames.add(name);\n newNames.add(name);\n }\n};\n\nconst indexFileClasses = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: LazyChecker,\n newNames: Set<string>\n): void => {\n const candidateNames = collectCandidateNames(sourceFile);\n\n addCandidateNames(index, candidateNames, newNames);\n\n const { classes, dependencies } = angularClasses(sourceFile, checker());\n const fileClasses: FileClasses = {\n candidateNames,\n classes,\n dependencies,\n sourceFile\n };\n\n index.classes.set(sourceFile.fileName, fileClasses);\n index.entries.delete(sourceFile.fileName);\n};\n\nconst indexNewClasses = (\n index: ProjectIndex,\n current: ReadonlyMap<string, SourceFile>,\n checker: LazyChecker,\n newNames: Set<string>\n): boolean => {\n let changed = false;\n\n for (const [fileName, sourceFile] of current) {\n const isIndexed = index.classes.has(fileName);\n\n if (isIndexed) continue;\n\n indexFileClasses(index, sourceFile, checker, newNames);\n changed = true;\n }\n\n return changed;\n};\n\nconst rebuildDirectives = (index: ProjectIndex): void => {\n const fileClasses = [...index.classes.values()];\n const classes = fileClasses.flatMap((entry) => entry.classes);\n const shape = directiveShape(classes);\n\n index.directives = buildDirectiveIndex(classes);\n\n if (shape === index.directiveShape) return;\n\n index.directiveShape = shape;\n dropEntries(index, (entry) => entry.usedDirectiveIndex);\n};\n\n/** Re-index changed files' classes; returns member names never seen before. */\nexport const reconcileClasses = (\n index: ProjectIndex,\n maps: SourceFileMaps,\n checker: LazyChecker\n): Set<string> => {\n const newNames = new Set<string>();\n const droppedClasses = dropReplacedClasses(index, maps);\n const addedClasses = indexNewClasses(index, maps.current, checker, newNames);\n const changed = droppedClasses || addedClasses;\n\n if (changed) {\n rebuildDirectives(index);\n }\n\n return newNames;\n};\n", "import type { Program, SourceFile, TypeChecker } from 'typescript';\n\nimport type { LazyChecker, ProjectIndex } from './common/project-index.type.ts';\nimport { computeEntry } from './project-file-entry.ts';\nimport { reconcileClasses } from './project-index-classes.ts';\nimport {\n dropEntriesMentioning,\n dropReplacedEntries,\n dropStaleTemplateEntries,\n indexableSourceFiles,\n sourceFileMaps\n} from './project-index-staleness.ts';\n\nconst lazyChecker = (program: Program): LazyChecker => {\n let typeChecker: TypeChecker | undefined;\n\n return () => (typeChecker ??= program.getTypeChecker());\n};\n\nconst indexMissingEntries = (\n index: ProjectIndex,\n sourceFiles: Iterable<SourceFile>,\n checker: LazyChecker\n): void => {\n for (const sourceFile of sourceFiles) {\n const isEntryIndexed = index.entries.has(sourceFile.fileName);\n\n if (isEntryIndexed) continue;\n\n const entry = computeEntry(index, sourceFile, checker());\n\n index.entries.set(sourceFile.fileName, entry);\n }\n};\n\nconst reindexProgram = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const maps = sourceFileMaps(program);\n\n dropReplacedEntries(index, maps);\n\n const newNames = reconcileClasses(index, maps, checker);\n\n dropEntriesMentioning(index, newNames);\n\n index.program = program;\n index.usage = undefined;\n dropStaleTemplateEntries(index, true);\n indexMissingEntries(index, maps.current.values(), checker);\n};\n\nconst refreshTemplateEntries = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const entryCount = index.entries.size;\n\n dropStaleTemplateEntries(index, false);\n\n const isUnchanged = index.entries.size === entryCount;\n\n if (isUnchanged) return;\n\n index.usage = undefined;\n indexMissingEntries(index, indexableSourceFiles(program), checker);\n};\n\nexport const reconcile = (index: ProjectIndex, program: Program): void => {\n const checker = lazyChecker(program);\n const isNewProgram = index.program !== program;\n\n if (isNewProgram) {\n reindexProgram(index, program, checker);\n\n return;\n }\n\n refreshTemplateEntries(index, program, checker);\n};\n", "import { defineConfig } from 'eslint/config';\n\nimport { baseLimits } from './base-limits.ts';\nimport { basePractices } from './base-practices.ts';\nimport { baseRecommended } from './base-recommended.ts';\n\nexport const base = defineConfig([\n ...baseRecommended,\n ...basePractices,\n ...baseLimits\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const baseLimits = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts',\n '**/*.html'\n ],\n rules: {\n 'max-lines': [\n 'error',\n {\n max: 150,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n 'max-lines-per-function': 'off',\n complexity: ['warn', { max: 3 }],\n 'max-lines': [\n 'error',\n {\n max: 300,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n 'max-classes-per-file': 'off'\n }\n },\n {\n files: ['**/*.state.ts'],\n rules: {\n 'class-methods-use-this': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const basePractices = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'no-param-reassign': 'error',\n 'no-alert': 'error',\n 'no-console': ['warn', { allow: ['warn', 'error'] }],\n 'no-debugger': 'error',\n eqeqeq: ['error', 'always', { null: 'ignore' }],\n curly: ['error', 'multi-line'],\n 'prefer-const': ['error', { destructuring: 'all' }],\n 'no-var': 'error',\n 'object-shorthand': 'error',\n 'prefer-arrow-callback': 'error',\n 'no-useless-concat': 'error',\n 'prefer-template': 'error',\n 'no-nested-ternary': 'error',\n 'no-useless-assignment': 'error', // NEW: Catch unused assignments (ESLint v9)\n 'no-object-constructor': 'error', // Disallow new Object() without arguments\n 'no-else-return': ['error', { allowElseIf: false }], // Prefer early returns\n 'no-multi-assign': 'error', // Disallow chaining assignments\n radix: 'error', // Require radix parameter for parseInt()\n yoda: 'error', // Disallow yoda conditions (`if (\"red\" === color)`)\n complexity: ['warn', 10], // Warn if function complexity is high\n 'max-depth': ['warn', 4], // Warn on deeply nested blocks\n 'max-lines-per-function': [\n 'warn',\n { max: 50, skipBlankLines: true, skipComments: true }\n ], // Warn on long functions\n 'max-params': ['warn', 4], // Warn on functions with many parameters\n 'no-lonely-if': 'error', // Disallow if statements as the only statement in an else block\n 'grouped-accessor-pairs': ['error', 'getBeforeSet'], // Enforce consistency for getters/setters\n 'class-methods-use-this': 'error',\n 'no-underscore-dangle': 'error',\n 'max-len': [\n 'error',\n {\n code: 135,\n ignoreComments: true\n }\n ],\n 'spaced-comment': [\n 2,\n 'always',\n {\n block: {\n exceptions: ['*']\n }\n }\n ],\n '@stylistic/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n prev: 'export',\n next: ['export', 'const']\n },\n {\n blankLine: 'always',\n prev: ['const', 'let', 'var'],\n next: '*'\n },\n {\n blankLine: 'any',\n prev: ['const', 'let', 'var'],\n next: ['const', 'let', 'var']\n },\n {\n blankLine: 'always',\n prev: '*',\n next: [\n 'for',\n 'if',\n 'return',\n 'throw',\n 'switch',\n 'try',\n 'class',\n 'function'\n ]\n }\n ],\n '@stylistic/comma-dangle': ['error', 'never'],\n '@stylistic/indent': [\n 'error',\n 2,\n {\n offsetTernaryExpressions: true,\n SwitchCase: 1,\n ignoredNodes: [\n 'TSTypeParameterInstantiation',\n 'FunctionExpression > .params > :matches(Decorator, :not(:first-child))'\n ]\n }\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n allowSeparatedGroups: true\n }\n ]\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport stylistic from '@stylistic/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\n\nexport const baseRecommended = defineConfig([\n { extends: [...configs['flat/base']] },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [importPluginX.flatConfigs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [stylistic.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport boundariesPlugin from 'eslint-plugin-boundaries';\n\nexport const boundaries = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n boundaries: boundariesPlugin\n },\n settings: {\n 'boundaries/elements': [\n {\n type: 'feature',\n pattern: '**/feature/**'\n },\n {\n type: 'data-access',\n pattern: '**/data-access/**'\n },\n {\n type: 'domain-logic',\n pattern: '**/domain-logic/**'\n },\n {\n type: 'ui',\n pattern: '**/ui/**'\n },\n {\n type: 'common',\n pattern: '**/common/**'\n },\n {\n type: 'utils',\n pattern: '**/utils/**'\n }\n ],\n 'import/resolver': {\n typescript: {\n alwaysTryTypes: true\n }\n }\n },\n rules: {\n ...boundariesPlugin.configs.recommended.rules,\n 'boundaries/dependencies': [\n 'error',\n {\n default: 'disallow',\n message:\n '{{to.element.types}} is not allowed to be imported in {{from.element.types}}',\n policies: [\n {\n from: { element: { type: 'feature' } },\n allow: [\n { to: { element: { type: 'feature' } } },\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'domain-logic' } },\n allow: [\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'data-access' } },\n allow: [\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'ui' } },\n allow: [\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'utils' } },\n allow: [\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'common' } },\n allow: [{ to: { element: { type: 'common' } } }]\n }\n ]\n }\n ]\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n 'boundaries/dependencies': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxJavascript: CompatibleConfigArray = configs['flat/javascript'];\n\nexport const javascript = defineConfig({\n files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],\n extends: nxJavascript\n});\n", "import jsonPlugin from '@eslint/json';\nimport { defineConfig } from 'eslint/config';\n\nexport const json = defineConfig([\n {\n plugins: { json: jsonPlugin }\n },\n {\n files: ['**/*.json'],\n language: 'json/json',\n extends: [jsonPlugin.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport playwrightEslint from 'eslint-plugin-playwright';\n\nexport const playwright = defineConfig([\n {\n ...playwrightEslint.configs['flat/recommended'],\n files: ['**/*.e2e.ts', '**/*.e2e.js'],\n rules: {\n ...playwrightEslint.configs['flat/recommended'].rules,\n // Locator best practices\n 'playwright/prefer-locator': 'error',\n 'playwright/prefer-native-locators': 'error',\n 'playwright/no-nth-methods': 'warn',\n // Matcher improvements\n 'playwright/prefer-to-be': 'error',\n 'playwright/prefer-to-have-count': 'error',\n 'playwright/prefer-to-have-length': 'error',\n 'playwright/prefer-comparison-matcher': 'error',\n // Test structure\n 'playwright/prefer-hooks-on-top': 'error',\n 'playwright/require-top-level-describe': 'warn'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport eslintConfigPrettier from 'eslint-config-prettier';\n\nexport const prettier = defineConfig([eslintConfigPrettier]);\n", "import rxjsEslint from '@smarttools/eslint-plugin-rxjs';\nimport { defineConfig } from 'eslint/config';\n\nexport const rxjs = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n extends: [rxjsEslint.configs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n rxjs: rxjsEslint\n }\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'rxjs/prefer-observer': 'error',\n 'rxjs/finnish': 'warn',\n 'rxjs/no-ignored-subscription': 'warn',\n 'rxjs/no-ignored-error': 'warn',\n 'rxjs/no-unsafe-switchmap': 'error',\n 'rxjs/no-unsafe-takeuntil': 'error',\n 'rxjs/no-unsafe-catch': 'error',\n 'rxjs/no-unsafe-first': 'error',\n 'rxjs/no-topromise': 'error',\n 'rxjs/throw-error': 'error',\n 'rxjs/no-async-subscribe': 'off',\n 'rxjs/no-exposed-subjects': 'error', // Enforce subject encapsulation\n 'rxjs/no-cyclic-action': 'error', // Prevent infinite loops in NgRx effects\n 'rxjs/no-subscribe-handlers': 'warn' // Prefer observer objects (complements prefer-observer)\n }\n },\n {\n files: ['**/*.spec.ts', '**/*.test.ts', '**/*.spec.js', '**/*.test.js'],\n rules: {\n 'rxjs/no-ignored-subscription': 'off',\n 'rxjs/no-subscribe-handlers': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport storybookEslint from 'eslint-plugin-storybook';\n\nexport const storybook = defineConfig([\n {\n ignores: ['!.storybook'],\n files: ['**/*.stories.ts'],\n extends: [storybookEslint.configs['flat/recommended']],\n rules: {\n 'storybook/csf-component': 'warn', // Ensure component property is set\n 'storybook/no-stories-of': 'error' // Prevent deprecated storiesOf API\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { typescriptConsistency } from './typescript-consistency.ts';\nimport { typescriptImports } from './typescript-imports.ts';\nimport { typescriptOverrides } from './typescript-overrides.ts';\nimport { typescriptRecommended } from './typescript-recommended.ts';\nimport { typescriptSafety } from './typescript-safety.ts';\n\nexport { localPlugin } from './typescript-local-plugin.ts';\n\nexport const typescript = defineConfig([\n ...typescriptRecommended,\n ...typescriptSafety,\n ...typescriptConsistency,\n ...typescriptImports,\n ...typescriptOverrides\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptConsistency = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': [\n 'error',\n { assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }\n ],\n '@typescript-eslint/consistent-type-definitions': ['error', 'type'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n { prefer: 'type-imports', fixStyle: 'separate-type-imports' }\n ],\n '@typescript-eslint/naming-convention': [\n 'error',\n {\n selector: ['objectLiteralProperty', 'objectLiteralMethod'],\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'objectLiteralMethod',\n format: ['camelCase', 'PascalCase']\n },\n {\n selector: 'objectLiteralProperty',\n format: ['camelCase', 'snake_case', 'PascalCase']\n },\n {\n selector: 'parameter',\n format: ['camelCase'],\n leadingUnderscore: 'allow'\n },\n { selector: 'default', format: ['camelCase'] },\n { selector: 'variable', format: ['camelCase', 'UPPER_CASE'] },\n { selector: 'function', format: ['camelCase'] },\n { selector: 'typeLike', format: ['PascalCase'] },\n {\n selector: 'property',\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'property',\n format: ['camelCase', 'PascalCase', 'snake_case']\n }\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';\n\nconst pathGroups = [\n { pattern: '@angular/**', group: 'builtin', position: 'before' },\n { pattern: '@nestjs/**', group: 'builtin', position: 'before' },\n { pattern: '@shared/**', group: 'internal', position: 'before' },\n { pattern: '@backend/**', group: 'internal', position: 'before' },\n { pattern: '@frontend/**', group: 'internal', position: 'before' },\n { pattern: '@*/shared/**', group: 'internal', position: 'before' },\n { pattern: '@*/frontend/**', group: 'internal', position: 'after' },\n { pattern: '@*/backend/**', group: 'internal', position: 'after' }\n];\n\nexport const typescriptImports = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n 'import-x/order': [\n 'error',\n {\n groups: [\n 'builtin',\n 'external',\n 'internal',\n ['parent', 'sibling'],\n 'index',\n 'unknown'\n ],\n pathGroups,\n pathGroupsExcludedImportTypes: ['builtin'],\n 'newlines-between': 'always',\n alphabetize: { order: 'asc', caseInsensitive: true }\n }\n ],\n // TypeScript already checks these four; import-x would re-parse every import with a parser resolved by name, which fails under pnpm.\n 'import-x/namespace': 'off',\n 'import-x/default': 'off',\n 'import-x/no-named-as-default': 'off',\n 'import-x/no-named-as-default-member': 'off',\n 'import-x/no-unresolved': 'error',\n 'import-x/no-duplicates': 'error',\n 'import-x/prefer-default-export': 'off',\n 'import-x/no-useless-path-segments': ['error', { noUselessIndex: true }],\n 'import-x/newline-after-import': 'error',\n 'import-x/first': 'error',\n 'import-x/no-mutable-exports': 'error',\n 'import-x/no-self-import': 'error',\n 'import-x/no-cycle': ['error', { maxDepth: 2, ignoreExternal: true }],\n 'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],\n 'import-x/no-anonymous-default-export': 'error'\n },\n settings: {\n 'import-x/resolver-next': [\n createTypeScriptImportResolver({\n alwaysTryTypes: true\n })\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptOverrides = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n rules: {\n '@typescript-eslint/prefer-readonly': 'error'\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n '@typescript-eslint/no-namespace': 'off',\n '@typescript-eslint/no-extraneous-class': 'off'\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/unbound-method': 'off',\n '@typescript-eslint/consistent-type-assertions': 'off'\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': 'off',\n '@typescript-eslint/naming-convention': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxTypescript: CompatibleConfigArray = configs['flat/typescript'];\n\nexport const typescriptRecommended = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n extends: [importPluginX.flatConfigs.typescript, ...nxTypescript]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { localPlugin } from './typescript-local-plugin.ts';\n\nexport const typescriptSafety = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n plugins: { local: localPlugin },\n rules: {\n 'local/explicit-accessibility': 'error',\n 'local/readonly-type-properties': 'error',\n 'local/no-inline-object-types': 'error',\n '@typescript-eslint/explicit-function-return-type': 'error',\n '@typescript-eslint/no-empty-function': 'error',\n '@typescript-eslint/no-unused-vars': 'error',\n '@typescript-eslint/no-use-before-define': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n '@typescript-eslint/no-unsafe-assignment': 'error',\n '@typescript-eslint/no-unsafe-call': 'error',\n '@typescript-eslint/no-unsafe-member-access': 'error',\n '@typescript-eslint/no-unsafe-return': 'error',\n '@typescript-eslint/no-unsafe-argument': 'error',\n '@typescript-eslint/no-empty-object-type': 'error',\n '@typescript-eslint/no-unsafe-function-type': 'error',\n '@typescript-eslint/no-wrapper-object-types': 'error',\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-non-null-assertion': 'error',\n '@typescript-eslint/prefer-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-optional-chain': 'error',\n '@typescript-eslint/no-floating-promises': [\n 'error',\n { ignoreVoid: true }\n ],\n '@typescript-eslint/no-misused-promises': 'warn',\n '@typescript-eslint/promise-function-async': 'error',\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-inferrable-types': 'warn',\n '@typescript-eslint/no-require-imports': 'error',\n '@typescript-eslint/only-throw-error': 'error',\n '@typescript-eslint/no-array-delete': 'error',\n '@typescript-eslint/return-await': ['error', 'in-try-catch'],\n '@typescript-eslint/require-await': 'error',\n '@typescript-eslint/restrict-template-expressions': [\n 'error',\n { allowNumber: true, allowBoolean: true }\n ],\n '@typescript-eslint/restrict-plus-operands': 'error',\n '@typescript-eslint/prefer-as-const': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/switch-exhaustiveness-check': 'error',\n '@typescript-eslint/no-unused-expressions': [\n 'error',\n { allowShortCircuit: true, allowTernary: true }\n ],\n '@typescript-eslint/no-useless-constructor': 'error',\n '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],\n '@typescript-eslint/no-unnecessary-condition': 'error',\n '@typescript-eslint/no-confusing-void-expression': [\n 'error',\n { ignoreArrowShorthand: true, ignoreVoidOperator: true }\n ],\n '@typescript-eslint/no-dynamic-delete': 'error',\n '@typescript-eslint/no-extraneous-class': [\n 'error',\n { allowWithDecorator: true }\n ],\n '@typescript-eslint/no-invalid-void-type': 'error',\n '@typescript-eslint/unified-signatures': 'error',\n '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-find': 'error',\n '@typescript-eslint/prefer-for-of': 'error',\n '@typescript-eslint/prefer-includes': 'error',\n '@typescript-eslint/prefer-string-starts-ends-with': 'error',\n '@typescript-eslint/prefer-regexp-exec': 'error'\n }\n }\n]);\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n accessibilities,\n defaultOptions,\n meta\n} from './common/explicit-accessibility.const.ts';\nimport type {\n Accessibility,\n AutoFix,\n Fix,\n FixAccessibility,\n Member,\n MessageIds,\n Options\n} from './common/explicit-accessibility.type.ts';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#explicit-accessibility'\n);\n\nconst isPrivateMember = (node: Member): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.TSParameterProperty) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.PrivateIdentifier;\n};\n\nconst isConstructor = (node: Member): boolean => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.kind === 'constructor';\n};\n\nconst reportTarget = (node: Member): TSESTree.Node => {\n if (node.type !== TSESTree.AST_NODE_TYPES.TSParameterProperty) {\n return node.key;\n }\n\n const { parameter } = node;\n\n if (parameter.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parameter.left;\n }\n\n return parameter;\n};\n\nconst memberName = (\n target: TSESTree.Node,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (target.type === TSESTree.AST_NODE_TYPES.Identifier) return target.name;\n\n return sourceCode.getText(target);\n};\n\nconst modifierToken = (\n node: Member,\n sourceCode: TSESLint.SourceCode\n): TSESTree.Token | null => {\n const lastDecorator = node.decorators.at(-1);\n\n if (!lastDecorator) return sourceCode.getFirstToken(node);\n\n return sourceCode.getTokenAfter(lastDecorator);\n};\n\nconst insertModifier = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): Fix => {\n const token = modifierToken(node, sourceCode);\n\n if (!token) return () => null;\n\n const lastDecorator = node.decorators.at(-1);\n const adjacentToDecorator = lastDecorator?.range[1] === token.range[0];\n const text = `${adjacentToDecorator ? ' ' : ''}${accessibility} `;\n\n return (fixer) => fixer.insertTextBefore(token, text);\n};\n\nconst autoFixOf = (\n node: Member,\n accessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): AutoFix => {\n if (accessibility === 'none') {\n const noAutoFix: AutoFix = {};\n\n return noAutoFix;\n }\n\n const fix = insertModifier(node, accessibility, sourceCode);\n const autoFix: AutoFix = { fix };\n\n return autoFix;\n};\n\nconst suggestionOf = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const data = { accessibility };\n const fix = insertModifier(node, accessibility, sourceCode);\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'setAccessibility',\n data,\n fix\n };\n\n return suggestion;\n};\n\nconst suggestionsOf = (\n node: Member,\n fixAccessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds>[] => {\n const isOtherAccessibility = (accessibility: Accessibility): boolean => {\n return accessibility !== fixAccessibility;\n };\n\n const suggestionFor = (\n accessibility: Accessibility\n ): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n return suggestionOf(node, accessibility, sourceCode);\n };\n\n return accessibilities.filter(isOtherAccessibility).map(suggestionFor);\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'explicit-accessibility',\n meta,\n defaultOptions,\n create(context, [{ defaultAccessibility = 'public' }]) {\n const { sourceCode } = context;\n\n const check = (node: Member): void => {\n const isPrivate = isPrivateMember(node);\n\n if (node.accessibility || isPrivate) return;\n\n const target = reportTarget(node);\n const isConstructorMember = isConstructor(node);\n const usesPublic = isConstructorMember && defaultAccessibility !== 'none';\n const fixAccessibility: FixAccessibility = usesPublic\n ? 'public'\n : defaultAccessibility;\n const autoFix = autoFixOf(node, fixAccessibility, sourceCode);\n const name = memberName(target, sourceCode);\n const data = { name };\n const suggest = suggestionsOf(node, fixAccessibility, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: target,\n messageId: 'missingAccessibility',\n data,\n ...autoFix,\n suggest\n };\n\n context.report(report);\n };\n\n const listeners: TSESLint.RuleListener = {\n AccessorProperty: check,\n MethodDefinition: check,\n PropertyDefinition: check,\n TSAbstractAccessorProperty: check,\n TSAbstractMethodDefinition: check,\n TSAbstractPropertyDefinition: check,\n TSParameterProperty: check\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type {\n Accessibility,\n MessageIds,\n Options\n} from './explicit-accessibility.type.ts';\n\nexport const accessibilities: readonly Accessibility[] = [\n 'public',\n 'private',\n 'protected'\n];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description: 'Require explicit accessibility modifiers on class members'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingAccessibility:\n \"Class member '{{ name }}' is missing an explicit accessibility modifier (public/private/protected).\",\n setAccessibility: \"Add the '{{ accessibility }}' modifier.\"\n};\n\nconst defaultAccessibilitySchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['public', 'private', 'protected', 'none'],\n description:\n \"The accessibility modifier inserted by the auto-fix; constructors always get public. 'none' reports without an auto-fix and offers all three levels as suggestions.\"\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n defaultAccessibility: defaultAccessibilitySchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n hasSuggestions: true,\n schema,\n messages\n};\n\nexport const defaultOptions: Options = [{ defaultAccessibility: 'public' }];\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'inlineObjectType';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require nested object types inside a type alias to be extracted to a named type alias'\n};\n\nconst messages: Record<MessageIds, string> = {\n inlineObjectType:\n 'Inline object type must be extracted to a named type alias.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-inline-object-types'\n);\n\nconst enclosingTypeAlias = (\n node: TSESTree.Node\n): TSESTree.TSTypeAliasDeclaration | undefined => {\n let current: TSESTree.Node | undefined = node.parent;\n\n while (current && current.type !== TSESTree.AST_NODE_TYPES.Program) {\n if (current.type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration) {\n return current;\n }\n\n current = current.parent;\n }\n\n return undefined;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-inline-object-types',\n meta,\n defaultOptions: [],\n create(context) {\n const listeners: TSESLint.RuleListener = {\n TSTypeLiteral(node): void {\n const isAliasBody =\n node.parent.type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration;\n\n if (isAliasBody) return;\n\n const enclosingAlias = enclosingTypeAlias(node);\n\n if (!enclosingAlias) return;\n\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'inlineObjectType'\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'missingReadonly';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require readonly on primitive-typed type and interface properties'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingReadonly:\n \"Type property '{{ name }}' should be readonly. Disable this rule on the line if mutation is required.\"\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#readonly-type-properties'\n);\n\nconst propertyName = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (node.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return node.key.name;\n }\n\n return sourceCode.getText(node.key);\n};\n\nconst PRIMITIVE_KEYWORDS = new Set([\n TSESTree.AST_NODE_TYPES.TSStringKeyword,\n TSESTree.AST_NODE_TYPES.TSNumberKeyword,\n TSESTree.AST_NODE_TYPES.TSBooleanKeyword,\n TSESTree.AST_NODE_TYPES.TSBigIntKeyword,\n TSESTree.AST_NODE_TYPES.TSSymbolKeyword,\n TSESTree.AST_NODE_TYPES.TSNullKeyword,\n TSESTree.AST_NODE_TYPES.TSUndefinedKeyword\n]);\n\nconst isPrimitive = (type: TSESTree.TypeNode): boolean => {\n const isPrimitiveKeyword = PRIMITIVE_KEYWORDS.has(type.type);\n\n if (isPrimitiveKeyword) return true;\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSLiteralType ||\n type.type === TSESTree.AST_NODE_TYPES.TSTemplateLiteralType\n ) {\n return true;\n }\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSUnionType ||\n type.type === TSESTree.AST_NODE_TYPES.TSIntersectionType\n ) {\n return type.types.every(isPrimitive);\n }\n\n return false;\n};\n\nconst readonlyFix = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): TSESLint.ReportFixFunction => {\n return (fixer) => {\n const firstToken = sourceCode.getFirstToken(node);\n\n if (!firstToken) return null;\n\n return fixer.insertTextBefore(firstToken, 'readonly ');\n };\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'readonly-type-properties',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n TSPropertySignature(node): void {\n if (node.readonly || !node.typeAnnotation) return;\n\n const isPrimitiveType = isPrimitive(node.typeAnnotation.typeAnnotation);\n\n if (!isPrimitiveType) return;\n\n const name = propertyName(node, sourceCode);\n const data = { name };\n const fix = readonlyFix(node, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: node.key,\n messageId: 'missingReadonly',\n data,\n fix\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { definePlugin } from './rules/define-plugin.util.ts';\nimport explicitAccessibilityRule from './rules/explicit-accessibility/explicit-accessibility.ts';\nimport noInlineObjectTypesRule from './rules/no-inline-object-types/no-inline-object-types.ts';\nimport readonlyTypePropertiesRule from './rules/readonly-type-properties/readonly-type-properties.ts';\n\nexport const localPlugin = definePlugin('local', {\n 'explicit-accessibility': explicitAccessibilityRule,\n 'readonly-type-properties': readonlyTypePropertiesRule,\n 'no-inline-object-types': noInlineObjectTypesRule\n});\n", "import vitestEslint from '@vitest/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\n\nconst vitestPlugin = {\n vitest: vitestEslint\n};\n\nexport const vitest = defineConfig([\n {\n files: ['**/*.spec.ts', '**/*.spec.js', '**/*.test.ts', '**/*.test.js'],\n plugins: vitestPlugin,\n rules: {\n ...vitestEslint.configs.recommended.rules,\n 'vitest/max-nested-describe': ['error', { max: 3 }],\n // Matcher improvements\n 'vitest/prefer-to-be': 'error',\n 'vitest/prefer-to-contain': 'error',\n 'vitest/prefer-to-have-length': 'error',\n 'vitest/prefer-comparison-matcher': 'error',\n 'vitest/prefer-strict-equal': 'warn',\n // Test quality\n 'vitest/prefer-spy-on': 'error',\n 'vitest/prefer-hooks-on-top': 'error',\n 'vitest/prefer-each': 'warn',\n 'vitest/no-test-return-statement': 'error',\n 'vitest/prefer-mock-promise-shorthand': 'error'\n }\n }\n]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,4BAAwB;AACxB,oBAA6B;AAEtB,IAAM,sBAAkB,4BAAa;AAAA,EAC1C;AAAA,IACE,OAAO,CAAC,WAAW;AAAA,IACnB,SAAS,CAAC,GAAG,8BAAQ,uBAAuB,GAAG,8BAAQ,mBAAmB;AAAA,IAC1E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ACnB,QAAQ,sBAAAC;AACV;AAEO,IAAM,aAAS,8BAAa;AAAA,EACjC;AAAA,IACE,OAAO,CAAC,gBAAgB,gBAAgB,gBAAgB,cAAc;AAAA,IACtE,SAAS;AAAA,IACT,OAAO;AAAA,MACL,GAAG,sBAAAA,QAAa,QAAQ,YAAY;AAAA,MACpC,8BAA8B,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC;AAAA;AAAA,MAElD,uBAAuB;AAAA,MACvB,4BAA4B;AAAA,MAC5B,gCAAgC;AAAA,MAChC,oCAAoC;AAAA,MACpC,8BAA8B;AAAA;AAAA,MAE9B,wBAAwB;AAAA,MACxB,8BAA8B;AAAA,MAC9B,sBAAsB;AAAA,MACtB,mCAAmC;AAAA,MACnC,wCAAwC;AAAA,IAC1C;AAAA,EACF;AACF,CAAC;;;AnEbM,IAAM,cAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AACL;",
|
|
6
|
-
"names": ["import_angular_eslint", "import_config", "
|
|
3
|
+
"sources": ["../../../../packages/lint-suite/src/eslint.ts", "../../../../packages/lint-suite/src/lib/angular-template.ts", "../../../../packages/lint-suite/src/lib/rules/define-plugin.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/no-unstyled-classes.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/component-stylesheets.ts", "../../../../packages/lint-suite/src/lib/rules/component-metadata.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/stylesheet-classes.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/stylesheet-imports.ts", "../../../../packages/lint-suite/src/lib/rules/utils/selector-classes.util.ts", "../../../../packages/lint-suite/src/lib/rules/utils/resolved-rules.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/stylesheet-collection.ts", "../../../../packages/lint-suite/src/lib/rules/no-unstyled-classes/styles/template-stylesheets.ts", "../../../../packages/lint-suite/src/lib/rules/utils/template-classes.util.ts", "../../../../packages/lint-suite/src/lib/rules/utils/class-expression-literals.util.ts", "../../../../packages/lint-suite/src/lib/angular.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-imports.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-member-candidates.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-managed-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-metadata-literals.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-template-parsing.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-expression-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/utils/angular-read-target.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/angular/angular-class-fields.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-class-read-visitor.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-field-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-lexical-this.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/rule/typescript/typescript-write-targets.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-usage.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-directive-index.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-resolution.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-resolved-path.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/type-property-symbols.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-read-chains.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-template-references.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/read-chain-text.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-angular-interface-methods.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-symbol-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-destructuring-reads.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-assignment-pattern-elements.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-binding-pattern-elements.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-write-targets.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-type-dependencies.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-file-entry.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-component-discovery.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-component-scope.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-decorator-kind.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/angular/angular-metadata-values.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/utils/spec-file.util.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-staleness.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/typescript/typescript-candidate-names.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-classes.ts", "../../../../packages/lint-suite/src/lib/rules/no-unused-angular-instance-fields/project-usage/project-index-reconciliation.ts", "../../../../packages/lint-suite/src/lib/base.ts", "../../../../packages/lint-suite/src/lib/base-limits.ts", "../../../../packages/lint-suite/src/lib/base-practices.ts", "../../../../packages/lint-suite/src/lib/line-length.const.ts", "../../../../packages/lint-suite/src/lib/base-recommended.ts", "../../../../packages/lint-suite/src/lib/boundaries.ts", "../../../../packages/lint-suite/src/lib/javascript.ts", "../../../../packages/lint-suite/src/lib/json.ts", "../../../../packages/lint-suite/src/lib/playwright.ts", "../../../../packages/lint-suite/src/lib/prettier.ts", "../../../../packages/lint-suite/src/lib/rxjs.ts", "../../../../packages/lint-suite/src/lib/storybook.ts", "../../../../packages/lint-suite/src/lib/typescript.ts", "../../../../packages/lint-suite/src/lib/typescript-consistency.ts", "../../../../packages/lint-suite/src/lib/typescript-imports.ts", "../../../../packages/lint-suite/src/lib/typescript-overrides.ts", "../../../../packages/lint-suite/src/lib/typescript-recommended.ts", "../../../../packages/lint-suite/src/lib/typescript-safety.ts", "../../../../packages/lint-suite/src/lib/rules/explicit-accessibility/explicit-accessibility.ts", "../../../../packages/lint-suite/src/lib/rules/explicit-accessibility/common/explicit-accessibility.const.ts", "../../../../packages/lint-suite/src/lib/rules/no-inline-object-types/no-inline-object-types.ts", "../../../../packages/lint-suite/src/lib/rules/one-line-guard/one-line-guard.ts", "../../../../packages/lint-suite/src/lib/rules/readonly-type-properties/readonly-type-properties.ts", "../../../../packages/lint-suite/src/lib/typescript-local-plugin.ts", "../../../../packages/lint-suite/src/lib/vitest.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ConfigArray } from 'typescript-eslint';\n\nimport { angularTemplate } from './lib/angular-template.ts';\nimport { angular } from './lib/angular.ts';\nimport { base } from './lib/base.ts';\nimport { boundaries } from './lib/boundaries.ts';\nimport { javascript } from './lib/javascript.ts';\nimport { json } from './lib/json.ts';\nimport { playwright } from './lib/playwright.ts';\nimport { prettier } from './lib/prettier.ts';\nimport { rxjs } from './lib/rxjs.ts';\nimport { storybook } from './lib/storybook.ts';\nimport { typescript } from './lib/typescript.ts';\nimport { vitest } from './lib/vitest.ts';\n\nexport const recommended: ConfigArray = [\n ...base,\n ...javascript,\n ...typescript,\n ...json,\n ...boundaries,\n ...prettier // Must be last to disable formatting rules that conflict with Prettier\n];\n\nexport {\n base,\n javascript,\n typescript,\n angular,\n angularTemplate,\n rxjs,\n json,\n boundaries,\n storybook,\n vitest,\n playwright,\n prettier\n};\n", "import { configs } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\n\nimport { definePlugin } from './rules/define-plugin.util.ts';\nimport noUnstyledClassesRule from './rules/no-unstyled-classes/no-unstyled-classes.ts';\n\nexport const lintSuiteAngularTemplatePlugin = definePlugin(\n 'lint-suite-angular-template',\n { 'no-unstyled-classes': noUnstyledClassesRule }\n);\n\nexport const angularTemplate = defineConfig([\n {\n files: ['**/*.html'],\n extends: [...configs.templateAccessibility, ...configs.templateRecommended],\n plugins: {\n 'lint-suite-angular-template': lintSuiteAngularTemplatePlugin\n },\n rules: {\n 'lint-suite-angular-template/no-unstyled-classes': 'error',\n '@angular-eslint/template/prefer-template-literal': 'error',\n '@angular-eslint/template/no-any': 'error',\n '@angular-eslint/template/no-duplicate-attributes': 'error',\n '@angular-eslint/template/button-has-type': 'error',\n '@angular-eslint/template/no-positive-tabindex': 'error',\n '@angular-eslint/template/valid-aria': 'error',\n '@angular-eslint/template/alt-text': 'error',\n '@angular-eslint/template/elements-content': 'error',\n '@angular-eslint/template/click-events-have-key-events': 'error',\n '@angular-eslint/template/mouse-events-have-key-events': 'error',\n '@angular-eslint/template/table-scope': 'error',\n '@angular-eslint/template/no-autofocus': 'error',\n '@angular-eslint/template/no-distracting-elements': 'error',\n '@angular-eslint/template/prefer-control-flow': 'error',\n '@angular-eslint/template/prefer-self-closing-tags': 'error',\n '@angular-eslint/template/prefer-ngsrc': 'error',\n '@angular-eslint/template/prefer-built-in-pipes': 'error',\n '@angular-eslint/template/no-interpolation-in-attributes': 'error',\n '@angular-eslint/template/no-nested-tags': 'error',\n '@angular-eslint/template/use-track-by-function': 'error',\n '@angular-eslint/template/label-has-associated-control': 'error',\n '@angular-eslint/template/prefer-at-else': 'error', // v21: @if/@else syntax\n '@angular-eslint/template/prefer-at-empty': 'error', // v21: @for/@empty syntax\n '@angular-eslint/template/prefer-contextual-for-variables': 'error', // v21: Use $index, $first, etc.\n '@angular-eslint/template/no-empty-control-flow': 'error', // v21: Catch incomplete refactoring\n '@angular-eslint/template/prefer-class-binding': 'error', // v21.2.0: Prefer [class] over ngClass\n '@angular-eslint/template/prefer-static-string-properties': 'error', // Reduce change detection\n '@angular-eslint/template/no-non-null-assertion': 'error', // Forbid `!` assertions in templates\n '@angular-eslint/template/no-inline-styles': 'error', // Forbid inline style=\"...\" attributes\n '@angular-eslint/template/conditional-complexity': [\n 'warn',\n { maxComplexity: 5 }\n ], // Template readability\n '@angular-eslint/template/attributes-order': [\n 'error',\n {\n alphabetical: true,\n order: [\n 'STRUCTURAL_DIRECTIVE', // e.g. `*ngIf=\"true\"`, `*ngFor=\"let item of items\"`\n 'TEMPLATE_REFERENCE', // e.g. `<input #inputRef>`\n 'INPUT_BINDING', // e.g. `[id]=\"3\"`, `[attr.colspan]=\"colspan\"`, [style.width.%]=\"100\", [@triggerName]=\"expression\", `bind-id=\"handleChange()\"`\n 'TWO_WAY_BINDING', // e.g. `[(id)]=\"id\"`, `bindon-id=\"id\"\n 'ATTRIBUTE_BINDING', // e.g. `<input required>`, `id=\"3\"`\n 'OUTPUT_BINDING' // e.g. `(idChange)=\"handleChange()\"`, `on-id=\"handleChange()\"`\n ]\n }\n ]\n }\n }\n]);\n", "import type { TSESLint } from '@typescript-eslint/utils';\nimport type { CompatiblePlugin } from 'typescript-eslint';\n\ntype Rules = NonNullable<TSESLint.FlatConfig.Plugin['rules']>;\n\nexport const definePlugin = (name: string, rules: Rules): CompatiblePlugin => {\n const meta = { name };\n const plugin = { meta, rules };\n\n return plugin;\n};\n", "import type { TmplAstElement } from '@angular/compiler';\n\nimport { ESLintUtils } from '@typescript-eslint/utils';\nimport type { JSONSchema, TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n MessageIds,\n RuleOptions,\n TemplateParserServices\n} from './common/no-unstyled-classes.type.ts';\nimport { templateStylesheets } from './styles/template-stylesheets.ts';\nimport { templateClasses } from '../utils/template-classes.util.ts';\n\ntype Options = [RuleOptions];\n\nconst PARSER_REQUIRED =\n \"no-unstyled-classes requires '@angular-eslint/template-parser'.\";\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow template class names that no stylesheet of the component selects'\n};\n\nconst messages: Record<MessageIds, string> = {\n unstyledClass:\n \"Class '{{name}}' is not selected by any stylesheet of this template.\"\n};\n\nconst stringItems: JSONSchema.JSONSchema4 = { type: 'string' };\n\nconst ignoreClassPatternsSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: stringItems,\n description: 'Regular expressions for class names that are never reported.'\n};\n\nconst globalStylesSchema: JSONSchema.JSONSchema4 = {\n type: 'array',\n items: stringItems,\n description: 'Stylesheets merged into the known classes of every template.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n ignoreClassPatterns: ignoreClassPatternsSchema,\n globalStyles: globalStylesSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = {\n ignoreClassPatterns: ['^(js|qa|mat|cdk|mdc)-'],\n globalStyles: []\n};\n\nconst defaultOptions: Options = [ruleDefaults];\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-unstyled-classes'\n);\n\nconst isTemplateServices = (\n services: object\n): services is TemplateParserServices => {\n if (!('convertNodeSourceSpanToLoc' in services)) return false;\n\n return typeof services.convertNodeSourceSpanToLoc === 'function';\n};\n\nconst toRegExp = (pattern: string): RegExp => new RegExp(pattern, 'u');\n\nexport default createRule<Options, MessageIds>({\n name: 'no-unstyled-classes',\n meta,\n defaultOptions,\n create(context, [options]): TSESLint.RuleListener {\n const { parserServices } = context.sourceCode;\n\n if (parserServices === undefined) throw new Error(PARSER_REQUIRED);\n\n if (!isTemplateServices(parserServices)) throw new Error(PARSER_REQUIRED);\n\n const ignored = options.ignoreClassPatterns.map(toRegExp);\n const stylesheets = templateStylesheets(\n context.filename,\n context.cwd,\n options.globalStyles\n );\n const listeners: TSESLint.RuleListener = {\n Element(node: TmplAstElement): void {\n const isCustomElement = node.name.includes('-');\n\n if (isCustomElement) return;\n\n const classes = templateClasses(node);\n\n if (classes.length === 0) return;\n\n const known = stylesheets();\n\n if (known.size === 0) return;\n\n for (const { name, span } of classes) {\n const isIgnored = ignored.some((pattern) => pattern.test(name));\n\n if (isIgnored) continue;\n\n const isStyled = known.has(name);\n\n if (isStyled) continue;\n\n const loc = parserServices.convertNodeSourceSpanToLoc(span);\n const data = { name };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n loc,\n messageId: 'unstyledClass',\n data\n };\n\n context.report(report);\n }\n }\n };\n\n return listeners;\n }\n});\n", "import { existsSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\n\nimport type { ObjectLiteralExpression } from 'typescript';\n\nimport {\n componentMetadata,\n metadataTexts\n} from '../../component-metadata.ts';\nimport type { StylesheetSource } from '../common/no-unstyled-classes.type.ts';\n\nconst SIBLING_EXTENSIONS = ['.scss', '.css'];\nconst HTML_EXTENSION = /\\.html$/iu;\n\nconst matchesTemplate = (\n metadata: ObjectLiteralExpression,\n directory: string,\n templateFilename: string\n): boolean => {\n const urls = metadataTexts(metadata, 'templateUrl');\n const [templateUrl] = urls;\n\n if (templateUrl === undefined) return false;\n\n const declared = resolve(directory, templateUrl);\n const linted = resolve(templateFilename);\n\n return declared === linted;\n};\n\nconst templateMetadata = (\n componentPath: string,\n templateFilename: string\n): ObjectLiteralExpression | null => {\n const components = componentMetadata(componentPath);\n const directory = dirname(componentPath);\n const matches = (metadata: ObjectLiteralExpression): boolean => {\n return matchesTemplate(metadata, directory, templateFilename);\n };\n const matched = components.find(matches);\n\n if (matched !== undefined) return matched;\n\n const isOnly = components.length === 1;\n\n if (!isOnly) return null;\n\n const [only] = components;\n\n return only ?? null;\n};\n\nexport const stylesheetFiles = (\n paths: string[],\n directory: string\n): StylesheetSource[] => {\n const sources: StylesheetSource[] = [];\n\n for (const path of paths) {\n const resolved = resolve(directory, path);\n const isPresent = existsSync(resolved);\n\n if (!isPresent) continue;\n\n const source: StylesheetSource = { kind: 'file', path: resolved };\n\n sources.push(source);\n }\n\n return sources;\n};\n\nconst inlineSources = (\n styles: string[],\n componentPath: string\n): StylesheetSource[] => {\n const sourceOf = (style: string): StylesheetSource => {\n const source: StylesheetSource = {\n kind: 'inline',\n source: style,\n path: componentPath\n };\n\n return source;\n };\n\n return styles.map(sourceOf);\n};\n\nconst metadataSources = (\n componentPath: string,\n templateFilename: string\n): StylesheetSource[] => {\n const metadata = templateMetadata(componentPath, templateFilename);\n\n if (metadata === null) return [];\n\n const singleUrl = metadataTexts(metadata, 'styleUrl');\n const listedUrls = metadataTexts(metadata, 'styleUrls');\n const styles = metadataTexts(metadata, 'styles');\n const directory = dirname(componentPath);\n const urls = [...singleUrl, ...listedUrls];\n const files = stylesheetFiles(urls, directory);\n const inline = inlineSources(styles, componentPath);\n\n return [...files, ...inline];\n};\n\nconst siblingSources = (templateFilename: string): StylesheetSource[] => {\n const base = templateFilename.replace(HTML_EXTENSION, '');\n const candidateOf = (extension: string): string => `${base}${extension}`;\n const candidates = SIBLING_EXTENSIONS.map(candidateOf);\n\n return stylesheetFiles(candidates, dirname(templateFilename));\n};\n\nexport const componentStylesheets = (\n templateFilename: string\n): StylesheetSource[] => {\n const componentPath = templateFilename.replace(HTML_EXTENSION, '.ts');\n const sources = metadataSources(componentPath, templateFilename);\n\n if (sources.length > 0) return sources;\n\n return siblingSources(templateFilename);\n};\n", "import { readFileSync } from 'node:fs';\n\nimport {\n ScriptTarget,\n canHaveDecorators,\n createSourceFile,\n forEachChild,\n getDecorators,\n isArrayLiteralExpression,\n isCallExpression,\n isIdentifier,\n isObjectLiteralExpression,\n isPropertyAssignment,\n isStringLiteralLike\n} from 'typescript';\nimport type {\n Decorator,\n Expression,\n Node,\n ObjectLiteralExpression\n} from 'typescript';\n\nconst componentArgument = (\n decorator: Decorator\n): ObjectLiteralExpression | null => {\n const { expression } = decorator;\n\n if (!isCallExpression(expression)) return null;\n\n if (!isIdentifier(expression.expression)) return null;\n\n const isComponent = expression.expression.text === 'Component';\n\n if (!isComponent) return null;\n\n const [argument] = expression.arguments;\n\n if (argument === undefined) return null;\n\n if (!isObjectLiteralExpression(argument)) return null;\n\n return argument;\n};\n\nconst decoratedMetadata = (node: Node): ObjectLiteralExpression | null => {\n if (!canHaveDecorators(node)) return null;\n\n const decorators = getDecorators(node) ?? [];\n\n for (const decorator of decorators) {\n const metadata = componentArgument(decorator);\n\n if (metadata !== null) return metadata;\n }\n\n return null;\n};\n\nexport const parseComponentMetadata = (\n text: string,\n path: string\n): ObjectLiteralExpression[] => {\n const found: ObjectLiteralExpression[] = [];\n\n const visit = (node: Node): void => {\n const metadata = decoratedMetadata(node);\n\n if (metadata !== null) found.push(metadata);\n\n forEachChild(node, visit);\n };\n\n const source = createSourceFile(path, text, ScriptTarget.Latest, true);\n\n forEachChild(source, visit);\n\n return found;\n};\n\nexport const componentMetadata = (path: string): ObjectLiteralExpression[] => {\n try {\n const text = readFileSync(path, 'utf8');\n\n return parseComponentMetadata(text, path);\n } catch {\n return [];\n }\n};\n\nconst literalText = (node: Expression): string | null => {\n if (!isStringLiteralLike(node)) return null;\n\n return node.text;\n};\n\nconst literalTexts = (node: Expression): string[] => {\n const single = literalText(node);\n\n if (single !== null) return [single];\n\n if (!isArrayLiteralExpression(node)) return [];\n\n const texts: string[] = [];\n\n for (const element of node.elements) {\n const text = literalText(element);\n\n if (text !== null) texts.push(text);\n }\n\n return texts;\n};\n\nconst metadataValue = (\n metadata: ObjectLiteralExpression,\n name: string\n): Expression | null => {\n for (const property of metadata.properties) {\n if (!isPropertyAssignment(property)) continue;\n\n if (!isIdentifier(property.name)) continue;\n\n const isMatch = property.name.text === name;\n\n if (isMatch) return property.initializer;\n }\n\n return null;\n};\n\nexport const metadataTexts = (\n metadata: ObjectLiteralExpression,\n name: string\n): string[] => {\n const value = metadataValue(metadata, name);\n\n if (value === null) return [];\n\n return literalTexts(value);\n};\n", "import { readFileSync, statSync } from 'node:fs';\nimport { dirname } from 'node:path';\n\nimport { parse } from 'postcss-scss';\n\nimport { collectStylesheet } from './stylesheet-collection.ts';\nimport { classMatcher } from '../../utils/selector-classes.util.ts';\nimport type {\n StylesheetClasses,\n StylesheetEntry,\n StylesheetSource\n} from '../common/no-unstyled-classes.type.ts';\n\ntype CachedStylesheet = {\n readonly entry: StylesheetEntry;\n readonly version: string;\n};\n\ntype ClassSink = {\n readonly exact: Set<string>;\n readonly patterns: string[];\n};\n\nconst stylesheets = new Map<string, CachedStylesheet>();\n\nconst emptyEntry = (): StylesheetEntry => {\n const entry: StylesheetEntry = { classes: [], patterns: [], imports: [] };\n\n return entry;\n};\n\nconst parseStylesheet = (source: string, path: string): StylesheetEntry => {\n try {\n const root = parse(source, { from: path });\n\n return collectStylesheet(root, dirname(path));\n } catch {\n return emptyEntry();\n }\n};\n\nconst fileEntry = (path: string): StylesheetEntry => {\n try {\n const stats = statSync(path, { bigint: true });\n const version = `${stats.mtimeNs}:${stats.size}`;\n const cached = stylesheets.get(path);\n\n if (cached?.version === version) return cached.entry;\n\n const entry = parseStylesheet(readFileSync(path, 'utf8'), path);\n const fresh: CachedStylesheet = { entry, version };\n\n stylesheets.set(path, fresh);\n\n return entry;\n } catch {\n return emptyEntry();\n }\n};\n\nconst addEntry = (\n entry: StylesheetEntry,\n sink: ClassSink,\n visited: Set<string>\n): void => {\n for (const name of entry.classes) sink.exact.add(name);\n\n sink.patterns.push(...entry.patterns);\n\n for (const imported of entry.imports) {\n const isVisited = visited.has(imported);\n\n if (isVisited) continue;\n\n visited.add(imported);\n addEntry(fileEntry(imported), sink, visited);\n }\n};\n\nconst addSource = (\n source: StylesheetSource,\n sink: ClassSink,\n visited: Set<string>\n): void => {\n if (source.kind === 'file') {\n const isVisited = visited.has(source.path);\n\n if (isVisited) return;\n\n visited.add(source.path);\n addEntry(fileEntry(source.path), sink, visited);\n\n return;\n }\n\n addEntry(parseStylesheet(source.source, source.path), sink, visited);\n};\n\nconst toRegExp = (pattern: string): RegExp => {\n return new RegExp(pattern, 'u');\n};\n\nexport const stylesheetClasses = (\n sources: StylesheetSource[]\n): StylesheetClasses => {\n const exact = new Set<string>();\n const patterns: string[] = [];\n const sink: ClassSink = { exact, patterns };\n const visited = new Set<string>();\n\n for (const source of sources) addSource(source, sink, visited);\n\n const compiled = patterns.map(toRegExp);\n const has = classMatcher(exact, compiled);\n const size = exact.size + compiled.length;\n const classes: StylesheetClasses = { has, size };\n\n return classes;\n};\n", "import { existsSync } from 'node:fs';\nimport { basename, dirname, join, resolve } from 'node:path';\n\nconst QUOTED = /'([^']*)'|\"([^\"]*)\"/u;\nconst SKIPPED_PREFIXES = ['sass:', 'http', 'url('];\n\nconst specifierOf = (params: string): string | null => {\n const match = QUOTED.exec(params);\n\n if (!match) return null;\n\n return match[1] ?? match[2] ?? null;\n};\n\nconst isResolvable = (specifier: string): boolean => {\n const isEmpty = specifier.length === 0;\n\n if (isEmpty) return false;\n\n const isSkipped = SKIPPED_PREFIXES.some((prefix) =>\n specifier.startsWith(prefix)\n );\n\n if (isSkipped) return false;\n\n return !specifier.endsWith('.css');\n};\n\nconst candidatesOf = (path: string): string[] => {\n const isStylesheet = path.endsWith('.scss');\n\n if (isStylesheet) return [path, join(dirname(path), `_${basename(path)}`)];\n\n const partial = join(dirname(path), `_${basename(path)}.scss`);\n\n return [\n `${path}.scss`,\n partial,\n join(path, 'index.scss'),\n join(path, '_index.scss')\n ];\n};\n\nexport const resolveStylesheetImport = (\n params: string,\n directory: string\n): string | null => {\n const specifier = specifierOf(params);\n\n if (specifier === null) return null;\n\n const isCandidate = isResolvable(specifier);\n\n if (!isCandidate) return null;\n\n const path = resolve(directory, specifier);\n const candidates = candidatesOf(path);\n const existing = candidates.find((candidate) => existsSync(candidate));\n\n return existing ?? null;\n};\n", "import selectorParser from 'postcss-selector-parser';\nimport type { Node } from 'postcss-selector-parser';\n\nimport type { ClassMatcher, SelectorClasses } from '../common/class-usage.type.ts';\n\ntype SelectorClassNode = { readonly value: string };\n\nconst INTERPOLATION_TOKEN = 'zzinterpzz';\nconst PARENT_TOKEN = 'zzparentzz';\nconst UNKNOWN_PARENT_SELECTOR = `.${PARENT_TOKEN}`;\nconst UNKNOWN_PARTS = new RegExp(\n `${INTERPOLATION_TOKEN}|${PARENT_TOKEN}`,\n 'gu'\n);\nconst INTERPOLATION = /#\\{[^}]*\\}/gu;\nconst DEEP_COMBINATORS = new Set(['/deep/', '>>>']);\nconst HOST_PSEUDOS = new Set([':host', ':host-context']);\nconst NG_DEEP_PSEUDO = '::ng-deep';\nconst REGEXP_META = /[.*+?^${}()|[\\]\\\\]/gu;\n\nconst escapeRegExp = (part: string): string => {\n return part.replaceAll(REGEXP_META, '\\\\$&');\n};\n\nexport const classNamePattern = (value: string): string => {\n const literals = value.split(UNKNOWN_PARTS).map(escapeRegExp);\n const joined = literals.join('.*');\n\n return `^${joined}$`;\n};\n\nconst withoutParent = (selector: string): string => {\n return selector.replaceAll('&', UNKNOWN_PARENT_SELECTOR);\n};\n\nconst withParent = (selector: string, parent: string): string => {\n const hasNesting = selector.includes('&');\n\n if (hasNesting) return selector.replaceAll('&', parent);\n\n return `${parent} ${selector}`;\n};\n\nexport const resolveSelectors = (\n selectors: string[],\n parents: string[]\n): string[] => {\n const hasParents = parents.length > 0;\n\n if (!hasParents) return selectors.map(withoutParent);\n\n const resolved: string[] = [];\n\n for (const parent of parents) {\n for (const selector of selectors) {\n resolved.push(withParent(selector, parent));\n }\n }\n\n return resolved;\n};\n\nexport const selectorClasses = (selector: string): SelectorClasses => {\n const exact: string[] = [];\n const patterns: string[] = [];\n const normalized = selector.replaceAll(INTERPOLATION, INTERPOLATION_TOKEN);\n\n const collect = (node: SelectorClassNode): void => {\n const isBareParent = node.value === PARENT_TOKEN;\n\n if (isBareParent) return;\n\n const hasInterpolation = node.value.includes(INTERPOLATION_TOKEN);\n const hasUnknownParent = node.value.includes(PARENT_TOKEN);\n const isDynamic = hasInterpolation || hasUnknownParent;\n\n if (isDynamic) {\n patterns.push(classNamePattern(node.value));\n\n return;\n }\n\n exact.push(node.value);\n };\n\n try {\n const root = selectorParser().astSync(normalized);\n\n root.walkClasses(collect);\n } catch {\n const empty: SelectorClasses = { exact: [], patterns: [] };\n\n return empty;\n }\n\n const classes: SelectorClasses = { exact, patterns };\n\n return classes;\n};\n\nconst isBoundaryNode = (node: Node): boolean => {\n if (node.type === 'combinator') return DEEP_COMBINATORS.has(node.value);\n\n if (node.type !== 'pseudo') return false;\n\n return node.value === NG_DEEP_PSEUDO;\n};\n\nconst addTemplateClass = (value: string, names: string[]): void => {\n const hasInterpolation = value.includes(INTERPOLATION_TOKEN);\n const hasUnknownParent = value.includes(PARENT_TOKEN);\n const isDynamic = hasInterpolation || hasUnknownParent;\n\n if (isDynamic) return;\n\n names.push(value);\n};\n\nconst collectTemplateClasses = (nodes: Node[], names: string[]): boolean => {\n for (const node of nodes) {\n const isBoundary = isBoundaryNode(node);\n\n if (isBoundary) return true;\n\n if (node.type === 'class') {\n addTemplateClass(node.value, names);\n continue;\n }\n\n if (node.type !== 'pseudo') continue;\n\n const isHost = HOST_PSEUDOS.has(node.value);\n\n if (isHost) continue;\n\n for (const argument of node.nodes) {\n const isStopped = collectTemplateClasses(argument.nodes, names);\n\n if (isStopped) return true;\n }\n }\n\n return false;\n};\n\nexport const selectorTemplateClasses = (selector: string): string[] => {\n const names: string[] = [];\n const normalized = selector.replaceAll(INTERPOLATION, INTERPOLATION_TOKEN);\n\n try {\n const root = selectorParser().astSync(normalized);\n\n for (const each of root.nodes) collectTemplateClasses(each.nodes, names);\n } catch {\n return [];\n }\n\n return [...new Set(names)];\n};\n\nexport const classMatcher = (\n exact: Set<string>,\n patterns: RegExp[]\n): ClassMatcher => {\n const matches = (name: string): boolean => {\n const isExact = exact.has(name);\n\n if (isExact) return true;\n\n return patterns.some((pattern) => pattern.test(name));\n };\n\n return matches;\n};\n", "import type { ChildNode, Container, Root, Rule } from 'postcss';\n\nimport { resolveSelectors } from './selector-classes.util.ts';\n\ntype ResolvedRuleVisitor = (\n rule: Rule,\n resolved: string[],\n parents: string[]\n) => void;\n\nconst walkContainer = (\n container: Container<ChildNode>,\n parents: string[],\n visit: ResolvedRuleVisitor\n): void => {\n for (const node of container.nodes ?? []) {\n if (node.type === 'rule') {\n const resolved = resolveSelectors(node.selectors, parents);\n\n visit(node, resolved, parents);\n walkContainer(node, resolved, visit);\n continue;\n }\n\n if (node.type !== 'atrule') continue;\n\n walkContainer(node, parents, visit);\n }\n};\n\nexport const walkResolvedRules = (\n root: Root,\n visit: ResolvedRuleVisitor\n): void => {\n walkContainer(root, [], visit);\n};\n", "import type { AtRule, Root, Rule } from 'postcss';\n\nimport { resolveStylesheetImport } from './stylesheet-imports.ts';\nimport { walkResolvedRules } from '../../utils/resolved-rules.util.ts';\nimport { selectorClasses } from '../../utils/selector-classes.util.ts';\nimport type { StylesheetEntry } from '../common/no-unstyled-classes.type.ts';\n\nconst IMPORT_AT_RULES = new Set(['use', 'import', 'forward']);\n\nconst addSelectors = (selectors: string[], entry: StylesheetEntry): void => {\n for (const selector of selectors) {\n const { exact, patterns } = selectorClasses(selector);\n\n entry.classes.push(...exact);\n entry.patterns.push(...patterns);\n }\n};\n\nconst addImport = (\n node: AtRule,\n entry: StylesheetEntry,\n directory: string\n): void => {\n const isImport = IMPORT_AT_RULES.has(node.name);\n\n if (!isImport) return;\n\n const imported = resolveStylesheetImport(node.params, directory);\n\n if (imported !== null) entry.imports.push(imported);\n};\n\nexport const collectStylesheet = (\n root: Root,\n directory: string\n): StylesheetEntry => {\n const entry: StylesheetEntry = { classes: [], patterns: [], imports: [] };\n const onRule = (_rule: Rule, resolved: string[]): void => {\n addSelectors(resolved, entry);\n };\n const onAtRule = (node: AtRule): void => {\n addImport(node, entry, directory);\n };\n\n walkResolvedRules(root, onRule);\n root.walkAtRules(onAtRule);\n\n return entry;\n};\n", "import {\n componentStylesheets,\n stylesheetFiles\n} from './component-stylesheets.ts';\nimport { stylesheetClasses } from './stylesheet-classes.ts';\nimport type {\n StylesheetClasses,\n StylesheetLookup,\n StylesheetSource\n} from '../common/no-unstyled-classes.type.ts';\n\nexport const templateStylesheets = (\n templateFilename: string,\n cwd: string,\n globalStyles: string[]\n): StylesheetLookup => {\n let known: StylesheetClasses | null = null;\n\n const lookup = (): StylesheetClasses => {\n if (known !== null) return known;\n\n const component = componentStylesheets(templateFilename);\n const global = stylesheetFiles(globalStyles, cwd);\n const sources: StylesheetSource[] = [...component, ...global];\n\n known = stylesheetClasses(sources);\n\n return known;\n };\n\n return lookup;\n};\n", "import { ParseSourceSpan } from '@angular/compiler';\nimport type {\n TmplAstBoundAttribute,\n TmplAstTextAttribute\n} from '@angular/compiler';\n\nimport { classExpressionLiterals } from './class-expression-literals.util.ts';\nimport type { ClassAttributeHost, TemplateClass } from '../common/class-usage.type.ts';\n\nconst CLASS_ATTRIBUTE = 'class';\nconst CLASS_BINDING_PREFIX = 'class.';\nconst TOKEN = /\\S+/gu;\n\nconst expressionSource = (value: object): string | null => {\n if (!('source' in value)) return null;\n\n const { source } = value;\n\n if (typeof source !== 'string') return null;\n\n return source;\n};\n\nconst staticClasses = (attribute: TmplAstTextAttribute): TemplateClass[] => {\n const classes: TemplateClass[] = [];\n const valueSpan = attribute.valueSpan ?? attribute.sourceSpan;\n\n for (const token of attribute.value.matchAll(TOKEN)) {\n const start = valueSpan.start.moveBy(token.index);\n const end = valueSpan.start.moveBy(token.index + token[0].length);\n const span = new ParseSourceSpan(start, end);\n const templateClass: TemplateClass = { name: token[0], span };\n\n classes.push(templateClass);\n }\n\n return classes;\n};\n\nconst boundClassName = (input: TmplAstBoundAttribute): string | null => {\n const { details } = input.keySpan;\n\n if (details === null) return null;\n\n const isClassBinding = details.startsWith(CLASS_BINDING_PREFIX);\n\n if (!isClassBinding) return null;\n\n return input.name;\n};\n\nconst isClassExpression = (input: TmplAstBoundAttribute): boolean => {\n const isClassName = input.name === CLASS_ATTRIBUTE;\n\n if (!isClassName) return false;\n\n const { details } = input.keySpan;\n\n if (details === null) return true;\n\n return details === CLASS_ATTRIBUTE;\n};\n\nconst expressionClasses = (input: TmplAstBoundAttribute): TemplateClass[] => {\n const source = expressionSource(input.value);\n\n if (source === null) return [];\n\n const names = classExpressionLiterals(source);\n const templateClassOf = (name: string): TemplateClass => {\n const templateClass: TemplateClass = { name, span: input.sourceSpan };\n\n return templateClass;\n };\n\n return names.map(templateClassOf);\n};\n\nconst inputClasses = (input: TmplAstBoundAttribute): TemplateClass[] => {\n const bound = boundClassName(input);\n\n if (bound !== null) {\n const templateClass: TemplateClass = { name: bound, span: input.keySpan };\n\n return [templateClass];\n }\n\n const isExpression = isClassExpression(input);\n\n if (!isExpression) return [];\n\n return expressionClasses(input);\n};\n\nexport const templateClasses = (node: ClassAttributeHost): TemplateClass[] => {\n const classes: TemplateClass[] = [];\n\n for (const attribute of node.attributes) {\n const isClassName = attribute.name === CLASS_ATTRIBUTE;\n\n if (isClassName) classes.push(...staticClasses(attribute));\n }\n\n for (const input of node.inputs) {\n classes.push(...inputClasses(input));\n }\n\n return classes;\n};\n", "import {\n Conditional,\n Interpolation,\n Lexer,\n LiteralArray,\n LiteralMap,\n LiteralPrimitive,\n ParseLocation,\n ParseSourceFile,\n ParseSourceSpan,\n Parser\n} from '@angular/compiler';\nimport type { AST, ASTWithSource, LiteralMapKey } from '@angular/compiler';\n\nimport { classNamePattern } from './selector-classes.util.ts';\nimport type { ClassExpressionUsage } from '../common/class-usage.type.ts';\n\nconst WHITESPACE = /\\s+/u;\nconst EXPRESSION_FILE = 'class-expression';\nconst INTERPOLATION_TOKEN = 'zzinterpzz';\n\nconst parser = new Parser(new Lexer());\n\nconst spanOf = (source: string): ParseSourceSpan => {\n const file = new ParseSourceFile(source, EXPRESSION_FILE);\n const start = new ParseLocation(file, 0, 0, 0);\n const span = new ParseSourceSpan(start, start.moveBy(source.length));\n\n return span;\n};\n\nconst astOf = (parsed: ASTWithSource): AST | null => {\n const hasErrors = parsed.errors.length > 0;\n\n if (hasErrors) return null;\n\n return parsed.ast;\n};\n\nconst parseClassExpression = (source: string): AST | null => {\n try {\n const span = spanOf(source);\n const interpolation = parser.parseInterpolation(source, span, 0, null);\n\n if (interpolation) return astOf(interpolation);\n\n const binding = parser.parseBinding(source, span, 0);\n\n return astOf(binding);\n } catch {\n return null;\n }\n};\n\nconst addNames = (value: string, names: string[]): void => {\n for (const token of value.split(WHITESPACE)) {\n if (token) names.push(token);\n }\n};\n\nconst addPrimitive = (ast: LiteralPrimitive, names: string[]): void => {\n if (typeof ast.value === 'string') addNames(ast.value, names);\n};\n\nconst addMapKeys = (ast: LiteralMap, names: string[]): void => {\n for (const key of ast.keys) {\n if (key.kind !== 'spread') addNames(key.key, names);\n }\n};\n\nconst addInterpolation = (ast: Interpolation, names: string[]): void => {\n for (const text of ast.strings) addNames(text, names);\n};\n\nconst collect = (ast: AST, names: string[]): void => {\n if (ast instanceof LiteralPrimitive) {\n addPrimitive(ast, names);\n\n return;\n }\n\n if (ast instanceof LiteralMap) {\n addMapKeys(ast, names);\n\n return;\n }\n\n if (ast instanceof Interpolation) {\n addInterpolation(ast, names);\n\n return;\n }\n\n if (ast instanceof LiteralArray) {\n for (const expression of ast.expressions) collect(expression, names);\n\n return;\n }\n\n if (ast instanceof Conditional) {\n collect(ast.trueExp, names);\n collect(ast.falseExp, names);\n }\n};\n\nexport const classExpressionLiterals = (source: string): string[] => {\n const ast = parseClassExpression(source);\n\n if (ast === null) return [];\n\n const names: string[] = [];\n\n collect(ast, names);\n\n return [...new Set(names)];\n};\n\nconst isSpreadKey = (key: LiteralMapKey): boolean => key.kind === 'spread';\n\nconst isDynamicAst = (ast: AST): boolean => {\n if (ast instanceof LiteralPrimitive) return false;\n\n if (ast instanceof LiteralMap) return ast.keys.some(isSpreadKey);\n\n if (ast instanceof LiteralArray) return ast.expressions.some(isDynamicAst);\n\n if (ast instanceof Conditional) {\n const isTrueDynamic = isDynamicAst(ast.trueExp);\n const isFalseDynamic = isDynamicAst(ast.falseExp);\n\n return isTrueDynamic || isFalseDynamic;\n }\n\n return true;\n};\n\nconst isNamedToken = (token: string): boolean => token !== INTERPOLATION_TOKEN;\n\nconst isPatternToken = (token: string): boolean => {\n return token.includes(INTERPOLATION_TOKEN);\n};\n\nconst isPlainToken = (token: string): boolean => !isPatternToken(token);\n\nconst interpolationUsage = (ast: Interpolation): ClassExpressionUsage => {\n const joined = ast.strings.join(INTERPOLATION_TOKEN);\n const tokens = joined.split(WHITESPACE).filter(Boolean);\n const named = tokens.filter(isNamedToken);\n const patterns = named.filter(isPatternToken).map(classNamePattern);\n const names = named.filter(isPlainToken);\n const usage: ClassExpressionUsage = {\n names: [...new Set(names)],\n patterns: [...new Set(patterns)],\n isDynamic: named.length < tokens.length\n };\n\n return usage;\n};\n\nconst UNKNOWN_USAGE: ClassExpressionUsage = {\n names: [],\n patterns: [],\n isDynamic: true\n};\n\nexport const classExpressionUsage = (source: string): ClassExpressionUsage => {\n const ast = parseClassExpression(source);\n\n if (ast === null) return UNKNOWN_USAGE;\n\n if (ast instanceof Interpolation) return interpolationUsage(ast);\n\n const names: string[] = [];\n\n collect(ast, names);\n\n const isDynamic = isDynamicAst(ast);\n const usage: ClassExpressionUsage = {\n names: [...new Set(names)],\n patterns: [],\n isDynamic\n };\n\n return usage;\n};\n", "import { configs, processInlineTemplates } from 'angular-eslint';\nimport { defineConfig } from 'eslint/config';\nimport globals from 'globals';\n\nimport { definePlugin } from './rules/define-plugin.util.ts';\nimport noUnusedInstanceFieldsRule from './rules/no-unused-angular-instance-fields/rule/no-unused-angular-instance-fields.ts';\n\nexport const lintSuiteAngularPlugin = definePlugin('lint-suite-angular', {\n 'no-unused-instance-fields': noUnusedInstanceFieldsRule\n});\n\nconst inlineTemplates = processInlineTemplates && {\n processor: processInlineTemplates\n};\n\nexport const angular = defineConfig([\n {\n files: ['**/*.ts'],\n extends: [...configs.tsRecommended],\n plugins: {\n 'lint-suite-angular': lintSuiteAngularPlugin\n },\n languageOptions: {\n globals: {\n ...globals.browser,\n ...globals.es2025,\n ...globals.node\n },\n parserOptions: {\n projectService: true\n }\n },\n ...inlineTemplates,\n rules: {\n 'lint-suite-angular/no-unused-instance-fields': [\n 'error',\n { analysis: 'project' }\n ],\n '@angular-eslint/prefer-on-push-component-change-detection': 'error', // v22: flags only explicit opt-out of OnPush (omission now means OnPush)\n '@angular-eslint/prefer-signals': 'error',\n '@angular-eslint/use-injectable-provided-in': 'error',\n '@angular-eslint/prefer-signal-model': 'error',\n '@angular-eslint/no-uncalled-signals': 'error',\n '@angular-eslint/prefer-host-metadata-property': 'error',\n '@angular-eslint/no-implicit-take-until-destroyed': 'error', // v21.2.0: Enforce explicit DestroyRef\n '@angular-eslint/no-async-lifecycle-method': 'error', // Prevent async lifecycle hooks\n '@angular-eslint/prefer-output-readonly': 'warn', // Prevent accidental reassignment\n '@angular-eslint/prefer-output-emitter-ref': 'warn', // Modern output() function over @Output()\n '@angular-eslint/sort-lifecycle-methods': 'warn', // Consistent lifecycle method ordering\n '@angular-eslint/computed-must-return': 'error', // Catch silent computed() bugs missing a return\n '@angular-eslint/no-duplicates-in-metadata-arrays': 'error', // Catch duplicate imports/providers in @Component/@NgModule\n '@angular-eslint/no-lifecycle-call': 'error', // Forbid manual this.ngOnInit() calls\n '@angular-eslint/require-lifecycle-on-prototype': 'error', // Lifecycle hooks must be methods, not arrow-fn fields\n '@angular-eslint/relative-url-prefix': 'error', // Require ./ in templateUrl/styleUrl for portability\n '@angular-eslint/use-component-selector': 'error', // All components must declare a selector\n '@angular-eslint/no-developer-preview': 'warn', // Flag APIs marked @developerPreview (no breaking-change policy)\n '@angular-eslint/no-experimental': 'warn' // Flag APIs marked @experimental\n }\n }\n]);\n", "import { ESLintUtils } from '@typescript-eslint/utils';\nimport type {\n JSONSchema,\n ParserServicesWithTypeInformation,\n TSESLint,\n TSESTree\n} from '@typescript-eslint/utils';\n\nimport { reportUnusedMembers } from './angular/angular-class-fields.ts';\nimport { angularClassImports } from './angular/angular-imports.ts';\nimport type {\n ClassEntry,\n DynamicClasses,\n MessageIds,\n ProjectMemberUsed,\n ReportUnusedMembersOptions,\n RuleContext,\n RuleOptions\n} from './common/no-unused-angular-instance-fields.type.ts';\nimport { classReadVisitor } from './typescript/typescript-class-read-visitor.ts';\nimport type { ProjectUsageIndex } from '../project-usage/common/project-index.type.ts';\nimport {\n projectUsage,\n projectUsageIsCurrent\n} from '../project-usage/project-usage.ts';\nimport { isSpecFile } from '../project-usage/utils/spec-file.util.ts';\n\ntype Options = [RuleOptions];\ntype Analysis = NonNullable<RuleOptions['analysis']>;\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Disallow unread instance fields and methods in Angular components and directives'\n};\n\nconst messages: Record<MessageIds, string> = {\n unusedField: \"Angular instance field '{{name}}' is never read.\",\n unusedMethod: \"Angular instance method '{{name}}' is never read.\"\n};\n\nconst allowEffectFieldsSchema: JSONSchema.JSONSchema4 = {\n type: 'boolean',\n description: 'Allow Angular effect() fields with automatic cleanup.'\n};\n\nconst analysisSchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['local', 'project'],\n description: 'Choose local-file or typed whole-project analysis.'\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n allowEffectFields: allowEffectFieldsSchema,\n analysis: analysisSchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'problem',\n docs,\n schema,\n messages\n};\n\nconst ruleDefaults: RuleOptions = {\n allowEffectFields: false,\n analysis: 'local'\n};\n\nconst defaultOptions: Options = [ruleDefaults];\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://eslint.org/docs/latest/rules/no-unused-private-class-members'\n);\n\nconst projectParserServices = (\n context: RuleContext,\n analysis: Analysis\n): ParserServicesWithTypeInformation | undefined => {\n if (analysis !== 'project') return undefined;\n\n try {\n return ESLintUtils.getParserServices(context);\n } catch {\n throw new Error(\n 'Project analysis requires parser services with type information.'\n );\n }\n};\n\nconst projectMemberUsedFor = (\n parserServices: ParserServicesWithTypeInformation | undefined\n): ProjectMemberUsed | undefined => {\n if (parserServices === undefined) return undefined;\n\n let usage: ProjectUsageIndex | null | undefined;\n\n const memberUsed = (node: TSESTree.ClassElement): boolean => {\n if (usage === undefined) {\n usage = projectUsage(parserServices.program);\n }\n\n return usage?.has(parserServices.esTreeNodeToTSNodeMap.get(node)) ?? true;\n };\n\n return memberUsed;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-unused-instance-fields',\n meta,\n defaultOptions,\n create(context, [options]): TSESLint.RuleListener {\n const analysis = options.analysis ?? 'local';\n const isSpec = isSpecFile(context.filename);\n const noListeners: TSESLint.RuleListener = {};\n\n if (analysis === 'project' && isSpec) return noListeners;\n\n const parserServices = projectParserServices(context, analysis);\n const imports = angularClassImports(context.sourceCode.ast);\n\n if (!imports) return noListeners;\n\n const classes: ClassEntry[] = [];\n const stack: ClassEntry[] = [];\n const dynamicClasses: DynamicClasses = new Set();\n\n const projectIndexed = (): boolean => {\n if (parserServices === undefined) return false;\n\n return projectUsageIsCurrent(parserServices.program);\n };\n\n const reportOptions: ReportUnusedMembersOptions = {\n allowEffectFields: options.allowEffectFields ?? false,\n classes,\n context,\n dynamicClasses,\n imports,\n projectIndexed,\n projectMemberUsed: projectMemberUsedFor(parserServices)\n };\n\n const readListeners = classReadVisitor(classes, stack, dynamicClasses);\n const listeners: TSESLint.RuleListener = {\n ...readListeners,\n 'Program:exit'(): void {\n reportUnusedMembers(reportOptions);\n }\n };\n\n return listeners;\n }\n});\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n AngularImport,\n AngularImports\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst calleeRoot = (\n node: TSESTree.Expression\n): TSESTree.Identifier | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) return node;\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.object.type === TSESTree.AST_NODE_TYPES.Super\n ) {\n return undefined;\n }\n\n return calleeRoot(node.object);\n};\n\nexport const angularName = (\n node: TSESTree.Expression,\n imports: AngularImports\n): AngularImport | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imports.get(node.name);\n }\n\n if (\n node.type !== TSESTree.AST_NODE_TYPES.MemberExpression ||\n node.computed ||\n node.property.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return null;\n }\n\n if (node.object.type === TSESTree.AST_NODE_TYPES.Identifier) {\n const namespaceAlias = imports.get(node.object.name);\n\n if (namespaceAlias === null) return node.property.name;\n }\n\n return angularName(node.object, imports);\n};\n\nexport const isImportBinding = (\n node: TSESTree.Expression,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const root = calleeRoot(node);\n\n if (!root) return false;\n\n for (\n let scope: TSESLint.Scope.Scope | null = sourceCode.getScope(root);\n scope;\n scope = scope.upper\n ) {\n const variable = scope.set.get(root.name);\n\n if (variable) return variable.defs[0]?.type === 'ImportBinding';\n }\n\n return false;\n};\n\nexport const addAngularImport = (\n node: TSESTree.ImportDeclaration,\n imports: AngularImports\n): void => {\n if (node.source.value !== '@angular/core' || node.importKind === 'type') {\n return;\n }\n\n for (const specifier of node.specifiers) {\n if (specifier.type === TSESTree.AST_NODE_TYPES.ImportNamespaceSpecifier) {\n imports.set(specifier.local.name, null);\n } else if (\n specifier.type === TSESTree.AST_NODE_TYPES.ImportSpecifier &&\n specifier.importKind !== 'type'\n ) {\n const { imported } = specifier;\n const isIdentifier = imported.type === TSESTree.AST_NODE_TYPES.Identifier;\n const importedName = isIdentifier ? imported.name : imported.value;\n\n imports.set(specifier.local.name, importedName);\n }\n }\n};\n\nexport const angularClassMetadata = (\n node: AngularClassNode,\n imports: AngularImports\n): AngularClassMetadata | null => {\n for (const decorator of node.decorators) {\n if (decorator.expression.type !== TSESTree.AST_NODE_TYPES.CallExpression) {\n continue;\n }\n\n const kind = angularName(decorator.expression.callee, imports);\n const metadata = decorator.expression.arguments.at(0);\n\n const isComponentOrDirective = kind === 'Component' || kind === 'Directive';\n\n if (\n isComponentOrDirective &&\n metadata?.type === TSESTree.AST_NODE_TYPES.ObjectExpression\n ) {\n const classMetadata: AngularClassMetadata | null = {\n component: kind === 'Component',\n metadata\n };\n\n return classMetadata;\n }\n }\n\n return null;\n};\n\nexport const angularClassImports = (\n ast: TSESTree.Program\n): AngularImports | null => {\n const imports: AngularImports = new Map();\n\n for (const node of ast.body) {\n if (node.type === TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n addAngularImport(node, imports);\n }\n }\n\n for (const imported of imports.values()) {\n const isNamespaceImport = imported === null;\n const isComponent = imported === 'Component';\n const isDirective = imported === 'Directive';\n const isAngularClassImport =\n isNamespaceImport || isComponent || isDirective;\n\n if (isAngularClassImport) return imports;\n }\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n isAngularComponentRefField,\n isManagedField\n} from './angular-managed-fields.ts';\nimport type {\n AngularClassNode,\n FieldCandidateOptions,\n InstanceField,\n InstanceMethod,\n MemberCandidate\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst lifecycleHooks: ReadonlySet<string> = new Set([\n 'ngOnChanges',\n 'ngOnInit',\n 'ngDoCheck',\n 'ngAfterContentInit',\n 'ngAfterContentChecked',\n 'ngAfterViewInit',\n 'ngAfterViewChecked',\n 'ngOnDestroy'\n]);\n\nconst formsInterfaceMethods: Readonly<Record<string, string[]>> = {\n AsyncValidator: ['validate', 'registerOnValidatorChange'],\n ControlValueAccessor: [\n 'writeValue',\n 'registerOnChange',\n 'registerOnTouched',\n 'setDisabledState'\n ],\n Validator: ['validate', 'registerOnValidatorChange']\n};\n\nconst isInstanceField = (\n node: TSESTree.ClassElement\n): node is InstanceField => {\n if (node.type !== TSESTree.AST_NODE_TYPES.PropertyDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isInstanceMethod = (\n node: TSESTree.ClassElement\n): node is InstanceMethod => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.Identifier;\n};\n\nconst isExcludedField = (\n node: InstanceField,\n localPrivateOnly: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const isModified = node.static || node.declare || node.override;\n const isDecorated = node.decorators.length > 0;\n\n if (isModified || isDecorated) return true;\n\n const isComponentRef = isAngularComponentRefField(node, sourceCode);\n\n if (isComponentRef) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nconst isExcludedMethod = (\n node: InstanceMethod,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): boolean => {\n const isModified = node.static || node.override || node.computed;\n const isDecorated = node.decorators.length > 0;\n const isPlainMethod = node.kind === 'method';\n\n if (isModified || isDecorated || !isPlainMethod) return true;\n\n const hasNoBody = node.value.body === null;\n const isLifecycleHook = lifecycleHooks.has(node.key.name);\n\n if (hasNoBody || isLifecycleHook) return true;\n\n const isImplemented = implementedMethods.has(node.key.name);\n\n if (isImplemented) return true;\n\n const isNonPrivate = node.accessibility !== 'private';\n\n return localPrivateOnly && isNonPrivate;\n};\n\nexport const implementedFormsMethods = (\n node: AngularClassNode\n): Set<string> => {\n const methods = new Set<string>();\n\n for (const heritage of node.implements) {\n if (heritage.expression.type !== TSESTree.AST_NODE_TYPES.Identifier) {\n continue;\n }\n\n for (const name of formsInterfaceMethods[heritage.expression.name] ?? []) {\n methods.add(name);\n }\n }\n\n return methods;\n};\n\nexport const fieldCandidate = (\n node: TSESTree.ClassElement,\n options: FieldCandidateOptions\n): MemberCandidate | null => {\n const isField = isInstanceField(node);\n\n if (!isField) return null;\n\n const { localPrivateOnly, sourceCode } = options;\n const isExcluded = isExcludedField(node, localPrivateOnly, sourceCode);\n\n if (isExcluded) return null;\n\n const isManaged = isManagedField(\n node,\n options.imports,\n options.allowEffectFields,\n sourceCode\n );\n\n if (isManaged) return null;\n\n const unusedFieldCandidate: MemberCandidate | null = {\n messageId: 'unusedField',\n name: node.key.name,\n node\n };\n\n return unusedFieldCandidate;\n};\n\nexport const methodCandidate = (\n node: TSESTree.ClassElement,\n localPrivateOnly: boolean,\n implementedMethods: Set<string>\n): MemberCandidate | null => {\n const isMethod = isInstanceMethod(node);\n\n if (!isMethod) return null;\n\n const isExcluded = isExcludedMethod(\n node,\n localPrivateOnly,\n implementedMethods\n );\n\n if (isExcluded) return null;\n\n const unusedMethodCandidate: MemberCandidate | null = {\n messageId: 'unusedMethod',\n name: node.key.name,\n node\n };\n\n return unusedMethodCandidate;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularName, isImportBinding } from './angular-imports.ts';\nimport type {\n AngularImports,\n InstanceField\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst managedApis: ReadonlySet<string> = new Set([\n 'input',\n 'model',\n 'output',\n 'viewChild',\n 'viewChildren',\n 'contentChild',\n 'contentChildren'\n]);\n\nconst hasAutomaticEffectCleanup = (node: TSESTree.CallExpression): boolean => {\n const options = node.arguments.at(1);\n\n if (options === undefined) return true;\n\n if (options.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n return options.properties.every((property) => {\n if (\n property.type !== TSESTree.AST_NODE_TYPES.Property ||\n property.computed\n ) {\n return false;\n }\n\n const manualCleanup =\n (property.key.type === TSESTree.AST_NODE_TYPES.Identifier &&\n property.key.name === 'manualCleanup') ||\n (property.key.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.key.value === 'manualCleanup');\n\n return (\n !manualCleanup ||\n (property.value.type === TSESTree.AST_NODE_TYPES.Literal &&\n property.value.value === false)\n );\n });\n};\n\nconst angularCoreImportedName = (\n definition: TSESLint.Scope.Definition | undefined\n): string | null => {\n if (definition?.type !== 'ImportBinding') return null;\n\n if (definition.node.type !== TSESTree.AST_NODE_TYPES.ImportSpecifier) {\n return null;\n }\n\n if (definition.parent.type !== TSESTree.AST_NODE_TYPES.ImportDeclaration) {\n return null;\n }\n\n if (definition.parent.source.value !== '@angular/core') return null;\n\n const { imported } = definition.node;\n\n if (imported.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return imported.name;\n }\n\n return imported.value;\n};\n\nexport const isAngularComponentRefField = (\n node: InstanceField,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n const type = node.typeAnnotation?.typeAnnotation;\n\n if (\n type?.type !== TSESTree.AST_NODE_TYPES.TSTypeReference ||\n type.typeName.type !== TSESTree.AST_NODE_TYPES.Identifier\n ) {\n return false;\n }\n\n const reference = sourceCode\n .getScope(type.typeName)\n .references.find(({ identifier }) => identifier === type.typeName);\n const definition = reference?.resolved?.defs[0];\n\n return angularCoreImportedName(definition) === 'ComponentRef';\n};\n\nexport const isManagedField = (\n node: InstanceField,\n imports: AngularImports,\n allowEffectFields: boolean,\n sourceCode: TSESLint.SourceCode\n): boolean => {\n if (node.value?.type !== TSESTree.AST_NODE_TYPES.CallExpression) return false;\n\n const name = angularName(node.value.callee, imports);\n const isString = typeof name === 'string';\n\n if (!isString) return false;\n\n const isManagedApi = managedApis.has(name);\n\n if (isManagedApi) return true;\n\n if (!allowEffectFields) return false;\n\n if (name !== 'effect') return false;\n\n const isImported = isImportBinding(node.value.callee, sourceCode);\n\n if (!isImported) return false;\n\n return hasAutomaticEffectCleanup(node.value);\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport { TSESTree } from '@typescript-eslint/utils';\n\nimport { key, metadataValue, text } from './angular-metadata-literals.ts';\nimport {\n expressionReads,\n externalTemplateReads,\n templateReads\n} from './angular-template-parsing.ts';\nimport type { MetadataReadsOptions } from '../common/no-unused-angular-instance-fields.type.ts';\n\nconst addReads = (target: Set<string>, source: Set<string> | null): boolean => {\n if (!source) return false;\n\n for (const name of source) {\n target.add(name);\n }\n\n return true;\n};\n\nconst hostPropertyReads = (\n property: TSESTree.Property,\n reads: Set<string>,\n filename: string\n): boolean => {\n const name = key(property);\n const expression = text(property.value);\n\n if (name === null || expression === null) return false;\n\n const isPropertyBinding = name.startsWith('[');\n\n if (isPropertyBinding) {\n return addReads(reads, expressionReads(expression, filename, false));\n }\n\n const isEventBinding = name.startsWith('(');\n\n if (isEventBinding) {\n return addReads(reads, expressionReads(expression, filename, true));\n }\n\n return true;\n};\n\nconst hostReads = (\n host: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!host) return true;\n\n if (host.type !== TSESTree.AST_NODE_TYPES.ObjectExpression) return false;\n\n const hasUnreadableKey = host.properties.some(\n (property) => key(property) === null\n );\n\n if (hasUnreadableKey) return false;\n\n for (const property of host.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) return false;\n\n const hasPropertyReads = hostPropertyReads(property, reads, filename);\n\n if (!hasPropertyReads) return false;\n }\n\n return true;\n};\n\nconst inlineTemplateReads = (\n template: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!template) return true;\n\n const source = text(template);\n\n return source !== null && addReads(reads, templateReads(source, filename));\n};\n\nconst externalTemplatePropertyReads = (\n templateUrl: TSESTree.Node | undefined,\n reads: Set<string>,\n filename: string\n): boolean => {\n if (!templateUrl) return true;\n\n const url = text(templateUrl);\n\n return (\n url !== null &&\n addReads(reads, externalTemplateReads(resolve(dirname(filename), url)))\n );\n};\n\nconst componentTemplateReads = (\n metadata: TSESTree.ObjectExpression,\n reads: Set<string>,\n filename: string\n): boolean => {\n const template = metadataValue(metadata, 'template');\n const templateUrl = metadataValue(metadata, 'templateUrl');\n\n return (\n inlineTemplateReads(template, reads, filename) &&\n externalTemplatePropertyReads(templateUrl, reads, filename)\n );\n};\n\n/**\n * Names read by a class's host bindings and, for components, its template.\n * Returns null when the metadata cannot be read statically; with\n * `requireTemplate` false an unreadable template keeps the host reads\n * instead, for callers that resolve template reads elsewhere.\n */\nexport const metadataReads = (\n options: MetadataReadsOptions\n): Set<string> | null => {\n const { filename, metadata } = options;\n const isUnreadableKey = (\n property: TSESTree.ObjectLiteralElement\n ): boolean => {\n return key(property) === null;\n };\n const hasUnreadableKey = metadata.properties.some(isUnreadableKey);\n\n if (hasUnreadableKey) return null;\n\n const reads = new Set<string>();\n const hostValue = metadataValue(metadata, 'host');\n const hasHostReads = hostReads(hostValue, reads, filename);\n\n if (!hasHostReads) return null;\n\n if (!options.component) return reads;\n\n const isRead = (name: string): boolean => reads.has(name);\n const hasRemainingReads = options.remainingNames.every(isRead);\n\n if (hasRemainingReads) return reads;\n\n const hasTemplateReads = componentTemplateReads(metadata, reads, filename);\n\n if (hasTemplateReads) return reads;\n\n if (!options.requireTemplate) return reads;\n\n return null;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nexport const text = (node: TSESTree.Node | null | undefined): string | null => {\n if (\n node?.type === TSESTree.AST_NODE_TYPES.Literal &&\n typeof node.value === 'string'\n ) {\n return node.value;\n }\n\n if (node?.type !== TSESTree.AST_NODE_TYPES.TemplateLiteral) return null;\n\n const hasExpressions = node.expressions.length > 0;\n\n if (hasExpressions) return null;\n\n const [quasi] = node.quasis;\n\n if (quasi === undefined) return null;\n\n return quasi.value.cooked;\n};\n\nexport const key = (property: TSESTree.ObjectLiteralElement): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n return text(property.key);\n};\n\nexport const metadataValue = (\n metadata: TSESTree.ObjectExpression,\n name: string\n): TSESTree.Property['value'] | undefined => {\n for (const property of metadata.properties) {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property) continue;\n\n const propertyKey = key(property);\n\n if (propertyKey === name) return property.value;\n }\n\n return undefined;\n};\n", "import {\n Lexer,\n ParseLocation,\n ParseSourceFile,\n ParseSourceSpan,\n Parser,\n R3TargetBinder,\n parseTemplate\n} from '@angular/compiler';\nimport type { ASTWithSource, DirectiveMeta } from '@angular/compiler';\n\nimport { readFileSync, statSync } from 'node:fs';\n\nimport { collectAngularExpressionReads } from './angular-expression-reads.ts';\n\ntype ExternalTemplateCache = {\n readonly reads: Set<string> | null;\n readonly version: string;\n};\n\nconst externalTemplates = new Map<string, ExternalTemplateCache>();\nconst parser = new Parser(new Lexer());\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\n\nexport const templateReads = (\n template: string,\n filename: string\n): Set<string> | null => {\n try {\n const result = parseTemplate(template, filename);\n\n if (result.errors?.length) return null;\n\n return collectAngularExpressionReads(\n result.nodes,\n templateBinder.bind({ template: result.nodes }),\n false\n );\n } catch {\n return null;\n }\n};\n\nexport const externalTemplateReads = (filename: string): Set<string> | null => {\n try {\n const stats = statSync(filename, { bigint: true });\n const version = `${stats.mtimeNs}:${stats.size}`;\n const cached = externalTemplates.get(filename);\n\n if (cached?.version === version) return cached.reads;\n\n const reads = templateReads(readFileSync(filename, 'utf8'), filename);\n\n externalTemplates.set(filename, { reads, version });\n\n return reads;\n } catch {\n return null;\n }\n};\n\nconst parseExpression = (\n expression: string,\n span: ParseSourceSpan,\n action: boolean\n): ASTWithSource => {\n if (action) return parser.parseAction(expression, span, 0);\n\n return parser.parseBinding(expression, span, 0);\n};\n\nexport const expressionReads = (\n expression: string,\n filename: string,\n action: boolean\n): Set<string> | null => {\n try {\n const file = new ParseSourceFile(expression, filename);\n const start = new ParseLocation(file, 0, 0, 0);\n const span = new ParseSourceSpan(start, start.moveBy(expression.length));\n const result = parseExpression(expression, span, action);\n\n if (result.errors.length > 0) return null;\n\n return collectAngularExpressionReads([result], undefined, action);\n } catch {\n return null;\n }\n};\n", "import {\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n SafeKeyedRead,\n ThisReceiver\n} from '@angular/compiler';\nimport type {\n Binary,\n BoundTarget,\n DirectiveMeta,\n PropertyRead,\n SafePropertyRead\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\n\ntype VisitableNode = Parameters<CombinedRecursiveAstVisitor['visit']>[0];\n\nclass ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads = new Set<string>();\n private readonly boundTarget: BoundTarget<DirectiveMeta> | undefined;\n private readonly action: boolean;\n\n public constructor(\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n ) {\n super();\n this.boundTarget = boundTarget;\n this.action = action;\n }\n\n private record(node: PropertyRead | SafePropertyRead): void {\n if (node.receiver instanceof ThisReceiver) {\n this.reads.add(node.name);\n\n return;\n }\n\n if (!(node.receiver instanceof ImplicitReceiver)) return;\n\n const isBindableName = !this.action || node.name !== '$event';\n\n if (!isBindableName) return;\n\n const expressionTarget = this.boundTarget?.getExpressionTarget(node);\n\n if (expressionTarget) return;\n\n this.reads.add(node.name);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n\nexport const collectAngularExpressionReads = (\n nodes: VisitableNode[],\n boundTarget: BoundTarget<DirectiveMeta> | undefined,\n action: boolean\n): Set<string> => {\n const collector = new ReadCollector(boundTarget, action);\n\n for (const node of nodes) {\n collector.visit(node);\n }\n\n return collector.reads;\n};\n", "import {\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead\n} from '@angular/compiler';\nimport type { AST } from '@angular/compiler';\n\nexport const isReadTarget = (\n node: AST\n): node is PropertyRead | SafePropertyRead | KeyedRead | SafeKeyedRead => {\n const isPropertyRead = node instanceof PropertyRead;\n const isSafePropertyRead = node instanceof SafePropertyRead;\n const isKeyedRead = node instanceof KeyedRead;\n const isSafeKeyedRead = node instanceof SafeKeyedRead;\n\n return isPropertyRead || isSafePropertyRead || isKeyedRead || isSafeKeyedRead;\n};\n", "import type { TSESLint } from '@typescript-eslint/utils';\n\nimport { angularClassMetadata } from './angular-imports.ts';\nimport {\n fieldCandidate,\n implementedFormsMethods,\n methodCandidate\n} from './angular-member-candidates.ts';\nimport { metadataReads } from './angular-metadata-reads.ts';\nimport type {\n AngularClassMetadata,\n AngularClassNode,\n ClassEntry,\n FieldCandidateOptions,\n MemberCandidate,\n MessageIds,\n MetadataReadsOptions,\n ReportContext,\n ReportUnusedMembersOptions\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype ClassReportOptions = {\n readonly localTemplates: boolean;\n readonly options: ReportUnusedMembersOptions;\n readonly projectAnalysis: boolean;\n};\n\nconst memberCandidates = (\n node: AngularClassNode,\n options: FieldCandidateOptions\n): MemberCandidate[] => {\n const implementedMethods = implementedFormsMethods(node);\n const members: MemberCandidate[] = [];\n\n for (const element of node.body.body) {\n const candidate =\n fieldCandidate(element, options) ??\n methodCandidate(element, options.localPrivateOnly, implementedMethods);\n\n if (candidate) {\n members.push(candidate);\n }\n }\n\n return members;\n};\n\nconst reportMember = (\n context: ReportContext,\n candidate: MemberCandidate\n): void => {\n const data = { name: candidate.name };\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n data,\n messageId: candidate.messageId,\n node: candidate.node.key\n };\n\n context.report(report);\n};\n\nconst reportUnreadMembers = (\n members: MemberCandidate[],\n reads: Set<string>,\n options: ReportUnusedMembersOptions\n): void => {\n for (const candidate of members) {\n const isTemplateRead = reads.has(candidate.name);\n\n if (isTemplateRead) continue;\n\n const isProjectUsed = options.projectMemberUsed?.(candidate.node) === true;\n\n if (isProjectUsed) continue;\n\n reportMember(options.context, candidate);\n }\n};\n\nconst reportClassMembers = (\n entry: ClassEntry,\n ngClass: AngularClassMetadata,\n report: ClassReportOptions\n): void => {\n const { options, projectAnalysis } = report;\n const isLocalOnlyClass = !ngClass.component || entry.node.abstract === true;\n const candidateOptions: FieldCandidateOptions = {\n allowEffectFields: options.allowEffectFields,\n imports: options.imports,\n localPrivateOnly: !projectAnalysis && isLocalOnlyClass,\n sourceCode: options.context.sourceCode\n };\n const members = memberCandidates(entry.node, candidateOptions);\n const unreadMembers = members.filter(\n (candidate) => !entry.reads.has(candidate.name)\n );\n\n if (unreadMembers.length === 0) return;\n\n const remainingNames = unreadMembers.map((candidate) => candidate.name);\n const readsOptions: MetadataReadsOptions = {\n component: ngClass.component && report.localTemplates,\n filename: options.context.filename,\n metadata: ngClass.metadata,\n remainingNames,\n requireTemplate: !projectAnalysis\n };\n const reads = metadataReads(readsOptions);\n\n if (!reads) return;\n\n reportUnreadMembers(unreadMembers, reads, options);\n};\n\nexport const reportUnusedMembers = (\n options: ReportUnusedMembersOptions\n): void => {\n const projectAnalysis = options.projectMemberUsed !== undefined;\n const localTemplates = !projectAnalysis || !options.projectIndexed();\n const report: ClassReportOptions = {\n localTemplates,\n options,\n projectAnalysis\n };\n\n for (const entry of options.classes) {\n const ngClass = angularClassMetadata(entry.node, options.imports);\n const isDynamicClass = options.dynamicClasses.has(entry);\n\n if (!ngClass || isDynamicClass) continue;\n\n reportClassMembers(entry, ngClass, report);\n }\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n destructuredThisReads,\n isThisExpression\n} from './typescript-field-reads.ts';\nimport { lexicalThisVisitor } from './typescript-lexical-this.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type {\n AngularClassNode,\n ClassEntry,\n DynamicClasses\n} from '../common/no-unused-angular-instance-fields.type.ts';\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\nconst enterClass = (\n node: AngularClassNode,\n classes: ClassEntry[],\n stack: ClassEntry[],\n thisStack: boolean[]\n): void => {\n const entry: ClassEntry = {\n node,\n reads: new Set<string>()\n };\n\n classes.push(entry);\n stack.push(entry);\n thisStack.push(true);\n};\n\nconst trackMemberRead = (\n node: TSESTree.MemberExpression,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const receiverIsThis = isThisExpression(node.object);\n\n if (node.computed && receiverIsThis) {\n dynamicClasses.add(current);\n }\n\n if (!receiverIsThis || node.computed) return;\n\n const isWriteOnlyTarget = isWriteOnly(node);\n\n if (isWriteOnlyTarget) return;\n\n if (node.property.type === TSESTree.AST_NODE_TYPES.Identifier) {\n current.reads.add(node.property.name);\n }\n};\n\nconst trackDestructuringRead = (\n node: DestructuringNode,\n stack: ClassEntry[],\n thisStack: boolean[],\n dynamicClasses: DynamicClasses\n): void => {\n const current = stack.at(-1);\n const isComponentThis = thisStack.at(-1);\n\n if (!current || !isComponentThis) return;\n\n const reads = destructuredThisReads(node);\n\n if (reads === undefined) return;\n\n if (reads === null) {\n dynamicClasses.add(current);\n\n return;\n }\n\n for (const name of reads) {\n current.reads.add(name);\n }\n};\n\nexport const classReadVisitor = (\n classes: ClassEntry[],\n stack: ClassEntry[],\n dynamicClasses: DynamicClasses\n): TSESLint.RuleListener => {\n const thisStack: boolean[] = [];\n\n const listeners: TSESLint.RuleListener = {\n ClassDeclaration(node: TSESTree.ClassDeclaration): void {\n enterClass(node, classes, stack, thisStack);\n },\n ClassExpression(node: TSESTree.ClassExpression): void {\n enterClass(node, classes, stack, thisStack);\n },\n 'ClassDeclaration:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n 'ClassExpression:exit'(): void {\n stack.pop();\n thisStack.pop();\n },\n ...lexicalThisVisitor(thisStack),\n AssignmentExpression(node: TSESTree.AssignmentExpression): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n },\n MemberExpression(node: TSESTree.MemberExpression): void {\n trackMemberRead(node, stack, thisStack, dynamicClasses);\n },\n VariableDeclarator(node: TSESTree.VariableDeclarator): void {\n trackDestructuringRead(node, stack, thisStack, dynamicClasses);\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\ntype TypeScriptExpressionWrapper =\n | TSESTree.TSAsExpression\n | TSESTree.TSInstantiationExpression\n | TSESTree.TSNonNullExpression\n | TSESTree.TSSatisfiesExpression\n | TSESTree.TSTypeAssertion;\n\ntype DestructuringNode =\n TSESTree.AssignmentExpression | TSESTree.VariableDeclarator;\n\ntype DestructuringParts = {\n readonly pattern: TSESTree.BindingName | TSESTree.Expression;\n readonly source: TSESTree.Expression | null;\n};\n\nconst expressionWrapperTypes: ReadonlySet<TSESTree.AST_NODE_TYPES> = new Set([\n TSESTree.AST_NODE_TYPES.TSAsExpression,\n TSESTree.AST_NODE_TYPES.TSInstantiationExpression,\n TSESTree.AST_NODE_TYPES.TSNonNullExpression,\n TSESTree.AST_NODE_TYPES.TSSatisfiesExpression,\n TSESTree.AST_NODE_TYPES.TSTypeAssertion\n]);\n\nexport const isTypeScriptExpressionWrapper = (\n node: TSESTree.Node\n): node is TypeScriptExpressionWrapper => {\n return expressionWrapperTypes.has(node.type);\n};\n\nconst unwrapTypeScriptExpression = (\n node: TSESTree.Expression | null\n): TSESTree.Expression | null => {\n let current = node;\n\n while (current && isTypeScriptExpressionWrapper(current)) {\n current = current.expression;\n }\n\n return current;\n};\n\nexport const isThisExpression = (node: TSESTree.Expression | null): boolean => {\n const unwrapped = unwrapTypeScriptExpression(node);\n\n return unwrapped?.type === TSESTree.AST_NODE_TYPES.ThisExpression;\n};\n\nconst destructuringParts = (\n node: DestructuringNode\n): DestructuringParts | null => {\n if (node.type === TSESTree.AST_NODE_TYPES.VariableDeclarator) {\n const variableParts: DestructuringParts | null = {\n pattern: node.id,\n source: node.init\n };\n\n return variableParts;\n }\n\n if (node.operator === '=') {\n const assignmentParts: DestructuringParts | null = {\n pattern: node.left,\n source: node.right\n };\n\n return assignmentParts;\n }\n\n return null;\n};\n\nconst propertyName = (\n property: TSESTree.Property | TSESTree.RestElement\n): string | null => {\n if (property.type !== TSESTree.AST_NODE_TYPES.Property || property.computed) {\n return null;\n }\n\n if (property.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return property.key.name;\n }\n\n const { value } = property.key;\n\n if (typeof value !== 'string') return null;\n\n return value;\n};\n\nexport const destructuredThisReads = (\n node: DestructuringNode\n): string[] | null | undefined => {\n const parts = destructuringParts(node);\n\n if (!parts) return undefined;\n\n if (parts.pattern.type !== TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return undefined;\n }\n\n const isThisSource = isThisExpression(parts.source);\n\n if (!isThisSource) return undefined;\n\n const reads: string[] = [];\n\n for (const property of parts.pattern.properties) {\n const name = propertyName(property);\n\n if (name === null) return null;\n\n reads.push(name);\n }\n\n return reads;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype FunctionNode =\n | TSESTree.ArrowFunctionExpression\n | TSESTree.FunctionDeclaration\n | TSESTree.FunctionExpression;\n\nconst componentThis = (node: FunctionNode, thisStack: boolean[]): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.ArrowFunctionExpression) {\n return thisStack.at(-1) ?? false;\n }\n\n const { parent } = node;\n\n if (parent.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return !parent.static;\n};\n\nexport const lexicalThisVisitor = (\n thisStack: boolean[]\n): TSESLint.RuleListener => {\n const listeners: TSESLint.RuleListener = {\n FunctionDeclaration(node: TSESTree.FunctionDeclaration): void {\n thisStack.push(componentThis(node, thisStack));\n },\n FunctionExpression(node: TSESTree.FunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void {\n thisStack.push(componentThis(node, thisStack));\n },\n 'FunctionDeclaration:exit'(): void {\n thisStack.pop();\n },\n 'FunctionExpression:exit'(): void {\n thisStack.pop();\n },\n 'ArrowFunctionExpression:exit'(): void {\n thisStack.pop();\n },\n StaticBlock(): void {\n thisStack.push(false);\n },\n 'StaticBlock:exit'(): void {\n thisStack.pop();\n },\n PropertyDefinition(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.push(false);\n }\n },\n 'PropertyDefinition:exit'(node: TSESTree.PropertyDefinition): void {\n if (node.static) {\n thisStack.pop();\n }\n }\n };\n\n return listeners;\n};\n", "import { TSESTree } from '@typescript-eslint/utils';\n\nimport { isTypeScriptExpressionWrapper } from './typescript-field-reads.ts';\n\nconst parentOf = (node: TSESTree.Node): TSESTree.Node | undefined => {\n if (node.type === TSESTree.AST_NODE_TYPES.Program) return undefined;\n\n return node.parent;\n};\n\nconst isPatternTarget = (\n parent: TSESTree.Node | undefined,\n child: TSESTree.Node\n): boolean => {\n if (parent === undefined) return false;\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ArrayPattern) {\n return parent.elements.some((element) => element === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parent.left === child;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern) {\n return parent.properties.some((property) => property === child);\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.Property) {\n const isObjectPattern =\n parent.parent.type === TSESTree.AST_NODE_TYPES.ObjectPattern;\n\n return parent.value === child && isObjectPattern;\n }\n\n if (parent.type === TSESTree.AST_NODE_TYPES.RestElement) {\n return parent.argument === child;\n }\n\n return false;\n};\n\nconst isSimpleAssignmentTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n if (parent?.type !== TSESTree.AST_NODE_TYPES.AssignmentExpression) {\n return false;\n }\n\n return parent.left === current && parent.operator === '=';\n};\n\nconst isLoopTarget = (\n parent: TSESTree.Node | undefined,\n current: TSESTree.Node\n): boolean => {\n const isForIn = parent?.type === TSESTree.AST_NODE_TYPES.ForInStatement;\n const isForOf = parent?.type === TSESTree.AST_NODE_TYPES.ForOfStatement;\n const isLoop = isForIn || isForOf;\n\n if (!isLoop) return false;\n\n return parent.left === current;\n};\n\nconst isWrapping = (parent: TSESTree.Node, child: TSESTree.Node): boolean => {\n const isWrapper = isTypeScriptExpressionWrapper(parent);\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isDirectWrite = (node: TSESTree.MemberExpression): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n\n while (\n parent &&\n isTypeScriptExpressionWrapper(parent) &&\n parent.expression === current\n ) {\n current = parent;\n parent = parentOf(parent);\n }\n\n const isDeleteExpression =\n parent?.type === TSESTree.AST_NODE_TYPES.UnaryExpression &&\n parent.operator === 'delete';\n const isAssignment = isSimpleAssignmentTarget(parent, current);\n\n return isAssignment || isDeleteExpression;\n};\n\nconst isDestructuringOrLoopTarget = (\n node: TSESTree.MemberExpression\n): boolean => {\n let current: TSESTree.Node = node;\n let parent = parentOf(node);\n let patternTarget = false;\n\n while (parent) {\n const wrapper = isWrapping(parent, current);\n const pattern = isPatternTarget(parent, current);\n\n if (!wrapper && !pattern) break;\n\n if (pattern) {\n patternTarget = true;\n }\n\n current = parent;\n parent = parentOf(parent);\n }\n\n const isSimpleTarget = isSimpleAssignmentTarget(parent, current);\n const isAssignedPattern = patternTarget && isSimpleTarget;\n\n return isAssignedPattern || isLoopTarget(parent, current);\n};\n\nexport const isWriteOnly = (node: TSESTree.MemberExpression): boolean => {\n const isWrite = isDirectWrite(node);\n\n if (isWrite) return true;\n\n return isDestructuringOrLoopTarget(node);\n};\n", "import { isClassElement, isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { Node, Program } from 'typescript';\n\nimport { buildDirectiveIndex } from './angular/angular-directive-index.ts';\nimport type {\n ProjectIndex,\n ProjectUsageIndex\n} from './common/project-index.type.ts';\nimport { reconcile } from './project-index-reconciliation.ts';\n\nconst indexes = new Map<string, ProjectIndex>();\n\nconst memberName = (node: Node): string | null => {\n const isMember = isClassElement(node);\n\n if (!isMember) return null;\n\n if (!node.name) return null;\n\n const isIdentifierName = isIdentifier(node.name);\n const isStringName = isStringLiteralLike(node.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (!isNamedMember) return null;\n\n return node.name.text;\n};\n\nconst usageOf = (index: ProjectIndex): ProjectUsageIndex => {\n if (index.usage !== undefined) return index.usage;\n\n const declarations = new Set<Node>();\n const fallbackNames = new Set<string>();\n\n for (const entry of index.entries.values()) {\n for (const declaration of entry.declarations) {\n declarations.add(declaration);\n }\n\n for (const name of entry.fallbackNames) {\n fallbackNames.add(name);\n }\n }\n\n index.usage = {\n has: (node): boolean => {\n const hasDeclaration = declarations.has(node);\n\n if (hasDeclaration) return true;\n\n if (fallbackNames.size === 0) return false;\n\n const name = memberName(node);\n\n return name !== null && fallbackNames.has(name);\n }\n };\n\n return index.usage;\n};\n\nconst createIndex = (): ProjectIndex => {\n const emptyIndex: ProjectIndex = {\n candidateNames: new Set(),\n classes: new Map(),\n directives: buildDirectiveIndex([]),\n directiveShape: '',\n entries: new Map(),\n program: null,\n templateCheckDuration: 0,\n templateCheckedAt: 0,\n usage: undefined\n };\n\n return emptyIndex;\n};\n\n/**\n * True when the index already reflects this exact Program, so callers can\n * skip local work the index duplicates (such as parsing a component's own\n * template) without ever triggering a build.\n */\nexport const projectUsageIsCurrent = (program: Program): boolean => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n return (\n typeof configFilePath === 'string' &&\n indexes.get(configFilePath)?.program === program\n );\n};\n\n/**\n * Member declarations read anywhere in the Program's non-spec TypeScript\n * and Angular templates, or null when the project cannot be indexed\n * reliably. Indexes are kept per tsconfig and updated incrementally: a new\n * Program (an edit in the editor) only re-indexes the files that changed\n * and the files whose resolutions depended on them.\n */\nexport const projectUsage = (program: Program): ProjectUsageIndex | null => {\n const configFilePath = program.getCompilerOptions()['configFilePath'];\n\n if (typeof configFilePath !== 'string') return null;\n\n let index = indexes.get(configFilePath);\n\n if (!index) {\n index = createIndex();\n indexes.set(configFilePath, index);\n }\n\n try {\n reconcile(index, program);\n\n return usageOf(index);\n } catch {\n indexes.delete(configFilePath);\n\n return null;\n }\n};\n", "import { CssSelector, SelectorMatcher } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport type {\n AngularClass,\n DirectiveIndex\n} from '../common/project-usage.type.ts';\n\n/**\n * A description of every directive's selector and exportAs; when it changes\n * between programs, cached template reference resolutions are stale.\n */\nconst classShape = ({\n component,\n declaration,\n exportAs,\n hostDirectives,\n name,\n selector\n}: AngularClass): string => {\n const fields = [\n declaration.getSourceFile().fileName,\n name,\n String(component),\n String(hostDirectives),\n selector ?? '',\n exportAs.join(',')\n ];\n\n return fields.join('\\0');\n};\n\nexport const directiveShape = (classes: Iterable<AngularClass>): string => {\n const shapes = [...classes].map(classShape);\n\n return shapes.sort().join('\\n');\n};\n\nconst parseSelector = (selector: string): CssSelector[] | null => {\n try {\n return CssSelector.parse(selector);\n } catch {\n return null;\n }\n};\n\nexport const buildDirectiveIndex = (\n classes: Iterable<AngularClass>\n): DirectiveIndex => {\n const byDeclaration = new Map<ClassLikeDeclaration, AngularClass>();\n const byExportAs = new Map<string, ClassLikeDeclaration[]>();\n const componentMatcher = new SelectorMatcher<ClassLikeDeclaration[]>();\n\n for (const angularClass of classes) {\n const { component, declaration, exportAs, selector } = angularClass;\n\n byDeclaration.set(declaration, angularClass);\n\n for (const name of exportAs) {\n const declarations = byExportAs.get(name) ?? [];\n\n declarations.push(declaration);\n byExportAs.set(name, declarations);\n }\n\n if (component && selector !== null) {\n const selectors = parseSelector(selector);\n\n if (selectors) {\n componentMatcher.addSelectables(selectors, [declaration]);\n }\n }\n }\n\n const directiveIndex: DirectiveIndex = {\n byDeclaration,\n byExportAs,\n componentMatcher\n };\n\n return directiveIndex;\n};\n", "import { readFileSync, statSync } from 'node:fs';\n\nimport { isIdentifier, isStringLiteralLike } from 'typescript';\nimport type { ClassElement, ClassLikeDeclaration } from 'typescript';\n\nimport { addTemplateReads } from './angular-template-read-resolution.ts';\nimport type {\n TemplateFileVersion,\n TemplateReads\n} from '../common/project-index.type.ts';\nimport type {\n AngularClass,\n CandidateNames,\n CollectTemplateReadsOptions,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype TemplateSource = {\n readonly fileName: string;\n readonly source: string;\n};\n\nconst memberNameOf = (member: ClassElement): string[] => {\n const name = member.name;\n\n if (!name) return [];\n\n const isIdentifierName = isIdentifier(name);\n const isStringName = isStringLiteralLike(name);\n const isTextName = isIdentifierName || isStringName;\n\n if (!isTextName) return [];\n\n const names = [name.text];\n\n return names;\n};\n\nconst memberNames = (declaration: ClassLikeDeclaration): string[] => {\n return declaration.members.flatMap(memberNameOf);\n};\n\n/**\n * What a template we cannot read might reference: the component's own\n * members and those of every class in its scope, or every candidate name\n * when the scope is unknown.\n */\nconst unknownTemplateNames = (\n { declaration, scope }: AngularClass,\n allNames: CandidateNames\n): Iterable<string> => {\n if (scope === null) return allNames;\n\n const scopeNames = scope.flatMap(memberNames);\n const names = [...memberNames(declaration), ...scopeNames];\n\n return names;\n};\n\nconst templateFileVersion = (fileName: string): TemplateFileVersion => {\n const { mtimeNs, size } = statSync(fileName, { bigint: true });\n\n const version: TemplateFileVersion = { fileName, mtimeNs, size };\n\n return version;\n};\n\nexport const templateFileIsCurrent = (\n version: TemplateFileVersion\n): boolean => {\n try {\n const current = statSync(version.fileName, { bigint: true });\n\n return current.mtimeNs === version.mtimeNs && current.size === version.size;\n } catch {\n return false;\n }\n};\n\nconst templateSourceOf = (\n angularClass: AngularClass,\n allNames: CandidateNames,\n sink: ReadSink,\n versions: TemplateFileVersion[]\n): TemplateSource | null => {\n const { declaration, template, valid } = angularClass;\n const fileName = declaration.getSourceFile().fileName;\n const className = declaration.name?.text ?? '(anonymous)';\n\n if (!valid) {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: metadata of ${className} is not static (template, templateUrl)`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n\n if (!template) return null;\n\n if (template.kind === 'inline') {\n const inlineSource: TemplateSource = { fileName, source: template.source };\n\n return inlineSource;\n }\n\n const templateFileName = template.fileName;\n\n try {\n versions.push(templateFileVersion(templateFileName));\n\n const source = readFileSync(templateFileName, 'utf8');\n const externalSource: TemplateSource = {\n fileName: templateFileName,\n source\n };\n\n return externalSource;\n } catch {\n const names = unknownTemplateNames(angularClass, allNames);\n const reason = `${fileName}: templateUrl of ${className} cannot be read (${templateFileName})`;\n\n sink.addFallbackNames(names, reason);\n\n return null;\n }\n};\n\n/** Reads made by the templates of the components declared in one file. */\nexport const collectAngularTemplateReads = ({\n allNames,\n checker,\n classes,\n directives,\n sink\n}: CollectTemplateReadsOptions): TemplateReads => {\n const templateVersions: TemplateFileVersion[] = [];\n let usedDirectiveIndex = false;\n\n for (const angularClass of classes) {\n const template = templateSourceOf(\n angularClass,\n allNames,\n sink,\n templateVersions\n );\n\n if (template === null) continue;\n\n const result = addTemplateReads({\n angularClass,\n checker,\n directives,\n fileName: template.fileName,\n sink,\n source: template.source\n });\n\n usedDirectiveIndex ||= result.usedDirectiveIndex;\n }\n\n const templateReads: TemplateReads = {\n templateVersions,\n usedDirectiveIndex\n };\n\n return templateReads;\n};\n", "import {\n R3TargetBinder,\n ThisReceiver,\n TmplAstReference,\n parseTemplate\n} from '@angular/compiler';\nimport type {\n BoundTarget,\n DirectiveMeta,\n TemplateEntity\n} from '@angular/compiler';\n\nimport { addResolvedPath } from './angular-resolved-path.ts';\nimport { ReadCollector } from './angular-template-read-chains.ts';\nimport { addReferenceRead } from './angular-template-references.ts';\nimport type {\n ReadChain,\n ReadSegment,\n ResolvedPathOptions,\n TemplateReadContext,\n TemplateReadsOptions\n} from '../common/project-usage.type.ts';\nimport { chainText } from '../utils/read-chain-text.util.ts';\n\ntype TemplateReadResult = {\n /** True when a `#reference` was resolved through the directive index. */\n readonly usedDirectiveIndex: boolean;\n};\n\n/** Every identifier-like token in a text: a superset of what it can read. */\nconst identifierNames = (text: string): Set<string> => {\n const matches = text.match(/[A-Za-z_$][\\w$]*/gu) ?? [];\n\n return new Set(matches);\n};\n\nconst templateBinder = new R3TargetBinder<DirectiveMeta>(null);\n\nconst unparsedTemplateReads = (\n context: TemplateReadContext,\n source: string,\n error: string | undefined\n): TemplateReadResult => {\n const names = identifierNames(source);\n const message = error ?? 'unknown error';\n const reason = `${context.fileName}: template of ${context.className} does not parse (${message})`;\n\n context.sink.addFallbackNames(names, reason);\n\n const unparsedReads: TemplateReadResult = { usedDirectiveIndex: false };\n\n return unparsedReads;\n};\n\nconst addComponentRead = (\n context: TemplateReadContext,\n names: ReadSegment[]\n): void => {\n const { checker, className, declaration, fileName, sink } = context;\n const options: ResolvedPathOptions = {\n allowMissingRoot: true,\n checker,\n declaration,\n names,\n sink\n };\n const isResolved = addResolvedPath(options);\n\n if (isResolved) return;\n\n const fallbackNames = names.map((segment) => segment.name);\n const reason = `${fileName}: cannot resolve '${chainText(names)}' on ${className}`;\n\n sink.addFallbackNames(fallbackNames, reason);\n};\n\nconst chainEntity = (\n boundTarget: BoundTarget<DirectiveMeta>,\n chain: ReadChain\n): TemplateEntity | null => {\n const isThisRead = chain.root.receiver instanceof ThisReceiver;\n\n if (isThisRead) return null;\n\n return boundTarget.getExpressionTarget(chain.root);\n};\n\nconst addChainRead = (\n context: TemplateReadContext,\n reads: ReadCollector,\n boundTarget: BoundTarget<DirectiveMeta>,\n chain: ReadChain\n): boolean => {\n const entity = chainEntity(boundTarget, chain);\n\n if (entity === null) {\n addComponentRead(context, chain.names);\n\n return false;\n }\n\n if (!(entity instanceof TmplAstReference)) return false;\n\n const owner = reads.referenceOwners.get(entity);\n const names = chain.names.slice(1);\n\n addReferenceRead(context, entity, owner, names);\n\n return true;\n};\n\nexport const addTemplateReads = ({\n angularClass,\n checker,\n directives,\n fileName,\n sink,\n source\n}: TemplateReadsOptions): TemplateReadResult => {\n const { declaration, scope } = angularClass;\n const className = declaration.name?.text ?? '(anonymous)';\n const context: TemplateReadContext = {\n checker,\n className,\n declaration,\n directives,\n fileName,\n scope,\n sink\n };\n const parsed = parseTemplate(source, fileName);\n\n if (parsed.errors?.length) {\n const error = parsed.errors[0]?.msg;\n\n return unparsedTemplateReads(context, source, error);\n }\n\n const boundTarget = templateBinder.bind({ template: parsed.nodes });\n const reads = new ReadCollector();\n\n for (const node of parsed.nodes) {\n reads.visit(node);\n }\n\n let usedDirectiveIndex = false;\n\n for (const chain of reads.reads) {\n const usedIndex = addChainRead(context, reads, boundTarget, chain);\n\n usedDirectiveIndex ||= usedIndex;\n }\n\n const templateReads: TemplateReadResult = { usedDirectiveIndex };\n\n return templateReads;\n};\n", "import { SignatureKind, TypeFlags } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport type {\n ReadSink,\n ResolvedPathOptions\n} from '../common/project-usage.type.ts';\nimport {\n stringIndexTypes,\n symbolsForName\n} from '../utils/type-property-symbols.util.ts';\n\nconst hasAnyOrUnknownFlag = (type: { flags: TypeFlags }): boolean => {\n const anyOrUnknown = TypeFlags.Any | TypeFlags.Unknown;\n\n return (type.flags & anyOrUnknown) !== 0;\n};\n\nconst isAnyOrUnknown = (types: { flags: TypeFlags }[]): boolean => {\n return types.some(hasAnyOrUnknownFlag);\n};\n\nconst addTypes = (sink: ReadSink, types: Type[]): void => {\n for (const type of types) {\n sink.addType(type);\n }\n};\n\nconst callReturnTypes = (checker: TypeChecker, type: Type): Type[] => {\n const signatures = checker.getSignaturesOfType(type, SignatureKind.Call);\n\n return signatures.map((signature) => signature.getReturnType());\n};\n\nconst memberTypes = (\n symbols: Set<Symbol>,\n declaration: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): Type[] => {\n const types: Type[] = [];\n\n for (const symbol of symbols) {\n for (const memberDeclaration of symbol.declarations ?? []) {\n sink.addDeclaration(memberDeclaration);\n }\n\n types.push(checker.getTypeOfSymbolAtLocation(symbol, declaration));\n }\n\n return types;\n};\n\nexport const addResolvedPath = ({\n allowMissingRoot,\n checker,\n declaration,\n names,\n sink\n}: ResolvedPathOptions): boolean => {\n let types = [checker.getTypeAtLocation(declaration)];\n const indexTypesOf = (type: Type): Type[] => stringIndexTypes(checker, type);\n const returnTypesOf = (type: Type): Type[] => callReturnTypes(checker, type);\n\n for (const [index, segment] of names.entries()) {\n addTypes(sink, types);\n\n const symbolsOf = (type: Type): Symbol[] => {\n return symbolsForName(checker, type, segment.name);\n };\n const symbols = new Set(types.flatMap(symbolsOf));\n\n if (symbols.size === 0) {\n const indexedTypes = types.flatMap(indexTypesOf);\n\n if (indexedTypes.length > 0) {\n types = indexedTypes;\n continue;\n }\n\n const isAnyOrUnknownType = isAnyOrUnknown(types);\n\n if (isAnyOrUnknownType) return true;\n\n return index === 0 && allowMissingRoot;\n }\n\n types = memberTypes(symbols, declaration, checker, sink);\n\n if (segment.called) {\n const returnTypes = types.flatMap(returnTypesOf);\n\n if (returnTypes.length === 0) return isAnyOrUnknown(types);\n\n types = returnTypes;\n }\n }\n\n return true;\n};\n", "import { IndexKind } from 'typescript';\nimport type { Symbol, Type, TypeChecker } from 'typescript';\n\nexport const symbolsForName = (\n checker: TypeChecker,\n type: Type,\n name: string\n): Symbol[] => {\n const symbol = checker.getPropertyOfType(checker.getApparentType(type), name);\n\n if (symbol) return [symbol];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const symbols = new Set<Symbol>();\n\n for (const member of type.types) {\n for (const memberSymbol of symbolsForName(checker, member, name)) {\n symbols.add(memberSymbol);\n }\n }\n\n return [...symbols];\n};\n\nexport const stringIndexTypes = (checker: TypeChecker, type: Type): Type[] => {\n const indexedType = checker.getIndexTypeOfType(\n checker.getApparentType(type),\n IndexKind.String\n );\n\n if (indexedType) return [indexedType];\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (!isUnionOrIntersection) return [];\n\n const indexedTypes = new Set<Type>();\n\n for (const member of type.types) {\n for (const memberIndexedType of stringIndexTypes(checker, member)) {\n indexedTypes.add(memberIndexedType);\n }\n }\n\n return [...indexedTypes];\n};\n", "import type {\n AST,\n Binary,\n TmplAstComponent,\n TmplAstDirective,\n TmplAstElement,\n TmplAstReference,\n TmplAstTemplate\n} from '@angular/compiler';\nimport {\n Call,\n CombinedRecursiveAstVisitor,\n ImplicitReceiver,\n KeyedRead,\n PropertyRead,\n SafeKeyedRead,\n SafePropertyRead,\n ThisReceiver\n} from '@angular/compiler';\n\nimport { isReadTarget } from '../../utils/angular-read-target.util.ts';\nimport type {\n ReadChain,\n ReadSegment,\n ReferenceOwner\n} from '../common/project-usage.type.ts';\n\ntype ChainStep = {\n readonly called: boolean;\n readonly next: PropertyRead | SafePropertyRead;\n};\n\nconst isPropertyReadLike = (\n node: AST\n): node is PropertyRead | SafePropertyRead => {\n const isPlainRead = node instanceof PropertyRead;\n const isSafeRead = node instanceof SafePropertyRead;\n\n return isPlainRead || isSafeRead;\n};\n\nconst isRootRead = (read: PropertyRead | SafePropertyRead): boolean => {\n const isImplicitReceiver = read.receiver instanceof ImplicitReceiver;\n const isThisReceiver = read.receiver instanceof ThisReceiver;\n\n return isImplicitReceiver || isThisReceiver;\n};\n\nconst chainStep = (read: PropertyRead | SafePropertyRead): ChainStep | null => {\n const receiver = read.receiver;\n const isReadReceiver = isPropertyReadLike(receiver);\n\n if (isReadReceiver) {\n const readStep: ChainStep = { called: false, next: receiver };\n\n return readStep;\n }\n\n const isCallReceiver = receiver instanceof Call;\n\n if (!isCallReceiver) return null;\n\n const target = receiver.receiver;\n const isReadLikeTarget = isPropertyReadLike(target);\n\n if (!isReadLikeTarget) return null;\n\n const calledStep: ChainStep = { called: true, next: target };\n\n return calledStep;\n};\n\nconst readChain = (node: PropertyRead | SafePropertyRead): ReadChain | null => {\n const leaf: ReadSegment = { called: false, name: node.name };\n const names: ReadSegment[] = [leaf];\n let current = node;\n\n while (!isRootRead(current)) {\n const step = chainStep(current);\n\n if (step === null) return null;\n\n current = step.next;\n names.unshift({ called: step.called, name: current.name });\n }\n\n if (!(current instanceof PropertyRead)) return null;\n\n const chain: ReadChain = { names, root: current };\n\n return chain;\n};\n\nexport class ReadCollector extends CombinedRecursiveAstVisitor {\n public readonly reads: ReadChain[] = [];\n public readonly referenceOwners = new Map<TmplAstReference, ReferenceOwner>();\n\n private record(node: PropertyRead | SafePropertyRead): void {\n const chain = readChain(node);\n\n if (chain) {\n this.reads.push(chain);\n }\n }\n\n private recordReferences(owner: ReferenceOwner): void {\n for (const reference of owner.references) {\n this.referenceOwners.set(reference, owner);\n }\n }\n\n public override visitElement(element: TmplAstElement): void {\n this.recordReferences(element);\n super.visitElement(element);\n }\n\n public override visitTemplate(template: TmplAstTemplate): void {\n this.recordReferences(template);\n super.visitTemplate(template);\n }\n\n public override visitComponent(component: TmplAstComponent): void {\n this.recordReferences(component);\n super.visitComponent(component);\n }\n\n public override visitDirective(directive: TmplAstDirective): void {\n this.recordReferences(directive);\n super.visitDirective(directive);\n }\n\n public override visitBinary(node: Binary, context: unknown): unknown {\n if (node.operation !== '=') return super.visitBinary(node, context);\n\n if (isReadTarget(node.left)) {\n this.visit(node.left.receiver);\n }\n\n if (node.left instanceof KeyedRead || node.left instanceof SafeKeyedRead) {\n this.visit(node.left.key);\n }\n\n this.visit(node.right);\n\n return undefined;\n }\n\n public override visitPropertyRead(\n node: PropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitPropertyRead(node, context);\n }\n\n public override visitSafePropertyRead(\n node: SafePropertyRead,\n context: unknown\n ): unknown {\n this.record(node);\n\n return super.visitSafePropertyRead(node, context);\n }\n}\n", "import { TmplAstElement, createCssSelectorFromNode } from '@angular/compiler';\nimport type { TmplAstReference } from '@angular/compiler';\n\nimport type { ClassLikeDeclaration } from 'typescript';\n\nimport { addResolvedPath } from './angular-resolved-path.ts';\nimport type {\n DirectiveIndex,\n ReadSegment,\n ReferenceOwner,\n ResolvedPathOptions,\n TemplateReadContext\n} from '../common/project-usage.type.ts';\nimport { chainText } from '../utils/read-chain-text.util.ts';\n\n/**\n * Classes a `#reference` can resolve to. Candidates come from the whole\n * Program and are narrowed to the component's standalone `imports` when\n * that scope is known; a scope member with `hostDirectives` may expose\n * exportAs names that are not modelled, so it keeps the wider set. Extra\n * candidates only add reads.\n */\nconst referenceTargets = (\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n directives: DirectiveIndex,\n scope: ClassLikeDeclaration[] | null\n): ClassLikeDeclaration[] => {\n const exportAs = reference.value.trim();\n let targets: ClassLikeDeclaration[] = [];\n\n if (exportAs !== '') {\n const exportedTargets = directives.byExportAs.get(exportAs) ?? [];\n\n targets = [...exportedTargets];\n } else if (owner instanceof TmplAstElement) {\n directives.componentMatcher.match(\n createCssSelectorFromNode(owner),\n (_selector, declarations) => {\n targets.push(...declarations);\n }\n );\n }\n\n const scoped =\n scope !== null &&\n !scope.some(\n (declaration) => directives.byDeclaration.get(declaration)?.hostDirectives\n );\n\n if (!scoped) return targets;\n\n const scopedTargets = targets.filter((target) => scope.includes(target));\n\n return scopedTargets;\n};\n\n/** Reads made on the classes a template `#reference` resolves to. */\nexport const addReferenceRead = (\n context: TemplateReadContext,\n reference: TmplAstReference,\n owner: ReferenceOwner | undefined,\n names: ReadSegment[]\n): void => {\n const { checker, className, directives, fileName, scope, sink } = context;\n const targets = referenceTargets(reference, owner, directives, scope);\n const isTargetResolved = (target: ClassLikeDeclaration): boolean => {\n const options: ResolvedPathOptions = {\n allowMissingRoot: false,\n checker,\n declaration: target,\n names,\n sink\n };\n\n return addResolvedPath(options);\n };\n const resolved = targets.map(isTargetResolved);\n const hasResolvedTarget = resolved.includes(true);\n\n if (resolved.length === 0) return;\n\n if (hasResolvedTarget) return;\n\n const fallbackNames = names.map((segment) => segment.name);\n const reason = `${fileName}: cannot resolve '#${reference.name}.${chainText(names)}' in ${className}`;\n\n sink.addFallbackNames(fallbackNames, reason);\n};\n", "import type { ReadSegment } from '../common/project-usage.type.ts';\n\nconst segmentText = (segment: ReadSegment): string => {\n const call = segment.called ? '()' : '';\n\n return `${segment.name}${call}`;\n};\n\n/** A read chain rendered the way it appeared in the template. */\nexport const chainText = (names: ReadSegment[]): string => {\n const texts = names.map(segmentText);\n\n return texts.join('.');\n};\n", "import {\n forEachChild,\n isClassLike,\n isElementAccessExpression,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ElementAccessExpression,\n Node,\n PropertyAccessExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { collectAngularInterfaceMethods } from './typescript-angular-interface-methods.ts';\nimport { collectDestructuringReads } from './typescript-destructuring-reads.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n literalPropertyNames\n} from './typescript-symbol-reads.ts';\nimport { isWriteOnly } from './typescript-write-targets.ts';\nimport type { CandidateNames, ReadSink } from '../common/project-usage.type.ts';\n\nconst addPropertyAccessRead = (\n node: PropertyAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const isCandidateName = candidateNames.has(node.name.text);\n\n if (!isCandidateName) return;\n\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n sink.addType(checker.getTypeAtLocation(node.expression));\n\n const symbol = checker.getSymbolAtLocation(node.name);\n\n if (symbol) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n};\n\nconst addElementAccessRead = (\n node: ElementAccessExpression,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const isWriteTarget = isWriteOnly(node);\n\n if (isWriteTarget) return;\n\n const argumentType = checker.getTypeAtLocation(node.argumentExpression);\n const names = literalPropertyNames(argumentType);\n\n if (names) {\n const hasCandidateName = names.some((name) => candidateNames.has(name));\n\n if (!hasCandidateName) return;\n }\n\n const targetType = checker.getTypeAtLocation(node.expression);\n\n addNamedProperties(checker, targetType, names, sink);\n};\n\nexport const collectTypeScriptReads = (\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const visit = (node: Node): void => {\n const isPropertyAccess = isPropertyAccessExpression(node);\n const isElementAccess = isElementAccessExpression(node);\n const isClass = isClassLike(node);\n\n if (isPropertyAccess) {\n addPropertyAccessRead(node, checker, sink, candidateNames);\n } else if (isElementAccess) {\n addElementAccessRead(node, checker, sink, candidateNames);\n } else if (isClass) {\n collectAngularInterfaceMethods(node, checker, sink);\n }\n\n collectDestructuringReads(node, checker, sink, candidateNames);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n};\n", "import { SyntaxKind, isMethodSignature } from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Symbol,\n Type,\n TypeChecker\n} from 'typescript';\n\nimport { addSymbolDeclarations } from './typescript-symbol-reads.ts';\nimport type { ReadSink } from '../common/project-usage.type.ts';\n\nconst isAngularMethodSignature = (declaration: Declaration): boolean => {\n const isMethod = isMethodSignature(declaration);\n\n if (!isMethod) return false;\n\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/');\n};\n\nconst isAngularInterfaceMethod = (symbol: Symbol): boolean => {\n const declarations = symbol.declarations ?? [];\n\n return declarations.some(isAngularMethodSignature);\n};\n\nconst addImplementations = (\n heritageType: Type,\n classType: Type,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n for (const interfaceMethod of heritageType.getProperties()) {\n const isInterfaceMethod = isAngularInterfaceMethod(interfaceMethod);\n\n if (!isInterfaceMethod) continue;\n\n const implementation = classType.getProperty(interfaceMethod.name);\n\n if (implementation) {\n addSymbolDeclarations(checker, implementation, sink);\n }\n }\n};\n\n/**\n * Angular calls lifecycle and forms methods through the interfaces a class\n * implements, so an implementation of one counts as read.\n */\nexport const collectAngularInterfaceMethods = (\n node: ClassLikeDeclaration,\n checker: TypeChecker,\n sink: ReadSink\n): void => {\n const heritageClauses = node.heritageClauses ?? [];\n const implementsClauses = heritageClauses.filter(\n (clause) => clause.token === SyntaxKind.ImplementsKeyword\n );\n\n if (implementsClauses.length === 0) return;\n\n const classType = checker.getTypeAtLocation(node);\n\n for (const clause of implementsClauses) {\n for (const heritageType of clause.types) {\n const type = checker.getTypeAtLocation(heritageType);\n\n sink.addType(type);\n addImplementations(type, classType, checker, sink);\n }\n }\n};\n", "import {\n SymbolFlags,\n isBigIntLiteral,\n isIdentifier,\n isNumericLiteral,\n isPrivateIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { PropertyName, Symbol, Type, TypeChecker } from 'typescript';\n\nimport type { ReadSink } from '../common/project-usage.type.ts';\nimport { symbolsForName } from '../utils/type-property-symbols.util.ts';\n\nconst aliasTarget = (checker: TypeChecker, symbol: Symbol): Symbol => {\n const isAlias = (symbol.flags & SymbolFlags.Alias) !== 0;\n\n if (!isAlias) return symbol;\n\n return checker.getAliasedSymbol(symbol);\n};\n\nexport const addSymbolDeclarations = (\n checker: TypeChecker,\n symbol: Symbol,\n sink: ReadSink\n): void => {\n const resolved = aliasTarget(checker, symbol);\n\n for (const declaration of resolved.declarations ?? []) {\n sink.addDeclaration(declaration);\n }\n};\n\nexport const allPropertySymbols = (\n checker: TypeChecker,\n type: Type\n): Symbol[] => {\n const symbols = new Set(\n checker.getPropertiesOfType(checker.getApparentType(type))\n );\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n for (const symbol of allPropertySymbols(checker, member)) {\n symbols.add(symbol);\n }\n }\n }\n\n return [...symbols];\n};\n\nconst namedPropertySymbols = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null\n): Symbol[] => {\n if (names === null) return allPropertySymbols(checker, type);\n\n return names.flatMap((name) => symbolsForName(checker, type, name));\n};\n\nexport const addNamedProperties = (\n checker: TypeChecker,\n type: Type,\n names: string[] | null,\n sink: ReadSink\n): Symbol[] => {\n sink.addType(type);\n\n const symbols = namedPropertySymbols(checker, type, names);\n\n for (const symbol of symbols) {\n addSymbolDeclarations(checker, symbol, sink);\n }\n\n return symbols;\n};\n\nexport const literalPropertyNames = (type: Type): string[] | null => {\n const isStringLiteral = type.isStringLiteral();\n const isNumberLiteral = type.isNumberLiteral();\n const isLiteralType = isStringLiteral || isNumberLiteral;\n\n if (isLiteralType) return [String(type.value)];\n\n const isUnion = type.isUnion();\n\n if (!isUnion) return null;\n\n const names: string[] = [];\n\n for (const member of type.types) {\n const memberNames = literalPropertyNames(member);\n\n if (!memberNames) return null;\n\n names.push(...memberNames);\n }\n\n return names;\n};\n\nexport const propertyName = (\n checker: TypeChecker,\n node: PropertyName\n): string[] | null => {\n const isIdentifierName = isIdentifier(node);\n const isPrivateName = isPrivateIdentifier(node);\n const isStringName = isStringLiteralLike(node);\n const isNumericName = isNumericLiteral(node);\n const isBigIntName = isBigIntLiteral(node);\n const isLiteralName =\n isIdentifierName ||\n isPrivateName ||\n isStringName ||\n isNumericName ||\n isBigIntName;\n\n if (isLiteralName) return [node.text];\n\n return literalPropertyNames(checker.getTypeAtLocation(node.expression));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isBinaryExpression,\n isBindingElement,\n isObjectLiteralExpression,\n isVariableDeclaration\n} from 'typescript';\nimport type { Node, Type, TypeChecker } from 'typescript';\n\nimport { assignmentPatternElements } from './typescript-assignment-pattern-elements.ts';\nimport {\n bindingPatternElements,\n isBindingPattern\n} from './typescript-binding-pattern-elements.ts';\nimport {\n addNamedProperties,\n addSymbolDeclarations,\n allPropertySymbols\n} from './typescript-symbol-reads.ts';\nimport type {\n CandidateNames,\n DestructuringPattern,\n PatternElementRead,\n ReadSink\n} from '../common/project-usage.type.ts';\n\ntype LazyType = () => Type;\n\ntype PatternReadContext = {\n readonly checker: TypeChecker;\n readonly sink: ReadSink;\n readonly candidateNames: CandidateNames;\n};\n\nconst lazyType = (compute: () => Type): LazyType => {\n let type: Type | undefined;\n\n return () => (type ??= compute());\n};\n\nconst isSkippable = (\n read: PatternElementRead,\n candidateNames: CandidateNames\n): boolean => {\n if (read.nested !== null) return false;\n\n if (read.names === null) return false;\n\n const hasCandidateName = read.names.some((name) => candidateNames.has(name));\n\n return !hasCandidateName;\n};\n\nconst patternElements = (\n pattern: DestructuringPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isBinding = isBindingPattern(pattern);\n\n if (isBinding) return bindingPatternElements(pattern, checker);\n\n return assignmentPatternElements(pattern, checker);\n};\n\nconst addRestReads = (\n type: Type,\n consumed: Set<string>,\n context: PatternReadContext\n): void => {\n context.sink.addType(type);\n\n for (const symbol of allPropertySymbols(context.checker, type)) {\n const isConsumed = consumed.has(symbol.name);\n\n if (isConsumed) continue;\n\n addSymbolDeclarations(context.checker, symbol, context.sink);\n }\n};\n\nconst collectPatternReads = (\n pattern: DestructuringPattern,\n type: LazyType,\n context: PatternReadContext\n): void => {\n const { checker, sink, candidateNames } = context;\n const consumed = new Set<string>();\n const reads = patternElements(pattern, checker);\n\n for (const read of reads) {\n if (read.rest) {\n addRestReads(type(), consumed, context);\n continue;\n }\n\n for (const name of read.names ?? []) {\n consumed.add(name);\n }\n\n const skip = isSkippable(read, candidateNames);\n\n if (skip) continue;\n\n const symbols = addNamedProperties(checker, type(), read.names, sink);\n const nested = read.nested;\n\n if (nested === null) continue;\n\n for (const symbol of symbols) {\n const nestedType = lazyType(() => {\n return checker.getTypeOfSymbolAtLocation(symbol, read.location);\n });\n\n collectPatternReads(nested, nestedType, context);\n }\n }\n};\n\nconst collectBindingReads = (node: Node, context: PatternReadContext): void => {\n const isBinding = isBindingPattern(node);\n\n if (!isBinding) return;\n\n const isBindingElementParent = isBindingElement(node.parent);\n const isNestedBindingName =\n isBindingElementParent && node.parent.name === node;\n\n if (isNestedBindingName) return;\n\n const declaration = node.parent;\n const isDeclaration = isVariableDeclaration(declaration);\n const isInitializedDeclaration =\n isDeclaration && declaration.initializer !== undefined;\n const source = isInitializedDeclaration\n ? declaration.initializer\n : declaration;\n const sourceTypeOf = (): Type => context.checker.getTypeAtLocation(source);\n const sourceType = lazyType(sourceTypeOf);\n\n collectPatternReads(node, sourceType, context);\n};\n\nconst collectAssignmentReads = (\n node: Node,\n context: PatternReadContext\n): void => {\n const isBinary = isBinaryExpression(node);\n\n if (!isBinary) return;\n\n const isEqualsAssignment = node.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (!isEqualsAssignment) return;\n\n const isArrayTarget = isArrayLiteralExpression(node.left);\n const isObjectTarget = isObjectLiteralExpression(node.left);\n const isDestructuringAssignment = isArrayTarget || isObjectTarget;\n\n if (!isDestructuringAssignment) return;\n\n const rightTypeOf = (): Type => context.checker.getTypeAtLocation(node.right);\n const sourceType = lazyType(rightTypeOf);\n\n collectPatternReads(node.left, sourceType, context);\n};\n\nexport const collectDestructuringReads = (\n node: Node,\n checker: TypeChecker,\n sink: ReadSink,\n candidateNames: CandidateNames\n): void => {\n const context: PatternReadContext = { checker, sink, candidateNames };\n\n collectBindingReads(node, context);\n collectAssignmentReads(node, context);\n};\n", "import {\n isArrayLiteralExpression,\n isObjectLiteralExpression,\n isOmittedExpression,\n isPropertyAssignment,\n isSpreadAssignment,\n isSpreadElement\n} from 'typescript';\nimport type {\n Expression,\n ObjectLiteralElementLike,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n AssignmentPattern,\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nconst nestedPattern = (expression: Expression): DestructuringPattern | null => {\n const isArrayLiteral = isArrayLiteralExpression(expression);\n const isObjectLiteral = isObjectLiteralExpression(expression);\n const isNested = isArrayLiteral || isObjectLiteral;\n\n if (!isNested) return null;\n\n return expression;\n};\n\nconst nestedPropertyPattern = (\n property: ObjectLiteralElementLike\n): DestructuringPattern | null => {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) return null;\n\n return nestedPattern(property.initializer);\n};\n\nconst arrayElementRead = (\n element: Expression,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = isSpreadElement(element);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst propertyRead = (\n property: ObjectLiteralElementLike,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestProperty = isSpreadAssignment(property);\n\n if (isRestProperty) {\n const restRead: PatternElementRead = {\n location: property,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: property,\n names: propertyName(checker, property.name),\n nested: nestedPropertyPattern(property),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one destructuring assignment target. */\nexport const assignmentPatternElements = (\n pattern: AssignmentPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayLiteralExpression(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.properties.map((property) => propertyRead(property, checker));\n};\n", "import {\n isArrayBindingPattern,\n isIdentifier,\n isObjectBindingPattern,\n isOmittedExpression\n} from 'typescript';\nimport type {\n ArrayBindingElement,\n BindingElement,\n BindingPattern,\n Node,\n TypeChecker\n} from 'typescript';\n\nimport { propertyName } from './typescript-symbol-reads.ts';\nimport type {\n DestructuringPattern,\n PatternElementRead\n} from '../common/project-usage.type.ts';\n\nexport const isBindingPattern = (node: Node): node is BindingPattern => {\n const isArrayPattern = isArrayBindingPattern(node);\n const isObjectPattern = isObjectBindingPattern(node);\n\n return isArrayPattern || isObjectPattern;\n};\n\nconst nestedPattern = (\n element: BindingElement\n): DestructuringPattern | null => {\n const isNested = isBindingPattern(element.name);\n\n if (!isNested) return null;\n\n return element.name;\n};\n\nconst bindingNames = (\n checker: TypeChecker,\n element: BindingElement\n): string[] | null => {\n if (element.propertyName) return propertyName(checker, element.propertyName);\n\n const isIdentifierName = isIdentifier(element.name);\n\n if (!isIdentifierName) return null;\n\n return [element.name.text];\n};\n\nconst arrayElementRead = (\n element: ArrayBindingElement,\n index: number\n): PatternElementRead | null => {\n const isOmitted = isOmittedExpression(element);\n\n if (isOmitted) return null;\n\n const isRestElement = Boolean(element.dotDotDotToken);\n const indexNames = [String(index)];\n const names = isRestElement ? null : indexNames;\n const nested = nestedPattern(element);\n const read: PatternElementRead = {\n location: element,\n names,\n nested,\n rest: false\n };\n\n return read;\n};\n\nconst objectElementRead = (\n element: BindingElement,\n checker: TypeChecker\n): PatternElementRead => {\n const isRestElement = Boolean(element.dotDotDotToken);\n\n if (isRestElement) {\n const restRead: PatternElementRead = {\n location: element,\n names: null,\n nested: null,\n rest: true\n };\n\n return restRead;\n }\n\n const read: PatternElementRead = {\n location: element,\n names: bindingNames(checker, element),\n nested: nestedPattern(element),\n rest: false\n };\n\n return read;\n};\n\n/** Reads made by every element of one array or object binding pattern. */\nexport const bindingPatternElements = (\n pattern: BindingPattern,\n checker: TypeChecker\n): PatternElementRead[] => {\n const isArrayPattern = isArrayBindingPattern(pattern);\n\n if (isArrayPattern) {\n const reads: PatternElementRead[] = [];\n\n for (const [index, element] of pattern.elements.entries()) {\n const read = arrayElementRead(element, index);\n\n if (read !== null) {\n reads.push(read);\n }\n }\n\n return reads;\n }\n\n return pattern.elements.map((element) => objectElementRead(element, checker));\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isAsExpression,\n isBinaryExpression,\n isDeleteExpression,\n isForInStatement,\n isForOfStatement,\n isNonNullExpression,\n isObjectLiteralExpression,\n isParenthesizedExpression,\n isPropertyAssignment,\n isSatisfiesExpression,\n isSpreadAssignment,\n isTypeAssertionExpression\n} from 'typescript';\nimport type { Expression, Node } from 'typescript';\n\nconst isExpressionWrapper = (parent: Node, child: Node): boolean => {\n const isParenthesized = isParenthesizedExpression(parent);\n const isAs = isAsExpression(parent);\n const isTypeAssertion = isTypeAssertionExpression(parent);\n const isNonNull = isNonNullExpression(parent);\n const isSatisfies = isSatisfiesExpression(parent);\n const isCast = isAs || isTypeAssertion || isSatisfies;\n const isWrapper = isParenthesized || isNonNull || isCast;\n\n if (!isWrapper) return false;\n\n return parent.expression === child;\n};\n\nconst isPatternContainer = (parent: Node, child: Node): boolean => {\n const isArrayLiteral = isArrayLiteralExpression(parent);\n\n if (isArrayLiteral) {\n return parent.elements.some((element) => element === child);\n }\n\n const isObjectLiteral = isObjectLiteralExpression(parent);\n\n if (isObjectLiteral) {\n return parent.properties.some((property) => property === child);\n }\n\n const isAssignment = isPropertyAssignment(parent);\n\n if (isAssignment) return parent.initializer === child;\n\n const isSpread = isSpreadAssignment(parent);\n\n if (!isSpread) return false;\n\n return parent.expression === child;\n};\n\nconst isWriteTarget = (parent: Node, current: Node): boolean => {\n const isBinary = isBinaryExpression(parent);\n const isBinaryTarget =\n isBinary &&\n parent.left === current &&\n parent.operatorToken.kind === SyntaxKind.EqualsToken;\n\n if (isBinaryTarget) return true;\n\n const isDelete = isDeleteExpression(parent);\n const isDeleteTarget = isDelete && parent.expression === current;\n\n if (isDeleteTarget) return true;\n\n const isForIn = isForInStatement(parent);\n const isForOf = isForOfStatement(parent);\n const isIteration = isForIn || isForOf;\n\n return isIteration && parent.initializer === current;\n};\n\n/**\n * True when every use of `node` up through its wrapping expressions and\n * destructuring patterns writes to it rather than reading it.\n */\nexport const isWriteOnly = (node: Expression): boolean => {\n let current: Node = node;\n let parent = node.parent;\n\n while (\n isExpressionWrapper(parent, current) ||\n isPatternContainer(parent, current)\n ) {\n current = parent;\n parent = parent.parent;\n }\n\n return isWriteTarget(parent, current);\n};\n", "import { ObjectFlags, TypeFlags } from 'typescript';\nimport type {\n InterfaceType,\n ObjectType,\n SourceFile,\n Type,\n TypeChecker,\n TypeReference\n} from 'typescript';\n\nconst isObjectType = (type: Type): type is ObjectType => {\n return (type.flags & TypeFlags.Object) !== 0;\n};\n\nconst isTypeReference = (type: ObjectType): type is TypeReference => {\n return (type.objectFlags & ObjectFlags.Reference) !== 0;\n};\n\nconst isInterfaceType = (type: ObjectType): type is InterfaceType => {\n return (type.objectFlags & ObjectFlags.ClassOrInterface) !== 0;\n};\n\nconst addDeclarationFiles = (\n type: Type,\n dependencies: Set<SourceFile>\n): void => {\n for (const symbol of [type.getSymbol(), type.aliasSymbol]) {\n const declarations = symbol?.declarations ?? [];\n\n for (const declaration of declarations) {\n dependencies.add(declaration.getSourceFile());\n }\n }\n};\n\nconst baseTypesOf = (checker: TypeChecker, type: Type): Type[] => {\n const isObject = isObjectType(type);\n\n if (!isObject) return [];\n\n const isReference = isTypeReference(type);\n const target = isReference ? type.target : type;\n const isClassOrInterface = isInterfaceType(target);\n\n if (!isClassOrInterface) return [];\n\n return checker.getBaseTypes(target);\n};\n\nexport const addTypeDependencies = (\n checker: TypeChecker,\n type: Type,\n dependencies: Set<SourceFile>,\n seen: Set<Type>\n): void => {\n const isSeen = seen.has(type);\n\n if (isSeen) return;\n\n seen.add(type);\n\n const isUnionOrIntersection = type.isUnionOrIntersection();\n\n if (isUnionOrIntersection) {\n for (const member of type.types) {\n addTypeDependencies(checker, member, dependencies, seen);\n }\n\n return;\n }\n\n addDeclarationFiles(type, dependencies);\n\n const isTypeParameter = (type.flags & TypeFlags.TypeParameter) !== 0;\n\n if (isTypeParameter) {\n const constraint = checker.getBaseConstraintOfType(type);\n\n if (constraint) {\n addTypeDependencies(checker, constraint, dependencies, seen);\n }\n\n return;\n }\n\n for (const base of baseTypesOf(checker, type)) {\n addTypeDependencies(checker, base, dependencies, seen);\n }\n};\n", "import type { Node, SourceFile, Type, TypeChecker } from 'typescript';\n\nimport { collectAngularTemplateReads } from './angular/angular-template-reads.ts';\nimport type {\n FileEntry,\n ProjectIndex,\n TemplateReads\n} from './common/project-index.type.ts';\nimport type { ReadSink } from './common/project-usage.type.ts';\nimport { collectTypeScriptReads } from './typescript/typescript-reads.ts';\nimport { addTypeDependencies } from './typescript/typescript-type-dependencies.ts';\n\nconst failureText = (error: unknown): string => {\n if (error instanceof Error) return error.message;\n\n return String(error);\n};\n\nconst collectFileReads = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker,\n sink: ReadSink\n): TemplateReads => {\n try {\n collectTypeScriptReads(sourceFile, checker, sink, index.candidateNames);\n\n const classes = index.classes.get(sourceFile.fileName)?.classes ?? [];\n\n return collectAngularTemplateReads({\n allNames: index.candidateNames,\n checker,\n classes,\n directives: index.directives,\n sink\n });\n } catch (error) {\n const errorMessage = failureText(error);\n\n sink.addFallbackNames(\n index.candidateNames,\n `${sourceFile.fileName}: indexing failed (${errorMessage})`\n );\n\n const noTemplateReads: TemplateReads = {\n templateVersions: [],\n usedDirectiveIndex: false\n };\n\n return noTemplateReads;\n }\n};\n\nexport const computeEntry = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: TypeChecker\n): FileEntry => {\n const declarations = new Set<Node>();\n const dependencies = new Set<SourceFile>();\n const fallbackNames = new Set<string>();\n const seenTypes = new Set<Type>();\n const sink: ReadSink = {\n addDeclaration: (declaration) => {\n declarations.add(declaration);\n dependencies.add(declaration.getSourceFile());\n },\n addFallbackNames: (names) => {\n for (const name of names) {\n fallbackNames.add(name);\n }\n },\n addType: (type) => {\n addTypeDependencies(checker, type, dependencies, seenTypes);\n }\n };\n const reads = collectFileReads(index, sourceFile, checker, sink);\n\n dependencies.delete(sourceFile);\n\n const fileEntry: FileEntry = {\n ...reads,\n declarations,\n dependencies,\n fallbackNames,\n sourceFile\n };\n\n return fileEntry;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isCallExpression,\n isClassLike,\n isObjectLiteralExpression\n} from 'typescript';\nimport type {\n CallExpression,\n ClassLikeDeclaration,\n Node,\n ObjectLiteralExpression,\n SourceFile,\n TypeChecker\n} from 'typescript';\n\nimport { scopeOf } from './angular-component-scope.ts';\nimport { angularDecoratorKind } from './angular-decorator-kind.ts';\nimport {\n exportAsOf,\n metadataProperty,\n stringValue,\n templateOf\n} from './angular-metadata-values.ts';\nimport type {\n AngularClass,\n DiscoveredClasses,\n Discovery\n} from '../common/project-usage.type.ts';\n\ntype UndecidedClass = Omit<AngularClass, 'valid'>;\n\nconst describedClass = (\n base: UndecidedClass,\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): AngularClass => {\n const selector = metadataProperty(metadata, 'selector');\n const described = {\n ...base,\n exportAs: exportAsOf(metadata, discovery),\n hostDirectives: metadataProperty(metadata, 'hostDirectives') !== undefined,\n selector: stringValue(selector, discovery)\n };\n\n if (!base.component) {\n const directiveDiscovery: AngularClass = { ...described, valid: true };\n\n return directiveDiscovery;\n }\n\n const fileName = base.declaration.getSourceFile().fileName;\n const template = templateOf(metadata, fileName, discovery);\n const componentDiscovery: AngularClass = {\n ...described,\n scope: scopeOf(metadata, discovery),\n template: template ?? null,\n valid: template !== undefined\n };\n\n return componentDiscovery;\n};\n\nconst decoratedClass = (\n declaration: ClassLikeDeclaration,\n call: CallExpression,\n discovery: Discovery\n): AngularClass | null => {\n const kind = angularDecoratorKind(call.expression, discovery);\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n const component = kind === 'Component';\n const base: UndecidedClass = {\n component,\n declaration,\n exportAs: [],\n hostDirectives: false,\n name: declaration.name?.text ?? '',\n scope: null,\n selector: null,\n template: null\n };\n const metadata = call.arguments.at(0);\n\n if (metadata === undefined) {\n const bareDiscovery: AngularClass = { ...base, valid: !component };\n\n return bareDiscovery;\n }\n\n const isMetadataObject = isObjectLiteralExpression(metadata);\n\n if (!isMetadataObject) {\n const invalidDiscovery: AngularClass = { ...base, valid: false };\n\n return invalidDiscovery;\n }\n\n return describedClass(base, metadata, discovery);\n};\n\nconst angularClass = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): AngularClass | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const found = decoratedClass(declaration, decorator.expression, discovery);\n\n if (found) return found;\n }\n\n return null;\n};\n\n/** Angular components and directives declared in one source file. */\nexport const angularClasses = (\n sourceFile: SourceFile,\n checker: TypeChecker\n): DiscoveredClasses => {\n const classes: AngularClass[] = [];\n const discovery: Discovery = { checker, dependencies: new Set() };\n\n const visit = (node: Node): void => {\n const isClass = isClassLike(node);\n\n if (isClass) {\n const found = angularClass(node, discovery);\n\n if (found) {\n classes.push(found);\n }\n }\n\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n discovery.dependencies.delete(sourceFile);\n\n const discovered: DiscoveredClasses = {\n classes,\n dependencies: discovery.dependencies\n };\n\n return discovered;\n};\n", "import {\n SyntaxKind,\n isArrayLiteralExpression,\n isClassLike,\n isIdentifier,\n isPropertyAccessExpression\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Expression,\n ObjectLiteralExpression,\n Symbol\n} from 'typescript';\n\nimport { classDecoratorKind, resolveAlias } from './angular-decorator-kind.ts';\nimport { metadataProperty } from './angular-metadata-values.ts';\nimport type { Discovery } from '../common/project-usage.type.ts';\n\nconst booleanValue = (node: Expression | undefined): boolean | undefined => {\n if (!node) return undefined;\n\n if (node.kind === SyntaxKind.TrueKeyword) return true;\n\n if (node.kind === SyntaxKind.FalseKeyword) return false;\n\n return undefined;\n};\n\nconst classesOf = (\n symbol: Symbol,\n discovery: Discovery\n): ClassLikeDeclaration[] => {\n const resolved = resolveAlias(symbol, discovery);\n const declarations = resolved.declarations ?? [];\n\n return declarations.filter(isClassLike);\n};\n\nconst scopedClasses = (\n classes: ClassLikeDeclaration[],\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const scoped: ClassLikeDeclaration[] = [];\n\n for (const declaration of classes) {\n if (declaration.getSourceFile().isDeclarationFile) continue;\n\n const kind = classDecoratorKind(declaration, discovery);\n\n if (kind === 'Pipe') continue;\n\n if (kind !== 'Component' && kind !== 'Directive') return null;\n\n scoped.push(declaration);\n }\n\n return scoped;\n};\n\nconst importedClasses = (\n element: Expression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const isIdentifierElement = isIdentifier(element);\n const isPropertyAccessElement = isPropertyAccessExpression(element);\n\n if (!isIdentifierElement && !isPropertyAccessElement) return null;\n\n const target = isIdentifierElement ? element : element.name;\n const symbol = discovery.checker.getSymbolAtLocation(target);\n\n if (!symbol) return null;\n\n const classes = classesOf(symbol, discovery);\n\n if (classes.length === 0) return null;\n\n return scopedClasses(classes, discovery);\n};\n\n/**\n * Resolves a standalone component's `imports` to program classes. Library\n * classes and pipes are skipped; anything that cannot be classified (an\n * NgModule, a spread, a `forwardRef`) makes the scope unknown.\n */\nexport const scopeOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): ClassLikeDeclaration[] | null => {\n const standalone = booleanValue(metadataProperty(metadata, 'standalone'));\n const imports = metadataProperty(metadata, 'imports');\n const isModuleDeclared = standalone === undefined && !imports;\n\n if (standalone === false || isModuleDeclared) return null;\n\n if (!imports) return [];\n\n const isImportsArray = isArrayLiteralExpression(imports);\n\n if (!isImportsArray) return null;\n\n const scope: ClassLikeDeclaration[] = [];\n\n for (const element of imports.elements) {\n const classes = importedClasses(element, discovery);\n\n if (classes === null) return null;\n\n scope.push(...classes);\n }\n\n return scope;\n};\n", "import {\n SymbolFlags,\n canHaveDecorators,\n getDecorators,\n isCallExpression,\n isImportDeclaration,\n isStringLiteralLike\n} from 'typescript';\nimport type {\n ClassLikeDeclaration,\n Declaration,\n Expression,\n Node,\n Symbol\n} from 'typescript';\n\nimport type { DecoratorKind, Discovery } from '../common/project-usage.type.ts';\n\nconst decoratorKinds: DecoratorKind[] = [\n 'Component',\n 'Directive',\n 'NgModule',\n 'Pipe'\n];\n\nconst isDecoratorKind = (name: string): name is DecoratorKind => {\n return decoratorKinds.some((kind) => kind === name);\n};\n\nconst isAngularCoreFile = (declaration: Declaration): boolean => {\n const fileName = declaration.getSourceFile().fileName.replaceAll('\\\\', '/');\n\n return fileName.includes('/node_modules/@angular/core/');\n};\n\nconst parentOf = (node: Node): Node | undefined => {\n return node.parent;\n};\n\nconst importedFromAngularCore = (declaration: Declaration): boolean => {\n let current = parentOf(declaration);\n\n while (current) {\n if (isImportDeclaration(current)) {\n return (\n isStringLiteralLike(current.moduleSpecifier) &&\n current.moduleSpecifier.text === '@angular/core'\n );\n }\n\n current = parentOf(current);\n }\n\n return false;\n};\n\n/**\n * Follows an alias one hop at a time so every re-exporting file on the way\n * to the target becomes a dependency of the discovery result.\n */\nexport const resolveAlias = (symbol: Symbol, discovery: Discovery): Symbol => {\n let current = symbol;\n\n for (let hop = 0; hop < 32; hop += 1) {\n for (const declaration of current.declarations ?? []) {\n discovery.dependencies.add(declaration.getSourceFile());\n }\n\n if ((current.flags & SymbolFlags.Alias) === 0) return current;\n\n const next = discovery.checker.getImmediateAliasedSymbol(current);\n\n if (!next || next === current) return current;\n\n current = next;\n }\n\n return current;\n};\n\nexport const angularDecoratorKind = (\n expression: Expression,\n discovery: Discovery\n): DecoratorKind | null => {\n const unresolved = discovery.checker.getSymbolAtLocation(expression);\n\n if (!unresolved) return null;\n\n const symbol = resolveAlias(unresolved, discovery);\n const name = symbol.getName();\n const isKind = isDecoratorKind(name);\n\n if (!isKind) return null;\n\n const unresolvedDeclarations = unresolved.declarations ?? [];\n const symbolDeclarations = symbol.declarations ?? [];\n const isCoreImport = unresolvedDeclarations.some(importedFromAngularCore);\n const isCoreDeclaration = symbolDeclarations.some(isAngularCoreFile);\n const fromAngularCore = isCoreImport || isCoreDeclaration;\n\n if (!fromAngularCore) return null;\n\n return name;\n};\n\nexport const classDecoratorKind = (\n declaration: ClassLikeDeclaration,\n discovery: Discovery\n): DecoratorKind | null => {\n const hasDecorators = canHaveDecorators(declaration);\n\n if (!hasDecorators) return null;\n\n for (const decorator of getDecorators(declaration) ?? []) {\n const isDecoratorCall = isCallExpression(decorator.expression);\n\n if (!isDecoratorCall) continue;\n\n const kind = angularDecoratorKind(\n decorator.expression.expression,\n discovery\n );\n\n if (kind !== null) return kind;\n }\n\n return null;\n};\n", "import { dirname, resolve } from 'node:path';\n\nimport {\n isIdentifier,\n isNumericLiteral,\n isPropertyAccessExpression,\n isPropertyAssignment,\n isStringLiteralLike\n} from 'typescript';\nimport type { Expression, ObjectLiteralExpression } from 'typescript';\n\nimport { resolveAlias } from './angular-decorator-kind.ts';\nimport type {\n AngularTemplate,\n Discovery\n} from '../common/project-usage.type.ts';\n\n/**\n * The string an expression evaluates to: a literal, or a constant whose\n * type is a single string literal (`const URL = './x.html'`, imported or\n * not). The constant's declaration file becomes a dependency.\n */\nexport const stringValue = (\n node: Expression | undefined,\n discovery: Discovery\n): string | null => {\n if (!node) return null;\n\n const isStringLiteral = isStringLiteralLike(node);\n\n if (isStringLiteral) return node.text;\n\n const isIdentifierNode = isIdentifier(node);\n const isPropertyAccessNode = isPropertyAccessExpression(node);\n\n if (isIdentifierNode || isPropertyAccessNode) {\n const symbol = discovery.checker.getSymbolAtLocation(\n isIdentifier(node) ? node : node.name\n );\n\n if (symbol) {\n resolveAlias(symbol, discovery);\n }\n }\n\n const type = discovery.checker.getTypeAtLocation(node);\n\n return type.isStringLiteral() ? type.value : null;\n};\n\nexport const metadataProperty = (\n metadata: ObjectLiteralExpression,\n name: string\n): Expression | undefined => {\n for (const property of metadata.properties) {\n const isAssignment = isPropertyAssignment(property);\n\n if (!isAssignment) continue;\n\n const isIdentifierName = isIdentifier(property.name);\n const isStringName = isStringLiteralLike(property.name);\n const isNumericName = isNumericLiteral(property.name);\n const isLiteralName = isIdentifierName || isStringName || isNumericName;\n const isPropertyNamed = isLiteralName && property.name.text === name;\n\n if (isPropertyNamed) return property.initializer;\n }\n\n return undefined;\n};\n\nexport const templateOf = (\n metadata: ObjectLiteralExpression,\n fileName: string,\n discovery: Discovery\n): AngularTemplate | null | undefined => {\n const inline = metadataProperty(metadata, 'template');\n\n if (inline) {\n const source = stringValue(inline, discovery);\n\n if (source === null) return undefined;\n\n const inlineTemplate: AngularTemplate = { kind: 'inline', source };\n\n return inlineTemplate;\n }\n\n const url = metadataProperty(metadata, 'templateUrl');\n\n if (url) {\n const text = stringValue(url, discovery);\n\n if (text === null) return undefined;\n\n const externalFileName = resolve(dirname(fileName), text);\n const externalTemplate: AngularTemplate = {\n fileName: externalFileName,\n kind: 'external'\n };\n\n return externalTemplate;\n }\n\n return null;\n};\n\nexport const exportAsOf = (\n metadata: ObjectLiteralExpression,\n discovery: Discovery\n): string[] => {\n const exportAsProperty = metadataProperty(metadata, 'exportAs');\n const exportAs = stringValue(exportAsProperty, discovery) ?? '';\n const names = exportAs.split(',').map((name) => name.trim());\n\n return names.filter(Boolean);\n};\n", "const specFilePattern = /\\.spec\\.[cm]?[tj]sx?$/u;\n\nexport const isSpecFile = (fileName: string): boolean => {\n return specFilePattern.test(fileName);\n};\n", "import type { Program, SourceFile } from 'typescript';\n\nimport { templateFileIsCurrent } from './angular/angular-template-reads.ts';\nimport type {\n FileEntry,\n ProjectIndex,\n SourceFileMaps,\n TemplateFileVersion\n} from './common/project-index.type.ts';\nimport { isSpecFile } from './utils/spec-file.util.ts';\n\nconst typeScriptFilePattern = /\\.(?:[cm]?ts|tsx)$/u;\n\nconst isIndexable = (program: Program, sourceFile: SourceFile): boolean => {\n if (sourceFile.isDeclarationFile) return false;\n\n const isExternal = program.isSourceFileFromExternalLibrary(sourceFile);\n\n if (isExternal) return false;\n\n const isSpec = isSpecFile(sourceFile.fileName);\n\n if (isSpec) return false;\n\n return typeScriptFilePattern.test(sourceFile.fileName);\n};\n\nexport const indexableSourceFiles = (program: Program): SourceFile[] => {\n const sourceFiles = program.getSourceFiles();\n\n return sourceFiles.filter((sourceFile) => isIndexable(program, sourceFile));\n};\n\nexport const sourceFileMaps = (program: Program): SourceFileMaps => {\n const all = new Map<string, SourceFile>();\n const current = new Map<string, SourceFile>();\n\n for (const sourceFile of program.getSourceFiles()) {\n all.set(sourceFile.fileName, sourceFile);\n }\n\n for (const sourceFile of indexableSourceFiles(program)) {\n current.set(sourceFile.fileName, sourceFile);\n }\n\n const maps: SourceFileMaps = { all, current };\n\n return maps;\n};\n\nexport const dropEntries = (\n index: ProjectIndex,\n stale: (entry: FileEntry) => boolean\n): void => {\n for (const [fileName, entry] of index.entries) {\n const isStale = stale(entry);\n\n if (isStale) {\n index.entries.delete(fileName);\n }\n }\n};\n\nexport const isReplaced = (\n sourceFile: SourceFile,\n dependencies: ReadonlySet<SourceFile>,\n maps: SourceFileMaps\n): boolean => {\n const indexedSourceFile = maps.current.get(sourceFile.fileName);\n\n if (indexedSourceFile !== sourceFile) return true;\n\n for (const dependency of dependencies) {\n const indexedDependency = maps.all.get(dependency.fileName);\n\n if (indexedDependency !== dependency) return true;\n }\n\n return false;\n};\n\nexport const dropReplacedEntries = (\n index: ProjectIndex,\n maps: SourceFileMaps\n): void => {\n const isEntryReplaced = (entry: FileEntry): boolean => {\n return isReplaced(entry.sourceFile, entry.dependencies, maps);\n };\n\n dropEntries(index, isEntryReplaced);\n};\n\nexport const dropEntriesMentioning = (\n index: ProjectIndex,\n names: ReadonlySet<string>\n): void => {\n if (names.size === 0) return;\n\n if (index.entries.size === 0) return;\n\n const nameList = [...names];\n const mentionsName = (entry: FileEntry): boolean => {\n return nameList.some((name) => entry.sourceFile.text.includes(name));\n };\n\n dropEntries(index, mentionsName);\n};\n\nconst templateVersionChecker = (): ((\n version: TemplateFileVersion\n) => boolean) => {\n const checked = new Map<string, boolean>();\n\n return (version: TemplateFileVersion): boolean => {\n const key = `${version.fileName}\\0${version.mtimeNs}\\0${version.size}`;\n const known = checked.get(key);\n\n if (known !== undefined) return known;\n\n const current = templateFileIsCurrent(version);\n\n checked.set(key, current);\n\n return current;\n };\n};\n\nexport const dropStaleTemplateEntries = (\n index: ProjectIndex,\n force: boolean\n): void => {\n const now = performance.now();\n const sinceLastCheck = now - index.templateCheckedAt;\n const isThrottled =\n !force && sinceLastCheck < index.templateCheckDuration * 100;\n\n if (isThrottled) return;\n\n const isCurrent = templateVersionChecker();\n const hasStaleTemplate = (entry: FileEntry): boolean => {\n return !entry.templateVersions.every(isCurrent);\n };\n\n dropEntries(index, hasStaleTemplate);\n\n index.templateCheckedAt = now;\n index.templateCheckDuration = performance.now() - now;\n};\n", "import {\n canHaveDecorators,\n forEachChild,\n getDecorators,\n isClassLike,\n isIdentifier,\n isStringLiteralLike\n} from 'typescript';\nimport type { ClassLikeDeclaration, Node, SourceFile } from 'typescript';\n\nconst isDecoratedClass = (node: ClassLikeDeclaration): boolean => {\n const isDecoratable = canHaveDecorators(node);\n\n if (!isDecoratable) return false;\n\n const decorators = getDecorators(node);\n const decoratorCount = decorators?.length ?? 0;\n\n return decoratorCount > 0;\n};\n\nconst addMemberNames = (node: Node, names: Set<string>): void => {\n const isClass = isClassLike(node);\n\n if (!isClass) return;\n\n const isDecorated = isDecoratedClass(node);\n\n if (!isDecorated) return;\n\n for (const member of node.members) {\n if (!member.name) continue;\n\n const isIdentifierName = isIdentifier(member.name);\n const isStringName = isStringLiteralLike(member.name);\n const isNamedMember = isIdentifierName || isStringName;\n\n if (isNamedMember) {\n names.add(member.name.text);\n }\n }\n};\n\n/** Names of members declared by decorated classes in one source file. */\nexport const collectCandidateNames = (sourceFile: SourceFile): Set<string> => {\n const names = new Set<string>();\n\n const visit = (node: Node): void => {\n addMemberNames(node, names);\n forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return names;\n};\n", "import type { SourceFile } from 'typescript';\n\nimport { angularClasses } from './angular/angular-component-discovery.ts';\nimport {\n buildDirectiveIndex,\n directiveShape\n} from './angular/angular-directive-index.ts';\nimport type {\n FileClasses,\n LazyChecker,\n ProjectIndex,\n SourceFileMaps\n} from './common/project-index.type.ts';\nimport { dropEntries, isReplaced } from './project-index-staleness.ts';\nimport { collectCandidateNames } from './typescript/typescript-candidate-names.ts';\n\nconst dropReplacedClasses = (\n index: ProjectIndex,\n maps: SourceFileMaps\n): boolean => {\n let changed = false;\n\n for (const [fileName, fileClasses] of index.classes) {\n const replaced = isReplaced(\n fileClasses.sourceFile,\n fileClasses.dependencies,\n maps\n );\n\n if (!replaced) continue;\n\n index.classes.delete(fileName);\n changed = true;\n }\n\n return changed;\n};\n\nconst addCandidateNames = (\n index: ProjectIndex,\n candidateNames: ReadonlySet<string>,\n newNames: Set<string>\n): void => {\n for (const name of candidateNames) {\n const isKnownName = index.candidateNames.has(name);\n\n if (isKnownName) continue;\n\n index.candidateNames.add(name);\n newNames.add(name);\n }\n};\n\nconst indexFileClasses = (\n index: ProjectIndex,\n sourceFile: SourceFile,\n checker: LazyChecker,\n newNames: Set<string>\n): void => {\n const candidateNames = collectCandidateNames(sourceFile);\n\n addCandidateNames(index, candidateNames, newNames);\n\n const { classes, dependencies } = angularClasses(sourceFile, checker());\n const fileClasses: FileClasses = {\n candidateNames,\n classes,\n dependencies,\n sourceFile\n };\n\n index.classes.set(sourceFile.fileName, fileClasses);\n index.entries.delete(sourceFile.fileName);\n};\n\nconst indexNewClasses = (\n index: ProjectIndex,\n current: ReadonlyMap<string, SourceFile>,\n checker: LazyChecker,\n newNames: Set<string>\n): boolean => {\n let changed = false;\n\n for (const [fileName, sourceFile] of current) {\n const isIndexed = index.classes.has(fileName);\n\n if (isIndexed) continue;\n\n indexFileClasses(index, sourceFile, checker, newNames);\n changed = true;\n }\n\n return changed;\n};\n\nconst rebuildDirectives = (index: ProjectIndex): void => {\n const fileClasses = [...index.classes.values()];\n const classes = fileClasses.flatMap((entry) => entry.classes);\n const shape = directiveShape(classes);\n\n index.directives = buildDirectiveIndex(classes);\n\n if (shape === index.directiveShape) return;\n\n index.directiveShape = shape;\n dropEntries(index, (entry) => entry.usedDirectiveIndex);\n};\n\n/** Re-index changed files' classes; returns member names never seen before. */\nexport const reconcileClasses = (\n index: ProjectIndex,\n maps: SourceFileMaps,\n checker: LazyChecker\n): Set<string> => {\n const newNames = new Set<string>();\n const droppedClasses = dropReplacedClasses(index, maps);\n const addedClasses = indexNewClasses(index, maps.current, checker, newNames);\n const changed = droppedClasses || addedClasses;\n\n if (changed) {\n rebuildDirectives(index);\n }\n\n return newNames;\n};\n", "import type { Program, SourceFile, TypeChecker } from 'typescript';\n\nimport type { LazyChecker, ProjectIndex } from './common/project-index.type.ts';\nimport { computeEntry } from './project-file-entry.ts';\nimport { reconcileClasses } from './project-index-classes.ts';\nimport {\n dropEntriesMentioning,\n dropReplacedEntries,\n dropStaleTemplateEntries,\n indexableSourceFiles,\n sourceFileMaps\n} from './project-index-staleness.ts';\n\nconst lazyChecker = (program: Program): LazyChecker => {\n let typeChecker: TypeChecker | undefined;\n\n return () => (typeChecker ??= program.getTypeChecker());\n};\n\nconst indexMissingEntries = (\n index: ProjectIndex,\n sourceFiles: Iterable<SourceFile>,\n checker: LazyChecker\n): void => {\n for (const sourceFile of sourceFiles) {\n const isEntryIndexed = index.entries.has(sourceFile.fileName);\n\n if (isEntryIndexed) continue;\n\n const entry = computeEntry(index, sourceFile, checker());\n\n index.entries.set(sourceFile.fileName, entry);\n }\n};\n\nconst reindexProgram = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const maps = sourceFileMaps(program);\n\n dropReplacedEntries(index, maps);\n\n const newNames = reconcileClasses(index, maps, checker);\n\n dropEntriesMentioning(index, newNames);\n\n index.program = program;\n index.usage = undefined;\n dropStaleTemplateEntries(index, true);\n indexMissingEntries(index, maps.current.values(), checker);\n};\n\nconst refreshTemplateEntries = (\n index: ProjectIndex,\n program: Program,\n checker: LazyChecker\n): void => {\n const entryCount = index.entries.size;\n\n dropStaleTemplateEntries(index, false);\n\n const isUnchanged = index.entries.size === entryCount;\n\n if (isUnchanged) return;\n\n index.usage = undefined;\n indexMissingEntries(index, indexableSourceFiles(program), checker);\n};\n\nexport const reconcile = (index: ProjectIndex, program: Program): void => {\n const checker = lazyChecker(program);\n const isNewProgram = index.program !== program;\n\n if (isNewProgram) {\n reindexProgram(index, program, checker);\n\n return;\n }\n\n refreshTemplateEntries(index, program, checker);\n};\n", "import { defineConfig } from 'eslint/config';\n\nimport { baseLimits } from './base-limits.ts';\nimport { basePractices } from './base-practices.ts';\nimport { baseRecommended } from './base-recommended.ts';\n\nexport const base = defineConfig([\n ...baseRecommended,\n ...basePractices,\n ...baseLimits\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const baseLimits = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts',\n '**/*.html'\n ],\n rules: {\n 'max-lines': [\n 'error',\n {\n max: 150,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n 'max-lines-per-function': 'off',\n complexity: ['warn', { max: 3 }],\n 'max-lines': [\n 'error',\n {\n max: 300,\n skipBlankLines: true,\n skipComments: true\n }\n ]\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n 'max-classes-per-file': 'off'\n }\n },\n {\n files: ['**/*.state.ts'],\n rules: {\n 'class-methods-use-this': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { MAX_LINE_LENGTH } from './line-length.const.ts';\n\nexport const basePractices = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'no-param-reassign': 'error',\n 'no-alert': 'error',\n 'no-console': ['warn', { allow: ['warn', 'error'] }],\n 'no-debugger': 'error',\n eqeqeq: ['error', 'always', { null: 'ignore' }],\n curly: ['error', 'multi-line'],\n 'prefer-const': ['error', { destructuring: 'all' }],\n 'no-var': 'error',\n 'object-shorthand': 'error',\n 'prefer-arrow-callback': 'error',\n 'no-useless-concat': 'error',\n 'prefer-template': 'error',\n 'no-nested-ternary': 'error',\n 'no-useless-assignment': 'error', // NEW: Catch unused assignments (ESLint v9)\n 'no-object-constructor': 'error', // Disallow new Object() without arguments\n 'no-else-return': ['error', { allowElseIf: false }], // Prefer early returns\n 'no-multi-assign': 'error', // Disallow chaining assignments\n radix: 'error', // Require radix parameter for parseInt()\n yoda: 'error', // Disallow yoda conditions (`if (\"red\" === color)`)\n complexity: ['warn', 10], // Warn if function complexity is high\n 'max-depth': ['warn', 4], // Warn on deeply nested blocks\n 'max-lines-per-function': [\n 'warn',\n { max: 50, skipBlankLines: true, skipComments: true }\n ], // Warn on long functions\n 'max-params': ['warn', 4], // Warn on functions with many parameters\n 'no-lonely-if': 'error', // Disallow if statements as the only statement in an else block\n 'grouped-accessor-pairs': ['error', 'getBeforeSet'], // Enforce consistency for getters/setters\n 'class-methods-use-this': 'error',\n 'no-underscore-dangle': 'error',\n 'max-len': [\n 'error',\n {\n code: MAX_LINE_LENGTH,\n ignoreComments: true\n }\n ],\n 'spaced-comment': [\n 2,\n 'always',\n {\n block: {\n exceptions: ['*']\n }\n }\n ],\n '@stylistic/padding-line-between-statements': [\n 'error',\n {\n blankLine: 'always',\n prev: 'export',\n next: ['export', 'const']\n },\n {\n blankLine: 'always',\n prev: ['const', 'let', 'var'],\n next: '*'\n },\n {\n blankLine: 'any',\n prev: ['const', 'let', 'var'],\n next: ['const', 'let', 'var']\n },\n {\n blankLine: 'always',\n prev: '*',\n next: [\n 'for',\n 'if',\n 'return',\n 'throw',\n 'switch',\n 'try',\n 'class',\n 'function'\n ]\n }\n ],\n '@stylistic/comma-dangle': ['error', 'never'],\n '@stylistic/indent': [\n 'error',\n 2,\n {\n offsetTernaryExpressions: true,\n SwitchCase: 1,\n ignoredNodes: [\n 'TSTypeParameterInstantiation',\n 'FunctionExpression > .params > :matches(Decorator, :not(:first-child))'\n ]\n }\n ],\n 'sort-imports': [\n 'error',\n {\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n allowSeparatedGroups: true\n }\n ]\n }\n }\n]);\n", "export const MAX_LINE_LENGTH = 135;\n", "import { configs } from '@nx/eslint-plugin';\nimport stylistic from '@stylistic/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\n\nexport const baseRecommended = defineConfig([\n { extends: [...configs['flat/base']] },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [importPluginX.flatConfigs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n extends: [stylistic.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport boundariesPlugin from 'eslint-plugin-boundaries';\n\nexport const boundaries = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n boundaries: boundariesPlugin\n },\n settings: {\n 'boundaries/elements': [\n {\n type: 'feature',\n pattern: '**/feature/**'\n },\n {\n type: 'data-access',\n pattern: '**/data-access/**'\n },\n {\n type: 'domain-logic',\n pattern: '**/domain-logic/**'\n },\n {\n type: 'ui',\n pattern: '**/ui/**'\n },\n {\n type: 'common',\n pattern: '**/common/**'\n },\n {\n type: 'utils',\n pattern: '**/utils/**'\n }\n ],\n 'import/resolver': {\n typescript: {\n alwaysTryTypes: true\n }\n }\n },\n rules: {\n ...boundariesPlugin.configs.recommended.rules,\n 'boundaries/dependencies': [\n 'error',\n {\n default: 'disallow',\n message:\n '{{to.element.types}} is not allowed to be imported in {{from.element.types}}',\n policies: [\n {\n from: { element: { type: 'feature' } },\n allow: [\n { to: { element: { type: 'feature' } } },\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'domain-logic' } },\n allow: [\n { to: { element: { type: 'domain-logic' } } },\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'data-access' } },\n allow: [\n { to: { element: { type: 'data-access' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'ui' } },\n allow: [\n { to: { element: { type: 'ui' } } },\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'utils' } },\n allow: [\n { to: { element: { type: 'utils' } } },\n { to: { element: { type: 'common' } } }\n ]\n },\n {\n from: { element: { type: 'common' } },\n allow: [{ to: { element: { type: 'common' } } }]\n }\n ]\n }\n ]\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n 'boundaries/dependencies': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxJavascript: CompatibleConfigArray = configs['flat/javascript'];\n\nexport const javascript = defineConfig({\n files: ['**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],\n extends: nxJavascript\n});\n", "import jsonPlugin from '@eslint/json';\nimport { defineConfig } from 'eslint/config';\n\nexport const json = defineConfig([\n {\n plugins: { json: jsonPlugin }\n },\n {\n files: ['**/*.json'],\n language: 'json/json',\n extends: [jsonPlugin.configs.recommended]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport playwrightEslint from 'eslint-plugin-playwright';\n\nexport const playwright = defineConfig([\n {\n ...playwrightEslint.configs['flat/recommended'],\n files: ['**/*.e2e.ts', '**/*.e2e.js'],\n rules: {\n ...playwrightEslint.configs['flat/recommended'].rules,\n // Locator best practices\n 'playwright/prefer-locator': 'error',\n 'playwright/prefer-native-locators': 'error',\n 'playwright/no-nth-methods': 'warn',\n // Matcher improvements\n 'playwright/prefer-to-be': 'error',\n 'playwright/prefer-to-have-count': 'error',\n 'playwright/prefer-to-have-length': 'error',\n 'playwright/prefer-comparison-matcher': 'error',\n // Test structure\n 'playwright/prefer-hooks-on-top': 'error',\n 'playwright/require-top-level-describe': 'warn'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport eslintConfigPrettier from 'eslint-config-prettier';\n\nexport const prettier = defineConfig([eslintConfigPrettier]);\n", "import rxjsEslint from '@smarttools/eslint-plugin-rxjs';\nimport { defineConfig } from 'eslint/config';\n\nexport const rxjs = defineConfig([\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n extends: [rxjsEslint.configs.recommended]\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n plugins: {\n rxjs: rxjsEslint\n }\n },\n {\n files: [\n '**/*.js',\n '**/*.jsx',\n '**/*.cjs',\n '**/*.mjs',\n '**/*.ts',\n '**/*.tsx',\n '**/*.cts',\n '**/*.mts'\n ],\n rules: {\n 'rxjs/prefer-observer': 'error',\n 'rxjs/finnish': 'warn',\n 'rxjs/no-ignored-subscription': 'warn',\n 'rxjs/no-ignored-error': 'warn',\n 'rxjs/no-unsafe-switchmap': 'error',\n 'rxjs/no-unsafe-takeuntil': 'error',\n 'rxjs/no-unsafe-catch': 'error',\n 'rxjs/no-unsafe-first': 'error',\n 'rxjs/no-topromise': 'error',\n 'rxjs/throw-error': 'error',\n 'rxjs/no-async-subscribe': 'off',\n 'rxjs/no-exposed-subjects': 'error', // Enforce subject encapsulation\n 'rxjs/no-cyclic-action': 'error', // Prevent infinite loops in NgRx effects\n 'rxjs/no-subscribe-handlers': 'warn' // Prefer observer objects (complements prefer-observer)\n }\n },\n {\n files: ['**/*.spec.ts', '**/*.test.ts', '**/*.spec.js', '**/*.test.js'],\n rules: {\n 'rxjs/no-ignored-subscription': 'off',\n 'rxjs/no-subscribe-handlers': 'off'\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport storybookEslint from 'eslint-plugin-storybook';\n\nexport const storybook = defineConfig([\n {\n ignores: ['!.storybook'],\n files: ['**/*.stories.ts'],\n extends: [storybookEslint.configs['flat/recommended']],\n rules: {\n 'storybook/csf-component': 'warn', // Ensure component property is set\n 'storybook/no-stories-of': 'error' // Prevent deprecated storiesOf API\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { typescriptConsistency } from './typescript-consistency.ts';\nimport { typescriptImports } from './typescript-imports.ts';\nimport { typescriptOverrides } from './typescript-overrides.ts';\nimport { typescriptRecommended } from './typescript-recommended.ts';\nimport { typescriptSafety } from './typescript-safety.ts';\n\nexport { localPlugin } from './typescript-local-plugin.ts';\n\nexport const typescript = defineConfig([\n ...typescriptRecommended,\n ...typescriptSafety,\n ...typescriptConsistency,\n ...typescriptImports,\n ...typescriptOverrides\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptConsistency = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': [\n 'error',\n { assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }\n ],\n '@typescript-eslint/consistent-type-definitions': ['error', 'type'],\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n { prefer: 'type-imports', fixStyle: 'separate-type-imports' }\n ],\n '@typescript-eslint/naming-convention': [\n 'error',\n {\n selector: ['objectLiteralProperty', 'objectLiteralMethod'],\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'objectLiteralMethod',\n format: ['camelCase', 'PascalCase']\n },\n {\n selector: 'objectLiteralProperty',\n format: ['camelCase', 'snake_case', 'PascalCase']\n },\n {\n selector: 'parameter',\n format: ['camelCase'],\n leadingUnderscore: 'allow'\n },\n { selector: 'default', format: ['camelCase'] },\n { selector: 'variable', format: ['camelCase', 'UPPER_CASE'] },\n { selector: 'function', format: ['camelCase'] },\n { selector: 'typeLike', format: ['PascalCase'] },\n {\n selector: 'property',\n modifiers: ['requiresQuotes'],\n format: null\n },\n {\n selector: 'property',\n format: ['camelCase', 'PascalCase', 'snake_case']\n }\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\nimport { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript';\n\nconst pathGroups = [\n { pattern: '@angular/**', group: 'builtin', position: 'before' },\n { pattern: '@nestjs/**', group: 'builtin', position: 'before' },\n { pattern: '@shared/**', group: 'internal', position: 'before' },\n { pattern: '@backend/**', group: 'internal', position: 'before' },\n { pattern: '@frontend/**', group: 'internal', position: 'before' },\n { pattern: '@*/shared/**', group: 'internal', position: 'before' },\n { pattern: '@*/frontend/**', group: 'internal', position: 'after' },\n { pattern: '@*/backend/**', group: 'internal', position: 'after' }\n];\n\nexport const typescriptImports = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n rules: {\n 'import-x/order': [\n 'error',\n {\n groups: [\n 'builtin',\n 'external',\n 'internal',\n ['parent', 'sibling'],\n 'index',\n 'unknown'\n ],\n pathGroups,\n pathGroupsExcludedImportTypes: ['builtin'],\n 'newlines-between': 'always',\n alphabetize: { order: 'asc', caseInsensitive: true }\n }\n ],\n // TypeScript already checks these four; import-x would re-parse every import with a parser resolved by name, which fails under pnpm.\n 'import-x/namespace': 'off',\n 'import-x/default': 'off',\n 'import-x/no-named-as-default': 'off',\n 'import-x/no-named-as-default-member': 'off',\n 'import-x/no-unresolved': 'error',\n 'import-x/no-duplicates': 'error',\n 'import-x/prefer-default-export': 'off',\n 'import-x/no-useless-path-segments': ['error', { noUselessIndex: true }],\n 'import-x/newline-after-import': 'error',\n 'import-x/first': 'error',\n 'import-x/no-mutable-exports': 'error',\n 'import-x/no-self-import': 'error',\n 'import-x/no-cycle': ['error', { maxDepth: 2, ignoreExternal: true }],\n 'import-x/consistent-type-specifier-style': ['error', 'prefer-top-level'],\n 'import-x/no-anonymous-default-export': 'error'\n },\n settings: {\n 'import-x/resolver-next': [\n createTypeScriptImportResolver({\n alwaysTryTypes: true\n })\n ]\n }\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nexport const typescriptOverrides = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n languageOptions: {\n parserOptions: {\n projectService: true\n }\n },\n rules: {\n '@typescript-eslint/prefer-readonly': 'error'\n }\n },\n {\n files: ['**/*.action.ts'],\n rules: {\n '@typescript-eslint/no-namespace': 'off',\n '@typescript-eslint/no-extraneous-class': 'off'\n }\n },\n {\n files: [\n '**/*.spec.ts',\n '**/*.test.ts',\n '**/*.spec.js',\n '**/*.test.js',\n '**/*.e2e.ts',\n '**/*.e2e.js'\n ],\n rules: {\n '@typescript-eslint/no-empty-function': 'off',\n '@typescript-eslint/unbound-method': 'off',\n '@typescript-eslint/consistent-type-assertions': 'off'\n }\n },\n {\n files: ['**/*.stories.ts'],\n rules: {\n '@typescript-eslint/consistent-type-assertions': 'off',\n '@typescript-eslint/naming-convention': 'off'\n }\n }\n]);\n", "import { configs } from '@nx/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\nimport importPluginX from 'eslint-plugin-import-x';\nimport type { CompatibleConfigArray } from 'typescript-eslint';\n\nconst nxTypescript: CompatibleConfigArray = configs['flat/typescript'];\n\nexport const typescriptRecommended = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n extends: [importPluginX.flatConfigs.typescript, ...nxTypescript]\n }\n]);\n", "import { defineConfig } from 'eslint/config';\n\nimport { MAX_LINE_LENGTH } from './line-length.const.ts';\nimport { localPlugin } from './typescript-local-plugin.ts';\n\nexport const typescriptSafety = defineConfig([\n {\n files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts'],\n plugins: { local: localPlugin },\n rules: {\n 'local/explicit-accessibility': 'error',\n 'local/readonly-type-properties': 'error',\n 'local/no-inline-object-types': 'error',\n 'local/one-line-guard': ['error', { maxLineLength: MAX_LINE_LENGTH }],\n '@typescript-eslint/explicit-function-return-type': 'error',\n '@typescript-eslint/no-empty-function': 'error',\n '@typescript-eslint/no-unused-vars': 'error',\n '@typescript-eslint/no-use-before-define': 'error',\n '@typescript-eslint/no-explicit-any': 'error',\n '@typescript-eslint/no-unsafe-assignment': 'error',\n '@typescript-eslint/no-unsafe-call': 'error',\n '@typescript-eslint/no-unsafe-member-access': 'error',\n '@typescript-eslint/no-unsafe-return': 'error',\n '@typescript-eslint/no-unsafe-argument': 'error',\n '@typescript-eslint/no-empty-object-type': 'error',\n '@typescript-eslint/no-unsafe-function-type': 'error',\n '@typescript-eslint/no-wrapper-object-types': 'error',\n '@typescript-eslint/explicit-module-boundary-types': 'error',\n '@typescript-eslint/no-non-null-assertion': 'error',\n '@typescript-eslint/prefer-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-optional-chain': 'error',\n '@typescript-eslint/no-floating-promises': [\n 'error',\n { ignoreVoid: true }\n ],\n '@typescript-eslint/no-misused-promises': 'warn',\n '@typescript-eslint/promise-function-async': 'error',\n '@typescript-eslint/await-thenable': 'error',\n '@typescript-eslint/no-inferrable-types': 'warn',\n '@typescript-eslint/no-require-imports': 'error',\n '@typescript-eslint/only-throw-error': 'error',\n '@typescript-eslint/no-array-delete': 'error',\n '@typescript-eslint/return-await': ['error', 'in-try-catch'],\n '@typescript-eslint/require-await': 'error',\n '@typescript-eslint/restrict-template-expressions': [\n 'error',\n { allowNumber: true, allowBoolean: true }\n ],\n '@typescript-eslint/restrict-plus-operands': 'error',\n '@typescript-eslint/prefer-as-const': 'error',\n '@typescript-eslint/no-shadow': 'error',\n '@typescript-eslint/switch-exhaustiveness-check': 'error',\n '@typescript-eslint/no-unused-expressions': [\n 'error',\n { allowShortCircuit: true, allowTernary: true }\n ],\n '@typescript-eslint/no-useless-constructor': 'error',\n '@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],\n '@typescript-eslint/no-unnecessary-condition': 'error',\n '@typescript-eslint/no-confusing-void-expression': [\n 'error',\n { ignoreArrowShorthand: true, ignoreVoidOperator: true }\n ],\n '@typescript-eslint/no-dynamic-delete': 'error',\n '@typescript-eslint/no-extraneous-class': [\n 'error',\n { allowWithDecorator: true }\n ],\n '@typescript-eslint/no-invalid-void-type': 'error',\n '@typescript-eslint/unified-signatures': 'error',\n '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',\n '@typescript-eslint/prefer-find': 'error',\n '@typescript-eslint/prefer-for-of': 'error',\n '@typescript-eslint/prefer-includes': 'error',\n '@typescript-eslint/prefer-string-starts-ends-with': 'error',\n '@typescript-eslint/prefer-regexp-exec': 'error'\n }\n }\n]);\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\nimport {\n accessibilities,\n defaultOptions,\n meta\n} from './common/explicit-accessibility.const.ts';\nimport type {\n Accessibility,\n AutoFix,\n Fix,\n FixAccessibility,\n Member,\n MessageIds,\n Options\n} from './common/explicit-accessibility.type.ts';\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#explicit-accessibility'\n);\n\nconst isPrivateMember = (node: Member): boolean => {\n if (node.type === TSESTree.AST_NODE_TYPES.TSParameterProperty) return false;\n\n return node.key.type === TSESTree.AST_NODE_TYPES.PrivateIdentifier;\n};\n\nconst isConstructor = (node: Member): boolean => {\n if (node.type !== TSESTree.AST_NODE_TYPES.MethodDefinition) return false;\n\n return node.kind === 'constructor';\n};\n\nconst reportTarget = (node: Member): TSESTree.Node => {\n if (node.type !== TSESTree.AST_NODE_TYPES.TSParameterProperty) {\n return node.key;\n }\n\n const { parameter } = node;\n\n if (parameter.type === TSESTree.AST_NODE_TYPES.AssignmentPattern) {\n return parameter.left;\n }\n\n return parameter;\n};\n\nconst memberName = (\n target: TSESTree.Node,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (target.type === TSESTree.AST_NODE_TYPES.Identifier) return target.name;\n\n return sourceCode.getText(target);\n};\n\nconst modifierToken = (\n node: Member,\n sourceCode: TSESLint.SourceCode\n): TSESTree.Token | null => {\n const lastDecorator = node.decorators.at(-1);\n\n if (!lastDecorator) return sourceCode.getFirstToken(node);\n\n return sourceCode.getTokenAfter(lastDecorator);\n};\n\nconst insertModifier = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): Fix => {\n const token = modifierToken(node, sourceCode);\n\n if (!token) return () => null;\n\n const lastDecorator = node.decorators.at(-1);\n const adjacentToDecorator = lastDecorator?.range[1] === token.range[0];\n const text = `${adjacentToDecorator ? ' ' : ''}${accessibility} `;\n\n return (fixer) => fixer.insertTextBefore(token, text);\n};\n\nconst autoFixOf = (\n node: Member,\n accessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): AutoFix => {\n if (accessibility === 'none') {\n const noAutoFix: AutoFix = {};\n\n return noAutoFix;\n }\n\n const fix = insertModifier(node, accessibility, sourceCode);\n const autoFix: AutoFix = { fix };\n\n return autoFix;\n};\n\nconst suggestionOf = (\n node: Member,\n accessibility: Accessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n const data = { accessibility };\n const fix = insertModifier(node, accessibility, sourceCode);\n const suggestion: TSESLint.SuggestionReportDescriptor<MessageIds> = {\n messageId: 'setAccessibility',\n data,\n fix\n };\n\n return suggestion;\n};\n\nconst suggestionsOf = (\n node: Member,\n fixAccessibility: FixAccessibility,\n sourceCode: TSESLint.SourceCode\n): TSESLint.SuggestionReportDescriptor<MessageIds>[] => {\n const isOtherAccessibility = (accessibility: Accessibility): boolean => {\n return accessibility !== fixAccessibility;\n };\n\n const suggestionFor = (\n accessibility: Accessibility\n ): TSESLint.SuggestionReportDescriptor<MessageIds> => {\n return suggestionOf(node, accessibility, sourceCode);\n };\n\n return accessibilities.filter(isOtherAccessibility).map(suggestionFor);\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'explicit-accessibility',\n meta,\n defaultOptions,\n create(context, [{ defaultAccessibility = 'public' }]) {\n const { sourceCode } = context;\n\n const check = (node: Member): void => {\n const isPrivate = isPrivateMember(node);\n\n if (node.accessibility || isPrivate) return;\n\n const target = reportTarget(node);\n const isConstructorMember = isConstructor(node);\n const usesPublic = isConstructorMember && defaultAccessibility !== 'none';\n const fixAccessibility: FixAccessibility = usesPublic\n ? 'public'\n : defaultAccessibility;\n const autoFix = autoFixOf(node, fixAccessibility, sourceCode);\n const name = memberName(target, sourceCode);\n const data = { name };\n const suggest = suggestionsOf(node, fixAccessibility, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: target,\n messageId: 'missingAccessibility',\n data,\n ...autoFix,\n suggest\n };\n\n context.report(report);\n };\n\n const listeners: TSESLint.RuleListener = {\n AccessorProperty: check,\n MethodDefinition: check,\n PropertyDefinition: check,\n TSAbstractAccessorProperty: check,\n TSAbstractMethodDefinition: check,\n TSAbstractPropertyDefinition: check,\n TSParameterProperty: check\n };\n\n return listeners;\n }\n});\n", "import type {\n ESLintUtils,\n JSONSchema,\n TSESLint\n} from '@typescript-eslint/utils';\n\nimport type {\n Accessibility,\n MessageIds,\n Options\n} from './explicit-accessibility.type.ts';\n\nexport const accessibilities: readonly Accessibility[] = [\n 'public',\n 'private',\n 'protected'\n];\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description: 'Require explicit accessibility modifiers on class members'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingAccessibility:\n \"Class member '{{ name }}' is missing an explicit accessibility modifier (public/private/protected).\",\n setAccessibility: \"Add the '{{ accessibility }}' modifier.\"\n};\n\nconst defaultAccessibilitySchema: JSONSchema.JSONSchema4 = {\n type: 'string',\n enum: ['public', 'private', 'protected', 'none'],\n description:\n \"The accessibility modifier inserted by the auto-fix; constructors always get public. 'none' reports without an auto-fix and offers all three levels as suggestions.\"\n};\n\nconst properties: Record<string, JSONSchema.JSONSchema4> = {\n defaultAccessibility: defaultAccessibilitySchema\n};\n\nconst optionsSchema: JSONSchema.JSONSchema4 = {\n type: 'object',\n properties,\n additionalProperties: false\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [optionsSchema];\n\nexport const meta: ESLintUtils.NamedCreateRuleMeta<\n MessageIds,\n unknown,\n Options\n> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n hasSuggestions: true,\n schema,\n messages\n};\n\nexport const defaultOptions: Options = [{ defaultAccessibility: 'public' }];\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'inlineObjectType';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require nested object types inside a type alias to be extracted to a named type alias'\n};\n\nconst messages: Record<MessageIds, string> = {\n inlineObjectType:\n 'Inline object type must be extracted to a named type alias.'\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#no-inline-object-types'\n);\n\nconst enclosingTypeAlias = (\n node: TSESTree.Node\n): TSESTree.TSTypeAliasDeclaration | undefined => {\n let current: TSESTree.Node | undefined = node.parent;\n\n while (current && current.type !== TSESTree.AST_NODE_TYPES.Program) {\n if (current.type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration) {\n return current;\n }\n\n current = current.parent;\n }\n\n return undefined;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'no-inline-object-types',\n meta,\n defaultOptions: [],\n create(context) {\n const listeners: TSESLint.RuleListener = {\n TSTypeLiteral(node): void {\n const isAliasBody =\n node.parent.type === TSESTree.AST_NODE_TYPES.TSTypeAliasDeclaration;\n\n if (isAliasBody) return;\n\n const enclosingAlias = enclosingTypeAlias(node);\n\n if (!enclosingAlias) return;\n\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'inlineObjectType'\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { JSONSchema, TSESLint } from '@typescript-eslint/utils';\n\ntype OneLineGuardOptions = { readonly maxLineLength: number };\ntype Options = [OneLineGuardOptions];\ntype MessageIds = 'oneLineGuard';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require a lone return/throw/continue/break guard to drop its braces when the whole if statement fits on one line'\n};\n\nconst messages: Record<MessageIds, string> = {\n oneLineGuard:\n 'Lone {{ keyword }} guard fits within {{ max }} columns; write it on one line without braces.'\n};\n\nconst schema: JSONSchema.JSONSchema4[] = [\n {\n type: 'object',\n properties: {\n maxLineLength: { type: 'integer', minimum: 1 }\n },\n additionalProperties: false\n }\n];\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n schema,\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#one-line-guard'\n);\n\nconst GUARD_KEYWORDS = new Set([\n TSESTree.AST_NODE_TYPES.ReturnStatement,\n TSESTree.AST_NODE_TYPES.ThrowStatement,\n TSESTree.AST_NODE_TYPES.ContinueStatement,\n TSESTree.AST_NODE_TYPES.BreakStatement\n]);\n\nconst soleStatement = (\n body: TSESTree.Statement\n): TSESTree.Statement | undefined => {\n if (body.type !== TSESTree.AST_NODE_TYPES.BlockStatement) return undefined;\n\n if (body.body.length !== 1) return undefined;\n\n return body.body[0];\n};\n\nconst guardStatement = (\n node: TSESTree.IfStatement\n): TSESTree.Statement | undefined => {\n if (node.alternate) return undefined;\n\n const statement = soleStatement(node.consequent);\n\n if (!statement) return undefined;\n\n const isGuardKeyword = GUARD_KEYWORDS.has(statement.type);\n\n if (!isGuardKeyword) return undefined;\n\n return statement;\n};\n\nconst headText = (\n node: TSESTree.IfStatement,\n sourceCode: TSESLint.SourceCode\n): string => {\n return sourceCode.text\n .slice(node.range[0], node.consequent.range[0])\n .trimEnd();\n};\n\nconst collapsedLine = (\n node: TSESTree.IfStatement,\n head: string,\n bodyText: string,\n sourceCode: TSESLint.SourceCode\n): string => {\n const line = sourceCode.lines[node.loc.start.line - 1] ?? '';\n const prefix = line.slice(0, node.loc.start.column);\n\n return `${prefix}${head} ${bodyText}`;\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'one-line-guard',\n meta,\n defaultOptions: [{ maxLineLength: 80 }],\n create(context, [{ maxLineLength }]) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n IfStatement(node): void {\n const statement = guardStatement(node);\n\n if (!statement) return;\n\n const hasComments =\n sourceCode.getCommentsInside(node.consequent).length > 0;\n\n if (hasComments) return;\n\n const head = headText(node, sourceCode);\n const isMultiLineHead = head.includes('\\n');\n\n if (isMultiLineHead) return;\n\n const bodyText = sourceCode.getText(statement);\n const isMultiLineBody = bodyText.includes('\\n');\n\n if (isMultiLineBody) return;\n\n const collapsed = collapsedLine(node, head, bodyText, sourceCode);\n\n if (collapsed.length > maxLineLength) return;\n\n const [keywordToken] = sourceCode.getTokens(statement);\n\n if (keywordToken === undefined) return;\n\n const keyword = keywordToken.value;\n const data = { keyword, max: maxLineLength };\n const fix: TSESLint.ReportFixFunction = (fixer) =>\n fixer.replaceText(node.consequent, bodyText);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node,\n messageId: 'oneLineGuard',\n data,\n fix\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { ESLintUtils, TSESTree } from '@typescript-eslint/utils';\nimport type { TSESLint } from '@typescript-eslint/utils';\n\ntype Options = [];\ntype MessageIds = 'missingReadonly';\n\nconst docs: TSESLint.RuleMetaDataDocs = {\n description:\n 'Require readonly on primitive-typed type and interface properties'\n};\n\nconst messages: Record<MessageIds, string> = {\n missingReadonly:\n \"Type property '{{ name }}' should be readonly. Disable this rule on the line if mutation is required.\"\n};\n\nconst meta: ESLintUtils.NamedCreateRuleMeta<MessageIds, unknown, Options> = {\n type: 'suggestion',\n docs,\n fixable: 'code',\n schema: [],\n messages\n};\n\nconst createRule = ESLintUtils.RuleCreator(\n () => 'https://github.com/F0rty-Tw0/lint-suite#readonly-type-properties'\n);\n\nconst propertyName = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): string => {\n if (node.key.type === TSESTree.AST_NODE_TYPES.Identifier) {\n return node.key.name;\n }\n\n return sourceCode.getText(node.key);\n};\n\nconst PRIMITIVE_KEYWORDS = new Set([\n TSESTree.AST_NODE_TYPES.TSStringKeyword,\n TSESTree.AST_NODE_TYPES.TSNumberKeyword,\n TSESTree.AST_NODE_TYPES.TSBooleanKeyword,\n TSESTree.AST_NODE_TYPES.TSBigIntKeyword,\n TSESTree.AST_NODE_TYPES.TSSymbolKeyword,\n TSESTree.AST_NODE_TYPES.TSNullKeyword,\n TSESTree.AST_NODE_TYPES.TSUndefinedKeyword\n]);\n\nconst isPrimitive = (type: TSESTree.TypeNode): boolean => {\n const isPrimitiveKeyword = PRIMITIVE_KEYWORDS.has(type.type);\n\n if (isPrimitiveKeyword) return true;\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSLiteralType ||\n type.type === TSESTree.AST_NODE_TYPES.TSTemplateLiteralType\n ) {\n return true;\n }\n\n if (\n type.type === TSESTree.AST_NODE_TYPES.TSUnionType ||\n type.type === TSESTree.AST_NODE_TYPES.TSIntersectionType\n ) {\n return type.types.every(isPrimitive);\n }\n\n return false;\n};\n\nconst readonlyFix = (\n node: TSESTree.TSPropertySignature,\n sourceCode: TSESLint.SourceCode\n): TSESLint.ReportFixFunction => {\n return (fixer) => {\n const firstToken = sourceCode.getFirstToken(node);\n\n if (!firstToken) return null;\n\n return fixer.insertTextBefore(firstToken, 'readonly ');\n };\n};\n\nexport default createRule<Options, MessageIds>({\n name: 'readonly-type-properties',\n meta,\n defaultOptions: [],\n create(context) {\n const { sourceCode } = context;\n\n const listeners: TSESLint.RuleListener = {\n TSPropertySignature(node): void {\n if (node.readonly || !node.typeAnnotation) return;\n\n const isPrimitiveType = isPrimitive(node.typeAnnotation.typeAnnotation);\n\n if (!isPrimitiveType) return;\n\n const name = propertyName(node, sourceCode);\n const data = { name };\n const fix = readonlyFix(node, sourceCode);\n const report: TSESLint.ReportDescriptor<MessageIds> = {\n node: node.key,\n messageId: 'missingReadonly',\n data,\n fix\n };\n\n context.report(report);\n }\n };\n\n return listeners;\n }\n});\n", "import { definePlugin } from './rules/define-plugin.util.ts';\nimport explicitAccessibilityRule from './rules/explicit-accessibility/explicit-accessibility.ts';\nimport noInlineObjectTypesRule from './rules/no-inline-object-types/no-inline-object-types.ts';\nimport oneLineGuardRule from './rules/one-line-guard/one-line-guard.ts';\nimport readonlyTypePropertiesRule from './rules/readonly-type-properties/readonly-type-properties.ts';\n\nexport const localPlugin = definePlugin('local', {\n 'explicit-accessibility': explicitAccessibilityRule,\n 'readonly-type-properties': readonlyTypePropertiesRule,\n 'no-inline-object-types': noInlineObjectTypesRule,\n 'one-line-guard': oneLineGuardRule\n});\n", "import vitestEslint from '@vitest/eslint-plugin';\nimport { defineConfig } from 'eslint/config';\n\nconst vitestPlugin = {\n vitest: vitestEslint\n};\n\nexport const vitest = defineConfig([\n {\n files: ['**/*.spec.ts', '**/*.spec.js', '**/*.test.ts', '**/*.test.js'],\n plugins: vitestPlugin,\n rules: {\n ...vitestEslint.configs.recommended.rules,\n 'vitest/max-nested-describe': ['error', { max: 3 }],\n // Matcher improvements\n 'vitest/prefer-to-be': 'error',\n 'vitest/prefer-to-contain': 'error',\n 'vitest/prefer-to-have-length': 'error',\n 'vitest/prefer-comparison-matcher': 'error',\n 'vitest/prefer-strict-equal': 'warn',\n // Test quality\n 'vitest/prefer-spy-on': 'error',\n 'vitest/prefer-hooks-on-top': 'error',\n 'vitest/prefer-each': 'warn',\n 'vitest/no-test-return-statement': 'error',\n 'vitest/prefer-mock-promise-shorthand': 'error'\n }\n }\n]);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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MAElD,uBAAuB;AAAA,MACvB,4BAA4B;AAAA,MAC5B,gCAAgC;AAAA,MAChC,oCAAoC;AAAA,MACpC,8BAA8B;AAAA;AAAA,MAE9B,wBAAwB;AAAA,MACxB,8BAA8B;AAAA,MAC9B,sBAAsB;AAAA,MACtB,mCAAmC;AAAA,MACnC,wCAAwC;AAAA,IAC1C;AAAA,EACF;AACF,CAAC;;;AhFbM,IAAM,cAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AACL;",
|
|
6
|
+
"names": ["meta", "import_node_fs", "text", "base", "import_node_fs", "import_node_path", "import_node_fs", "import_node_path", "collect", "selectorParser", "import_compiler", "key", "text", "toRegExp", "stylesheets", "import_angular_eslint", "import_config", "import_utils", "import_utils", "isIdentifier", "import_utils", "import_utils", "import_node_path", "import_utils", "import_utils", "metadataValue", "import_compiler", "import_node_fs", "import_compiler", "import_compiler", "parser", "metadataValue", "import_utils", "import_utils", "import_utils", "import_utils", "isDeleteExpression", "import_typescript", "import_compiler", "angularClass", "import_node_fs", "import_typescript", "import_compiler", "import_typescript", "import_typescript", "import_compiler", "ReadCollector", "import_compiler", "text", "templateBinder", "angularClass", "ReadCollector", "templateReads", "angularClass", "templateReads", "import_typescript", "import_typescript", "import_typescript", "memberNames", "propertyName", "import_typescript", "import_typescript", "propertyName", "import_typescript", "nestedPattern", "propertyName", "arrayElementRead", "import_typescript", "isWriteOnly", "isWriteTarget", "isWriteOnly", "import_typescript", "base", "fileEntry", "import_typescript", "import_typescript", "import_typescript", "parentOf", "import_node_path", "import_typescript", "text", "base", "key", "import_typescript", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "ruleDefaults", "defaultOptions", "createRule", "globals", "import_config", "import_config", "import_config", "import_eslint_plugin", "import_config", "importPluginX", "stylistic", "import_config", "boundariesPlugin", "import_eslint_plugin", "import_config", "import_config", "jsonPlugin", "import_config", "playwrightEslint", "import_config", "eslintConfigPrettier", "import_config", "rxjsEslint", "import_config", "storybookEslint", "import_config", "import_config", "import_config", "import_config", "import_eslint_plugin", "import_config", "import_eslint_plugin_import_x", "importPluginX", "import_config", "import_utils", "docs", "messages", "properties", "optionsSchema", "schema", "meta", "defaultOptions", "createRule", "memberName", "text", "meta", "defaultOptions", "import_utils", "docs", "messages", "meta", "createRule", "import_utils", "docs", "messages", "schema", "meta", "createRule", "import_utils", "docs", "messages", "meta", "createRule", "propertyName", "import_eslint_plugin", "import_config", "vitestEslint"]
|
|
7
7
|
}
|