New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable more undesired syntax #207
Conversation
I just thought of another use case for |
I think if we removed the |
Agreed. Especially with TypeScript v4.4, I expect that |
@Gudahtt @mcmire I removed this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet, looks good!
I am in favour of this as well. I can approve after the conflicts are resolved, and once v10 has been published. Better to keep this for the v11 release to avoid making the v10 update too challenging. |
This PR expands the kinds of JavaScript syntax we forbid using the
no-restricted-syntax
rule to include:with
statementswith
is very strange and we don't have a use case for it!const foo = function () { /* do something */ };
, and is not to be confused with function declarations, e.g.function bar () { /* do something */ };
in
operator'toString' in {}
evaluates totrue
. We should practically always useReflect.hasOwnProperty
instead.