ngrx/platform

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

markostanimirovic opened this issue · 0 comments

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