Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Deprecate? #106

Closed
mohsen1 opened this issue Sep 23, 2020 · 3 comments
Closed

Deprecate? #106

mohsen1 opened this issue Sep 23, 2020 · 3 comments

Comments

@mohsen1
Copy link
Contributor

mohsen1 commented Sep 23, 2020

Now that optional chaining is almost everywhere, I think this should print out a deprecation warning.

@yungsters
Copy link
Contributor

I agree with you in spirit. But I think the intention is better served using a lint warning to suggest that people use ?. or ?? instead of idx. It's also important that developers switching between the two recognize the functional differences between them. (In places where the former may return undefined, idx may return null.)

@mohsen1
Copy link
Contributor Author

mohsen1 commented Sep 27, 2020

A codemod can work even better.

@yungsters
Copy link
Contributor

A codemod is not possible because the behavior of ?. is not identical to idx. Closing for now.

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

No branches or pull requests

2 participants