Nostalgic Primordial Monster

    eslint-plugin-taro-function-name

    2.0.1 • Public • Published

    eslint-plugin-taro-function-name

    An eslint plugin to enforce method or function name stick to the conventions.

    Installation

    You'll first need to install ESLint:

    $ npm i eslint --save-dev
    

    Next, install eslint-plugin-taro-function-name:

    $ npm install eslint-plugin-taro-function-name --save-dev
    

    Usage

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

    {
      "plugins": ["taro-function-name"]
    }

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

    {
      "rules": {
        "taro-function-name/full-name": "error"
      }
    }

    Supported Rules

    taro-function-name/full-name

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

    options

    interface IOptions {
      blacklist: string[]
    }
    example
    {
        "rules": {
            "taro-function-name/full-name": ["error", {
              "blacklist": ["init"]
            }]
        }
    }

    code:

    const foo = {
      success() {}, // valid
      init() {} // invalid
    }

    Install

    npm i eslint-plugin-taro-function-name

    DownloadsWeekly Downloads

    4

    Version

    2.0.1

    License

    MIT

    Unpacked Size

    10.8 kB

    Total Files

    8

    Last publish

    Collaborators

    • pangnate