0.0.6 • Published 1 year ago

eslint-plugin-evm-address-to-checksummed v0.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

eslint-plugin-evm-address-to-checksummed

This plugin converts all evm addresses to their checksummed version

Test it on Stackblitz

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-evm-address-to-checksummed:

npm install eslint-plugin-evm-address-to-checksummed --save-dev

Usage

Add evm-address-to-checksummed to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "evm-address-to-checksummed"
    ]
}

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

{
    "rules": {
        "evm-address-to-checksummed/evm-address-to-checksummed": "error",
        "evm-address-to-checksummed/case-typo-in-evm-address": "error"
    }
}

Rules

There are two rules: 1. case-typo-in-evm-address 2. evm-address-to-checksummed

The reason for rule 1 is, some address can be invalid due to uppercase values in an incorrect place (could be due to invalid checksumming or just a typo). This would not hit the rule 2 (main) rule as that rule only seeks to lint valid addresses.

This ensures flexibility as that function can be disabled at will rather than bundling both functions in a single rule

🔧 Automatically fixable by the --fix CLI option.

Name                      Description🔧
case-typo-in-evm-addressThis rule checks if the address is close to validity (invalid due to incorrect uppercase)🔧
evm-address-to-checksummedThis converts valid evm addresses to the checksummed version🔧
0.0.6

1 year ago

0.0.1

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.0

1 year ago