eslint-plugin-optional-chain

0.0.1 • Public • Published

eslint-plugin-optional-chain

This is an ESLint plugin that provides a custom rule to automatically convert dot operators (.) to optional chain operators (?.) in your code.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-optional-chain:

npm install eslint-plugin-optional-chain --save-dev

Usage

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

{
	"plugins": ["optional-chain"]
}

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

{
	"rules": {
		"optional-chain/auto-optional-chain": 2
	}
}

Rules

🔧 Automatically fixable by the --fix CLI option.

Name                Description 🔧
auto-optional-chain Automatically convert dot operators (.) to optional chain operators (?.) in your code. 🔧

Package Sidebar

Install

npm i eslint-plugin-optional-chain

Weekly Downloads

1

Version

0.0.1

License

ISC

Unpacked Size

7.94 kB

Total Files

8

Last publish

Collaborators

  • torres7707