angular/packages/compiler-cli/test/ngtsc
JoostK 4d9c4567ed fix(compiler-cli): ensure component import diagnostics are reported within the imports expression
PR #60455 improved error reporting for `@Component.imports` by scoping the diagnostic to an individual
element within the `imports` array, but this may introduce hard to track diagnostics when it ends
up being reported (far) away from the component itself.

This can be even more problematic when the diagnostic would end up being reported in a declaration file,
as happened in issue #65686; the declaration files of an imported library contained syntax that the
static interpreter did not support, hence the `@Component.imports` was rejected with a diagnostic reported
in the library's declaration file. This diagnostic isn't guaranteed to be reported (e.g. the CLI only
gathers Angular-specific diagnostics for Angular-compiled files, which excludes declaration files).

This commit changes the diagnostic location to ensure it is being reported within the `@Component.imports`
expression, in most cases retaining the desirable effect of #60455 while avoiding out-of-band diagnostics.

(cherry picked from commit 106ba63650)
2026-01-02 08:21:12 +01:00
..
doc_extraction refactor(core): add dedicated deprecated signatures for providedIn: any / NgModule. 2025-12-09 10:38:14 -08:00
attach_source_location_spec.ts refactor(compiler): produce DOM-only instructions (#62096) 2025-06-23 14:24:09 +02:00
authoring_diagnostics_spec.ts refactor(compiler-cli): Add a diagnostic to detect forbiden invocations of required initializers (#63614) 2025-09-15 19:34:32 +00:00
authoring_inputs_spec.ts fix(compiler-cli): capture metadata for undecorated fields (#63957) 2025-10-09 14:02:16 -04:00
authoring_models_spec.ts fix(compiler-cli): capture metadata for undecorated fields (#63957) 2025-10-09 14:02:16 -04:00
authoring_outputs_spec.ts fix(compiler-cli): capture metadata for undecorated fields (#63957) 2025-10-09 14:02:16 -04:00
authoring_queries_spec.ts perf(compiler): chain query creation instructions 2025-12-09 09:24:41 -08:00
BUILD.bazel refactor(compiler-cli): allow the forms module to be loaded in tests 2025-11-05 09:35:50 -08:00
component_indexing_spec.ts build: migrate packages/compiler-cli to ts_project (#61826) 2025-06-03 11:41:52 +02:00
debug_transform_spec.ts fix(compiler-cli): avoid allocating an object for signals in production mode 2025-12-02 15:06:55 +01:00
declaration_only_emission_spec.ts fix(compiler-cli): disallow compiling with the emitDeclarationOnly TS compiler option enabled (#61609) 2025-08-14 13:03:54 +02:00
defer_spec.ts refactor(compiler-cli): type check viewport trigger options (#64130) 2025-10-09 05:32:20 -07:00
env.ts refactor(compiler-cli): add a resource debugName transform (#64172) 2025-11-24 11:30:13 -05:00
extended_template_diagnostics_spec.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
hmr_spec.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
host_bindings_type_check_spec.ts feat(compiler-cli): enable type checking of host bindings by default (#63654) 2025-09-09 14:34:29 -07:00
host_directives_spec.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
imports_spec.ts fix(compiler-cli): support relative imports to symbols outside rootDir (#60555) 2025-03-26 20:45:55 -07:00
incremental_error_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
incremental_semantic_changes_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
incremental_spec.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
incremental_typecheck_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
local_compilation_spec.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
ls_typecheck_helpers_spec.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
monorepo_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
ngtsc_spec.ts fix(compiler-cli): ensure component import diagnostics are reported within the imports expression 2026-01-02 08:21:12 +01:00
scope_spec.ts refactor(compiler-cli): Migrate manually ngtsc tests to standalone by default (#58160) 2024-10-14 14:58:58 +00:00
selectorless_spec.ts build: update to the TypeScript 5.9 RC (#62815) 2025-07-25 13:39:12 +02:00
signal_forms_spec.ts fix(compiler-cli): expand type for native controls with a dynamic type 2025-12-09 13:01:35 -08:00
sourcemap_utils.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
standalone_spec.ts refactor: clean up explicit standalone flags from tests (#63963) 2025-09-22 14:27:34 +00:00
template_mapping_spec.ts refactor: various build and import specificer fixes for strict deps (#63323) 2025-08-22 14:45:00 -07:00
template_typecheck_spec.ts refactor(compiler): Improve pipe in track expression error (#64321) 2025-10-13 08:59:56 -07:00
util.ts refactor(compiler-cli): convert scripts within packages/compiler-cli to relative imports (#60625) 2025-04-01 11:57:53 +00:00
xi18n_spec.ts refactor: various build and import specificer fixes for strict deps (#63323) 2025-08-22 14:45:00 -07:00