Skip to content
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

feat(eslint-plugin-template): [i18n] add allowMarkupInContent option #1795

Merged
merged 3 commits into from
May 22, 2024

Conversation

m-akinc
Copy link
Contributor

@m-akinc m-akinc commented May 1, 2024

Fixes #930

Added allowMarkupInContent option for i18n rule. Option defaults to true to maintain backwards compatibility. Setting to false causes rule violation whenever an element with the i18n attribute has HTML markup in its content.

Note that due to the way the AST parser handles ICUs (i.e. it escapes any markup in cases so that they are strings), we cannot report violations for markup inside the ICU cases.

@m-akinc
Copy link
Contributor Author

m-akinc commented May 15, 2024

@JamesHenry There haven't been any comments or review since I put this up a couple weeks ago. Just wanted to ping someone to make sure it isn't overlooked.

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.

Thanks @m-akinc!

I would prefer it if no existing tests were modified by this PR to prove that this change is backwards compatible. Please can you make the necessary updates?

@m-akinc m-akinc requested a review from JamesHenry May 21, 2024 21:18
Copy link

nx-cloud bot commented May 22, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 7db729b. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 6 targets

Sent with 💌 from NxCloud.

Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.43%. Comparing base (977f0b9) to head (7db729b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1795      +/-   ##
==========================================
- Coverage   90.47%   90.43%   -0.04%     
==========================================
  Files         178      178              
  Lines        3361     3368       +7     
  Branches      540      542       +2     
==========================================
+ Hits         3041     3046       +5     
- Misses        185      186       +1     
- Partials      135      136       +1     
Flag Coverage Δ
unittest 90.43% <100.00%> (-0.04%) ⬇️

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

Files Coverage Δ
packages/eslint-plugin-template/src/rules/i18n.ts 91.66% <100.00%> (-1.20%) ⬇️
...s/eslint-plugin-template/tests/rules/i18n/cases.ts 100.00% <100.00%> (ø)

@JamesHenry JamesHenry merged commit bb8470d into angular-eslint:main May 22, 2024
7 checks passed
@JamesHenry
Copy link
Member

Thank you @m-akinc!

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.

[i18n] option to check content of tag with i18n
2 participants