December 2019 (version 1.32.0)
1.32.0 Update
Time flies!
This is the last 2019 update and we want to say thank you to everyone!
Here we are wishing you an enjoyable JavaScript development in the new year.
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 - Rules, rules, and rules!
- Analysis improvements - Enhanced analysis for the object property accesses.
- Enhanced ESLint support - Upgraded typescript-eslint.
New Rules
We are enhancing our rules. Check out the newly introduced rules!
- ACCESS_INNER_FUNC_FROM_DEFAULT_PARAM - Do not use an inner function in the default parameter
- BAD_ARRAY_METHOD_ON_ARGUMENTS - Do not compare the result of integer-returning built-in API with a float number
- BAD_PROPERTY_DESCRIPTOR - Do not define an invalid property descriptor
- INCOMPLETE_STRING_ESCAPE - Do not replace only the first occurrence of an escaped special character
- INHERIT_NON_CONSTRUCTOR - Do not inherit a class from a non-constructor
- LENGTH_PROPERTY_TYPO - Do not use a misspelled `length` property
- REACT_MISSING_EVENT_PERSIST - Do not use a React synthetic event inside an asynchronous callback function without calling
event.persist()
- REDUCE_EMPTY_ARRAY_WITHOUT_INIT - Do not call
Array.prototype.reduce()
on an empty array without an initial value - USELESS_ARRAY - Check for an array which is never used after elements are added to it
Analysis Improvements
Recognize object property accesses at iterator application points such as for-of
loop and array spread. This enables detecting more NULL_POINTER and INSUFFICIENT_NULL_CHECK alarms like the following:
async getWalletOrders ({ commit, state }, params) {
let { data } = await api.getWalletOrders(params)
// If 'data' is null, a TypeError will be thrown at the array spread '...data'.
const unionList = _.unionBy([...state.list, ...data], 'id')
commit(TYPES.UPDATE_WALLET, { list: unionList })
// INSUFFICIENT_NULL_CHECK alarm is detected because the below check implies that 'data' may be null.
return data || []
},
ESLint Integration
To support the following configs, typescript-eslint plugin was upgraded to v2.10.
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended-requiring-type-checking
Also now we shows failure messages in more detail so you can directly see what is the problem such as missing plugins.
Miscellaneous
- The locations of some UNREACHABLE_CODE alarms are changed slightly due to minor changes in our internal code representation
Bug Fixes
- Variables exported through
let
declaration are omitted from inter-module analysis - Analyzer may abnormally terminate for some invalid
export
statements - The only accepted owner can leave the team although all the other owners are 'Declined' members