@drtyhu8npm/aliquam-adipisci-eos

1.0.0 • Public • Published

@drtyhu8npm/aliquam-adipisci-eos

npm version npm downloads License: MIT linter by git commit msg linter

An eslint plugin to enforce method or function name conforms to conventions.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install @drtyhu8npm/aliquam-adipisci-eos:

npm install @drtyhu8npm/aliquam-adipisci-eos --save-dev

Usage

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

{
  "plugins": [
    "function-name"
  ],
  "rules": {
    "function-name/starts-with-verb": "error"
  }
}

Supported Rules

function-name/starts-with-verb

Function is always do something, so it should start with a verb and to avoid confusion with variables.

👎 Examples of incorrect code for this rule:

// "@ali/paytm/function-name-starts-with-verb": ["error"]

function cat(fish) {}
function dog(distance) {}

👍 Examples of correct code for this rule:

// "@ali/paytm/function-name-starts-with-verb": ["error"]

function feedCat(fish) {}
function walkDog(distance) {}

options

interface IOptions {
  whitelist: string[];
  blacklist: string[];
}

.eslintrc.js

{
  "rules": {
    "function-name/starts-with-verb": ["error", {
      "whitelist": ["success"],
      "blacklist": ["init"]
    }]
  }
}

👎 Examples of incorrect code for this rule:

// ..."blacklist": ["init"]...
const foo = {
  init() {},
}

👍 Examples of correct code for this rule:

// ..."whitelist": ["success"]...
const foo = {
  success() {},
}

Develop

npm

yarn → bun

Readme

Keywords

Package Sidebar

Install

npm i @drtyhu8npm/aliquam-adipisci-eos

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

14.1 kB

Total Files

10

Last publish

Collaborators

  • vit89446