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

@ngrx/eslint-plugin: Add rule for custom SignalStore features with static input #4438

Closed
1 of 2 tasks
markostanimirovic opened this issue Jul 18, 2024 · 0 comments · Fixed by #4454
Closed
1 of 2 tasks

Comments

@markostanimirovic
Copy link
Member

Which @ngrx/* package(s) are relevant/related to the feature request?

eslint-plugin

Information

The ESLint rule should detect the following cases as valid/invalid:

const withX = <Y>() => signalStoreFeature({ state: type<{ y: Y }>() }, withState({})); // ✅

const withX = <Y>() => signalStoreFeature(type<{ state: { y: Y } }>(), withState({})); // ✅

const withX = <_>() => signalStoreFeature({ state: type<{ y: number }>() }, withState({})); // ✅

const withX = <_>() => signalStoreFeature(type<{ state: { y: number } }>(), withState({})); // ✅

const withX = signalStoreFeature({ state: type<{ y: number }>() }, withState({})); // ❌

const withX = signalStoreFeature(type<{ state: { y: number } }>(), withState({})); // ❌

const withX = () => signalStoreFeature({ state: type<{ y: number }>() }, withState({})); // ❌

const withX = () => signalStoreFeature(type<{ state: { y: number } }>(), withState({})); // ❌

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants