FLUID-6419: eslint-config-fluid preventing the use of .catch() and .finally()

Metadata

Source
FLUID-6419
Type
Bug
Priority
Major
Status
Closed
Resolution
Cannot Reproduce
Assignee
Colin Clark
Reporter
Gregor Moss
Created
2019-10-30T13:43:02.694-0400
Updated
2024-07-25T12:28:36.813-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. fluid-eslint-config

Description

I attempted to use the .catch() and .finally() functions associated with the Promise object, but the linter fails with the following feedback:

"error .catch is a syntax error dot-notation"

The source of the issue to this particular setting in the eslint config file: https://github.com/fluid-project/eslint-config-fluid/blob/041cd0f476fc02d0293914962c14912750e753f5/.eslintrc.json#L26

The particular setting of the allowKeywords flag should be considered/reconsidered with .catch and .finally in mind.

The code that fails the linter looks like the following

somePromise.catch(function () {
    // do some error handling
}).finally(function () {
    // do some final things
});

Whereas this is somewhat kludgy but passes linting

somePromise["catch"](function () {
    // do some error handling
})["finally"](function () {
    // do some final things
});

cc @@Tony Atkins [RtF] and @@Antranig Basman

Environments

Windows 10 1903
Node v10.15.3
eslint-config-fluid 1.1.0

Comments