Skip to content

feat(eslint-plugin): add rules to ban experimental and developer preview #2037

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

json-derulo
Copy link
Contributor

@json-derulo json-derulo commented Sep 13, 2024

Closes #2305

Current status:

  • Coverage of new code is below 90% which fails the checks, however the uncovered lines marked by the tool seem strange
  • When importing and using a constant from an external file, currently there is no error raised, but it should

Copy link

nx-cloud bot commented Sep 13, 2024

View your CI Pipeline Execution ↗ for commit c29c048.

Command Status Duration Result
nx run-many -t e2e-suite --parallel 1 ✅ Succeeded 22s View ↗
nx run-many -t test --codeCoverage ✅ Succeeded 1m 7s View ↗
nx run-many -t build,typecheck,check-rule-docs,... ✅ Succeeded 45s View ↗
nx-cloud record -- pnpm nx sync:check ✅ Succeeded 2s View ↗
nx-cloud record -- pnpm format-check ✅ Succeeded 6s View ↗
nx run-many -t test ✅ Succeeded 56s View ↗
nx run-many -t build ✅ Succeeded 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-16 10:48:30 UTC

@json-derulo json-derulo force-pushed the no-experimental-dev-preview branch from 2502f55 to 8b8c540 Compare September 13, 2024 17:23
@JamesHenry
Copy link
Member

@json-derulo I pushed a commit which facilitates the type checked rule tests

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.79%. Comparing base (aa72e02) to head (c29c048).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2037      +/-   ##
==========================================
+ Coverage   92.62%   92.79%   +0.17%     
==========================================
  Files         202      207       +5     
  Lines        4272     4374     +102     
  Branches     1002     1020      +18     
==========================================
+ Hits         3957     4059     +102     
  Misses        245      245              
  Partials       70       70              
Flag Coverage Δ
unittest 92.79% <100.00%> (+0.17%) ⬆️

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%> (ø)
...es/eslint-plugin/src/rules/no-developer-preview.ts 100.00% <100.00%> (ø)
...ackages/eslint-plugin/src/rules/no-experimental.ts 100.00% <100.00%> (ø)
packages/eslint-plugin/src/utils/jsdoc.ts 100.00% <100.00%> (ø)
...t-plugin/tests/rules/no-developer-preview/cases.ts 100.00% <100.00%> (ø)
...eslint-plugin/tests/rules/no-experimental/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.

@json-derulo json-derulo force-pushed the no-experimental-dev-preview branch 15 times, most recently from 0a5d5a4 to dc80fb8 Compare November 26, 2024 20:01
@pumano
Copy link
Contributor

pumano commented Nov 29, 2024

Very useful rules

@JamesHenry
Copy link
Member

@json-derulo Do you have any plans to continue working on these please?

@json-derulo
Copy link
Contributor Author

@JamesHenry yes I am planning to continue work on this PR, probably it will take a few weeks though because at the moment I have limited availability.

What's not working currently is that for some reason the annotated code is not always detected when imported from an external file, which I found while implementing the tests. Also, the code coverage is marked as insufficient, however the uncovered lines reported by the tool look strange.

@joepvl
Copy link

joepvl commented May 21, 2025

Any traction on this?

@zargham-leanix
Copy link

This would tremendously help us manage usage of experimental apis, really looking forward to it.

@json-derulo json-derulo force-pushed the no-experimental-dev-preview branch from dc80fb8 to a7d96fa Compare June 13, 2025 17:58
@json-derulo
Copy link
Contributor Author

json-derulo commented Jun 13, 2025

Addressed the issue with the imported constants, it now works correctly. I have tested the new rules in an Angular 20 project - usages of provideZonelessChangeDetection(), resource() / httpResource(), ResourceOptions and ResourceStatus are correctly detected.

Also Codecov now seems to be much happier about the changes and no longer fails.

CC @JamesHenry

@json-derulo json-derulo marked this pull request as ready for review June 13, 2025 18:05
@json-derulo json-derulo force-pushed the no-experimental-dev-preview branch from a7d96fa to 0bb93c3 Compare June 13, 2025 19:16
@JamesHenry JamesHenry force-pushed the no-experimental-dev-preview branch from 0bb93c3 to c29c048 Compare June 16, 2025 10:44
@JamesHenry
Copy link
Member

Thanks a lot @json-derulo, I rebased against the latest

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.

Thank you!

@JamesHenry JamesHenry merged commit 41bcafc into angular-eslint:main Jun 16, 2025
9 checks passed
@json-derulo json-derulo deleted the no-experimental-dev-preview branch June 17, 2025 17:29
joepvl pushed a commit to joepvl/angular-eslint that referenced this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants