timdeschryver / eslint-plugin-ngrx

Other
140 stars 16 forks source link

Somewhat false error with use-selector-in-select #135

Closed DaSchTour closed 3 years ago

DaSchTour commented 3 years ago

First of all thanks for the great plugin. It helps a lot with improving handling of NGRX. I have somewhat of an edgecase that gives a false warning for the use-selector-in-select rule.

When using a static string as a prop for another selector it is reported like beeing a selector. For example having something like this this.store.select(hasAuthorization, 'ADMIN') triggers this rule, although the string is not used as a selector. And creating static selectors for all the different Authorizations would me extrem overkill.

It would be great if this rule would check if the first parameter is already a selector or something like this. Thanks

timdeschryver commented 3 years ago

Thanks for creating this issue @DaSchTour. Just as an fyi, selectors with props will be deprecated in v12 in factor of factory selectors.

DaSchTour commented 3 years ago

Oh boy, next big refactoring 😄 thanks for the information. So maybe an eslint rule to identify these selectors would also be helpful. At first glance I have a lot of them. And they are not always easy to spot.

timdeschryver commented 3 years ago

Once v12 lands, ESLint will complain about the deprecated selector (I think, or it could be a rule). If I'm mistaken, there will be a new lint rule for it 🙃

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.21.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: