January 2019 (version 1.21.0)
1.21.0 Update
Happy new year!
This is our first release of this year. Keep a watchful eye on us!
Please kindly go ahead with the highlights for the latest release.
Release Summary
This version includes a number of updates that we hope you've found some of them helpful.
The key highlights are:
- Extended language support - We've added support for useful language features in ECMAScript and TypeScript.
- Filtered alarms - Filter-out alarms commonly used in practice!
- Reduced false alarms - Blow away false alarms!
- Refined alarms - More detailed message and cause points!
- Visual Studio Code extension (Embedded mode) - Visual Studio Code on your local!
- IntelliJ plugin - IntelliJ and WebStorm plugin are ready.
Extended Language Support
We have added support for useful language features currently in ECMAScript and TypeScript.
- Support TypeScript type
import()
- Allow top-level
await
as some browsers support it
Analysis Improvements
- Better treatments of side-effects on object properties including getters, setters and DOM properties. Mainly, this change reduces false alarms on ASSIGN_SAME_VALUE, CONSTANT_CONDITION and SAME_OPERAND_VALUE
More Aggressive Alarm Filtering
- Filter-out ASSIGN_SAME_VALUE alarms when type assertions are present (e.g.,
foo = foo as number;
) - Filter-out EMPTY_BLOCK alarms when code comment exists before the block
- Filter-out REACT_INEFFICIENT_PURE_COMPONENT_PROP alarms inside test cases because the prop values are transient and the efficiency is irrelevant in test code
- Filter-out UNINITIALIZED_LOCAL_VAR alarms when the uninitialized access appears after the variable declaration because it is often intended in practice
- Filter-out UNUSED_EXPR alarms for property and variable accesses appearing as separate statements because they are usually harmless and often intended for various purposes
- Filter-out UNUSED_EXPR alarms on
void
expressions because it could mean that the expression is not to be used. - Filter-out UNUSED_EXPR alarms occurring when variable references are used as
for
loop initializer because it is often used to enhance code readability (e.g.,for (i; i < len; i++)
) - Filter-out UNUSED_EXPR alarms when type assertions are present (e.g.,
(error: empty);
) - Filter-out UNUSED_VAR_ASSIGN and UNUSED_DECL alarms occurring at array destructuring because it is often intended for code readability (e.g.,
let [x, y] = foo();
) - Filter-out UNUSED_VAR_ASSIGN and UNUSED_DECL alarms occurring at `this` context assignment because it is often used as boilerplate (e.g.,
let self = this;
)
Visual Studio Code extension (Embedded mode)
While DeepScan provides Visual Studio Code extension, it has the limitation for transferring the file to the DeepScan server and analyzing a file one by one.
New embedded mode works standalone without DeepScan server. It works with the local language server so you can directly analyze the whole project on your local.
Note: This feature is only available under a paid license. To activate this, contact us at support@deepscan.io.
IntelliJ plugin
We've prepared a IntelliJ plugin for DeepScan. (Applied for WebStorm also)
You can directly inspect your JavaScript code on the fly in your IntelliJ, so find your code issues at development time earlier.
Note: This feature is only available under a paid license. To activate this, contact us at support@deepscan.io.
Miscellaneous
- Pinpoint alarm cause locations with shorter code range
- Distinguish arrays from objects in alarm cause messages
- Provide alarm cause locations for more CONSTANT_CONDITION alarms
- Provide more specific type descriptions at MISMATCHED_TYPE_OF_ARG alarm messages
- Lower impact to Medium for REACT_BAD_INITIAL_STATE_TYPE because it corresponds to a React waring not runtime error
- Do not detect CONSTANT_CONDITION alarms on
assert()
conditions because being constant is often what is intended
Bug Fixes
- A false alarm for BAD_FOR_STATEMENT may occur when the loop condition is specified with
<=
operator - A false alarm for BAD_OBJECT_LITERAL_COMPARISON may occur at
isUndefined()
call - A false alarm for REACT_BAD_DOM_ATTRIBUTE_VALUE occurs when numeric values are used as the
ref
attribute - A false alarm for REACT_BAD_STYLE_OBJ_PROPERTY may occur for numeric property values
- A false alarm for REACT_MISMATCHED_TYPE_OF_ARG may occur at the first argument of
React.createPortal()
andReactDOM.render()
- A false alarm for REACT_USELESS_PROP_TYPES occurs when the prop types object is shared between multiple components
- A false alarm for SYNTAX_ERROR occurs when a decorator is used for class property named
as
- A false alarm for UNDEFINED_IMPORT may occur when module rewire packages like babel-plugin-rewire is used
- A false alarm for UNUSED_IMPORT may occur for some type and decorator usages
- A false alarm for UNREACHABLE_CODE may occur when
await
expression is used - A false alarm for VUE_BAD_API_RETURN_VALUE may occur at the
render()
function of a functional component