June 2019 (version 1.26.0)

1.26.0 Update

Hi!

Welcome to the new DeepScan updates.

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:

New Rules

We have enhanced our rules mainly under the Code Quality category.

Check the new rules!

Enhanced React Support

React Function Component and Hooks API Support

DeepScan now supports React function component and Hooks API.

Enhanced Support for Various React Components

Previously, DeepScan supported class components better than other kinds of components regarding propTypes and inter-module analysis. Now, we provide a uniform support for the following component kinds:

  • Components from React.memo(), React.forwardRef() and createReactClass()
  • Components from React Redux connect()
  • Components lazily loaded via React.lazy()
  • Function components

Extended Language Support

We have added support for the latest TypeScript 3.5. You can analyze your TypeScript code leveraging the new syntaxes like const assertions.

  • Support TypeScript readonly type modifier
  • Support TypeScript as const assertion

Analysis Improvements

  • Better ES Specification Compliance
    • Report SYNTAX_ERROR for duplicate export names
    • Report SYNTAX_ERROR for duplicate function names at ES module
    • Report SYNTAX_ERROR for duplicate parameter names of strict-mode function
  • Support inter-module analysis of dynamically imported module
  • Support the analysis of the async function return value that goes through await
    async function logAssets(artifacts, audits) {
      const allAssets = await prepareAssets(artifacts, audits);
      // ARRAY_CALLBACK_RETURN_MISSING alarm is detected since the type of 'allAssets' is now known as an array.
      allAssets.map(passAssets => {
        // no return statements.
      });
    }
     
    async function prepareAssets(artifacts, audits) {
      const passNames = Object.keys(artifacts.traces);
      const assets = [];
      for (const passName of passNames) {
        // push items into assets.
      }
      return assets;
    }

Miscellaneous

  • Better SYNTAX_ERROR message when await is used inside non-async function (ES module only)
  • REACT_MISUSED_UPDATE_IN_SET_STATE is improved to trace non-trivial data-flow and detect more alarms
  • Filter-out REACT_BAD_API_RETURN_VALUE alarms occurring at the false branches that are likely to be infeasible in practice
  • In 404 page, a detailed message for the invalid invitation link is shown

Bug Fixes

  • A false alarm for SYNTAX_ERROR occurs when TypeScript this parameter is used on getter or setter
  • A false alarm for SYNTAX_ERROR occurs when template literal is used at TypeScript type annotation
  • A SYNTAX_ERROR is not reported when TypeScript type assertion is used at arrow function parameter
  • A SYNTAX_ERROR is not reported when assign pattern is used at for-in or for-of loop left-hand side