Skip to content

feat(eslint-plugin-template): add rule prefer-static-string-properties #2228

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

reduckted
Copy link
Contributor

Fixes #1172

This new rule will detect this:

<my-component [name]="'foo'"/>

and fix it by changing it to this:

<my-component name="foo"/>

Copy link

nx-cloud bot commented Feb 2, 2025

View your CI Pipeline Execution ↗ for commit 8687ab8.

Command Status Duration Result
nx run-many -t e2e-suite --parallel 1 ✅ Succeeded 23s View ↗
nx run-many -t test --codeCoverage ✅ Succeeded 1m 27s View ↗
nx run-many -t build,typecheck,check-rule-docs,... ✅ Succeeded 1m 3s 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 46s View ↗
nx run-many -t build ✅ Succeeded 26s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-02 11:12:35 UTC

@reduckted reduckted force-pushed the feature/prefer-static-string-properties branch from db845cd to 8687ab8 Compare February 2, 2025 11:09
Copy link

codecov bot commented Feb 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.51%. Comparing base (3475d1c) to head (8687ab8).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2228      +/-   ##
==========================================
+ Coverage   90.44%   90.51%   +0.06%     
==========================================
  Files         177      179       +2     
  Lines        3527     3553      +26     
  Branches      593      597       +4     
==========================================
+ Hits         3190     3216      +26     
  Misses        183      183              
  Partials      154      154              
Flag Coverage Δ
unittest 90.51% <100.00%> (+0.06%) ⬆️

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/index.ts 66.12% <100.00%> (+0.55%) ⬆️
...plate/src/rules/prefer-static-string-properties.ts 100.00% <100.00%> (ø)
...sts/rules/prefer-static-string-properties/cases.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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.

Awesome, thanks as always @reduckted! I'll cut a release with this in shortly

@JamesHenry JamesHenry merged commit 8ae541c into angular-eslint:main Feb 8, 2025
8 checks passed
@reduckted reduckted deleted the feature/prefer-static-string-properties branch February 8, 2025 22:20
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.

Rule Proposal: prefer-static-string-properties
2 participants