Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(eslint-plugin): add rule prefer-output-emitter-ref #2324

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 #2258

This adds a new rule to the eslint-plugin called prefer-output-emitter-ref. There are two problems that this will detect

  1. It will report a problem when an @Output decorator is used. This is not fixable since doing so would be quite complicated. There's also an Angular migration (feat(core): initial version of the output migration angular/angular#57604), so it's simpler to just use the migration.

  2. It will report a problem if an OutputEmitterRef property in a component or decorator is not read-only. This is fixable.

Copy link

nx-cloud bot commented Mar 16, 2025

View your CI Pipeline Execution ↗ for commit fd27147.

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

☁️ Nx Cloud last updated this comment at 2025-03-23 00:56:51 UTC

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.

Seems like a lot of overlap with @angular-eslint/prefer-output-readonly?

@reduckted
Copy link
Contributor Author

🤦‍♂️ I forgot that prefer-output-readonly checked OutputEmitterRef properties and thought it only looked at @Output decorators. I'll remove the read-only checks.

Copy link

codecov bot commented Mar 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.56%. Comparing base (8303144) to head (fd27147).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2324      +/-   ##
==========================================
+ Coverage   92.53%   92.56%   +0.02%     
==========================================
  Files         184      186       +2     
  Lines        3726     3737      +11     
  Branches      836      836              
==========================================
+ Hits         3448     3459      +11     
  Misses        215      215              
  Partials       63       63              
Flag Coverage Δ
unittest 92.56% <100.00%> (+0.02%) ⬆️

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

Files with missing lines Coverage Δ
packages/eslint-plugin/src/index.ts 100.00% <100.00%> (ø)
...lint-plugin/src/rules/prefer-output-emitter-ref.ts 100.00% <100.00%> (ø)
...gin/tests/rules/prefer-output-emitter-ref/cases.ts 100.00% <100.00%> (ø)
🚀 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.

@reduckted reduckted requested a review from JamesHenry March 29, 2025 00:45
@JamesHenry JamesHenry merged commit f03d7ee into angular-eslint:main Apr 8, 2025
7 checks passed
@JamesHenry
Copy link
Member

Thank you!

@reduckted reduckted deleted the feature/2258-prefer-output-emitter-ref branch April 8, 2025 21:06
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.

[prefer-signals] add option for preferOutputSignal
2 participants