fix(eslint-plugin): [no-implied-eval] handle the `Function` type #2435
Conversation
Thanks for the PR, @soobing! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! |
Codecov Report
@@ Coverage Diff @@
## master #2435 +/- ##
==========================================
- Coverage 92.81% 92.80% -0.02%
==========================================
Files 290 290
Lines 9453 9459 +6
Branches 2647 2650 +3
==========================================
+ Hits 8774 8778 +4
Misses 322 322
- Partials 357 359 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ts.SymbolFlags.FunctionScopedVariable | | ||
ts.SymbolFlags.Interface | | ||
ts.SymbolFlags.Transient, | ||
) && |
soobing
Aug 29, 2020
Author
Contributor
if you have any good idea to check symbol.flags === 33554497
please let me know. ✨
if you have any good idea to check symbol.flags === 33554497
please let me know.
bradzacher
Sep 6, 2020
Member
It might be better instead to just do something similar to what we've got for checking if the symbol is declared locally or not:
typescript-eslint/packages/eslint-plugin/src/rules/no-implied-eval.ts
Lines 128 to 135
in
2ada5af
It might be better instead to just do something similar to what we've got for checking if the symbol is declared locally or not:
typescript-eslint/packages/eslint-plugin/src/rules/no-implied-eval.ts
Lines 128 to 135 in 2ada5af
soobing
Sep 7, 2020
Author
Contributor
@bradzacher Thank you for review. I updated to check if the symbol is declared locally or not :)
@bradzacher Thank you for review. I updated to check if the symbol is declared locally or not :)
LGTM - thanks for your contribution! |
e1401dc
into
typescript-eslint:master
Fixes #2358
In case of using
Function type
the function checking is function type( namedisFunctionType
) should return true.