December 2020 (version 1.44.0)
Welcome to the new DeepScan updates. 2020 has been a very hard year and here we hope you are staying healthy and safe and we'll see you next in 2021.
Thank you for your continual love and support!
New Rules
The following rules are introduced:
- BAD_MATCH_ALL_ARG - Do not use a non-global
RegExp
argument forString.prototype.matchAll()
- BAD_MONTH_ARG - Do not use 12 as the month argument of
Date
methods - MISPLACED_ALTERNATIVE_IN_REGEXP - Do not use incorrect order of alternatives in the regular expression
Analysis Improvements
- Support ES2020
globalThis
- Support ES2020
String.prototype.matchAll()
- Support ES2020
Promise.allSettled()
- Support TypeScript ambient class/function merging
- Support TypeScript type annotation at
catch
clause binding - Support TypeScript labeled tuple element
- Support spreading types anywhere inside TypeScript tuple
- Support
as
clause at TypeScript mapped type - Support
paths
config withoutbaseUrl
in TypeScripttsconfig.json
- Improve recognizing React JSX expressions to handle the new JSX transform of React 17
- Detect BAD_TYPE_COERCION alarm when objects are converted to numbers at binary
-
,*
,/
,%
, or**
operator - Detect BAD_TYPE_COERCION alarm when non-numeric strings are converted to number at unary
+
or-
operator - Restrict BAD_TYPE_COERCION detection on object values at comparison operators to the case that the other operand is a number
Bug Fixes
- Defect merging does not work when the code fragment contains CR in it(
\r
) - A false alarm for SYNTAX_ERROR occurs when an optional binding pattern is used in TypeScript ambient contexts
- A false alarm for SYNTAX_ERROR occurs for TypeScript optional async method
- Syntax errors may not be reported for incorrectly placed TypeScript type annotations