productboardlabs / tslint-pb

📄 (DEPRECATED) Our own custom TSlint rules. What has been seen, cannot be unseen.
MIT License
5 stars 0 forks source link

Add rule: No optional parameter in selectors #65

Closed omackaj closed 4 years ago

omackaj commented 4 years ago

Selectors containing optional parameter i.e.: hello?: string throws an error. It happens when memoized function was called with a different number of parameters than currently called instance.

jukben commented 4 years ago

Thanks a lot! Great finding! The idea is thus forbid it by rule as a extension of https://github.com/productboardlabs/tslint-pb#selectors-format

Is it something what makes sense for you as well @Aldredcz?

Aldredcz commented 4 years ago

Yea, definitely :)

Aldredcz commented 4 years ago

Related: https://github.com/productboard/pb-frontend/pull/7480#pullrequestreview-385376735

Selectors containing optional parameter i.e.: title?: string throws an error. It happens when memoized function was called with a different number of parameters than currently called instance.