Skip to content

fix(eslint-plugin-template): correct column adjustment for inline template message locations #2358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

reduckted
Copy link
Contributor

Fixes #2356

The problem was that the column and endColumn were not being adjusted when transforming the message locations from being within the inline template string to being within the full code file that the inline template was in. Not adjusting the columns is the correct thing to do for anything but the first line, because the second and subsequent lines always start at column 1, while the first line starts wherever the string starts on that line, plus one character for the opening quote.

Copy link

nx-cloud bot commented Apr 9, 2025

View your CI Pipeline Execution ↗ for commit 71fd02b.

Command Status Duration Result
nx run-many -t e2e-suite --parallel 1 ✅ Succeeded 48s View ↗
nx run-many -t test --codeCoverage ✅ Succeeded 59s View ↗
nx run-many -t build,typecheck,check-rule-docs,... ✅ Succeeded 1m 4s View ↗
nx-cloud record -- pnpm nx sync:check ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm format-check ✅ Succeeded 6s View ↗
nx run-many -t test ✅ Succeeded 28s View ↗
nx run-many -t build ✅ Succeeded 18s View ↗

☁️ Nx Cloud last updated this comment at 2025-04-09 11:57:26 UTC

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.59%. Comparing base (ff265d2) to head (71fd02b).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2358   +/-   ##
=======================================
  Coverage   92.59%   92.59%           
=======================================
  Files         186      186           
  Lines        3752     3756    +4     
  Branches      840      842    +2     
=======================================
+ Hits         3474     3478    +4     
  Misses        215      215           
  Partials       63       63           
Flag Coverage Δ
unittest 92.59% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/eslint-plugin-template/src/processors.ts 83.80% <100.00%> (+0.64%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@JamesHenry JamesHenry merged commit 7bcdb56 into angular-eslint:main Apr 9, 2025
7 checks passed
@reduckted reduckted deleted the bugfix/2356-location-info branch April 9, 2025 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Processors: location information for single line inline templates is incorrect
2 participants