Skip to content

fix(prefer-static-string-properties): exclude special attributes #2273

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

Conversation

mbriand-lucca
Copy link
Contributor

@mbriand-lucca mbriand-lucca commented Feb 28, 2025

Exclude some attributes :

<my-component *ngSwitchCase="'foo'" />
<my-component [style.color]="'foo'" />
<my-component [attr.aria-label]="'foo'" />
<my-component [@fade]="'foo'" />
<my-component [class.foo]="'foo'" />

fixes: #2265

Copy link

nx-cloud bot commented Feb 28, 2025

View your CI Pipeline Execution ↗ for commit 2ef7d81.

Command Status Duration Result
nx run-many -t e2e-suite --parallel 1 ✅ Succeeded 38s View ↗
nx run-many -t test --codeCoverage ✅ Succeeded 1m 26s View ↗
nx run-many -t build,typecheck,check-rule-docs,... ✅ Succeeded 55s View ↗
nx-cloud record -- pnpm nx sync:check ✅ Succeeded 4s View ↗
nx-cloud record -- pnpm format-check ✅ Succeeded 5s View ↗
nx run-many -t test ✅ Succeeded 23s View ↗
nx run-many -t build ✅ Succeeded 11s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-28 14:33:17 UTC

@mbriand-lucca
Copy link
Contributor Author

If anyone has a better solution, feel free to share... I haven't found anything better.

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.26%. Comparing base (c6d6457) to head (2ef7d81).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2273   +/-   ##
=======================================
  Coverage   92.26%   92.26%           
=======================================
  Files         179      179           
  Lines        3334     3334           
  Branches      678      679    +1     
=======================================
  Hits         3076     3076           
  Misses        200      200           
  Partials       58       58           
Flag Coverage Δ
unittest 92.26% <100.00%> (ø)

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

Files with missing lines Coverage Δ
...plate/src/rules/prefer-static-string-properties.ts 100.00% <100.00%> (ø)
...sts/rules/prefer-static-string-properties/cases.ts 100.00% <ø> (ø)

@JamesHenry JamesHenry merged commit 40d9783 into angular-eslint:main Mar 2, 2025
15 checks passed
@JamesHenry
Copy link
Member

Thanks again @mbriand-lucca, unfortunately I didn't spot the commit/PR scope until too late, but this should have been fix(eslint-plugin-template): [prefix-static-string-properties] exclude special attributes based on our existing conventions and CHANGELOGs.

I'll try and get around to adding some tooling to prevent this in future

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.

[@angular-eslint/template/prefer-static-string-properties] The rule replaces where it is not needed
2 participants