Skip to content

Conversation

bradkovach
Copy link

The recommended config crashes eslint due to an issue with undefined property detection/testing.

The intended behavior of hasOwnProperty only seems to work when a property is explicitly set as undefined. When values are implicitly set. This behavior is consistent with Object.hasOwn, object.hasOwnProperty and 'property' in object.

Here is a TS Playground demonstrating this behavior.

Only if(obj.typeAnnotation) and !!obj.typeAnnotation both consistently return false.

The easiest way to check for a typeAnnotation at this branch is to simply check for truthiness with if(param.typeAnnotation), which I have implemented in this PR.

Fixes #122

@zilia-gmethot
Copy link

What is preventing this pull request from being merged?

@Samuel-Therrien-Beslogic
Copy link

Samuel-Therrien-Beslogic commented Oct 8, 2024

@zilia-gmethot The maintainer, @cartant , hasn't been active on any of their public repos. Not to shame, life happens and this is volunteer work. But maybe worth looking into forking, adopting the project, or suggesting the rules to other maintained ESLint community projects.

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

Successfully merging this pull request may close these issues.

no-implicit-any-catch throws an error
3 participants