0.2.0 • Published 10 months ago

eslint-plugin-member-safe v0.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

eslint-plugin-member-safe

Prevent the risk that the type error of Cannot read properties of undefined when object accessed or function called.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-member-safe:

npm install eslint-plugin-member-safe --save-dev

Usage

Add member-safe to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "member-safe"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "member-safe/optional-chaining-check": "error"
    }
}

Rules

🔧 Automatically fixable by the --fix CLI option.

Name                     Description🔧
optional-chaining-checkCheck if the object accessed or function called using optional chaining operator.
0.2.0

10 months ago

0.1.0

10 months ago