@mokahr/eslint-plugin

0.1.0 • Public • Published

eslint-plugin-moka

Eslint Plugin of Moka

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

ESlint verion should be >= 5

Next, install @mokahr/eslint-plugin:

$ npm install @mokahr/eslint-plugin --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install @mokahr/eslint-plugin globally.

Usage

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

{
    "plugins": [
        "@mokahr"
    ]
}

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

{
    "rules": {
        "@mokahr/rule-name": 2
    }
}

Supported Rules

  • promise-return - Remind you to return something defined when the next promise chain needs parameters.

    .then(() => {
      // not allowed (forget to return a value)
    })
    .then((result)) => {
    })
  • no-jsx-spread-attribute - Forbid spread attribute in jsx element for better static anslysis.

    <MyComponent {...this.props}/> // not allowed (using spread attribute)
  • lingui-mark - Non-i18n string detector

    const message = '你好世界' // Non-i18n string is detected
  • no-global-assign - Forbid assigning variable to window/global.

    window.userId = 123; // You may not want to assign variable to window/global

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    0
  • 0.0.10
    0

Package Sidebar

Install

npm i @mokahr/eslint-plugin

Weekly Downloads

0

Version

0.1.0

License

ISC

Unpacked Size

25.5 kB

Total Files

12

Last publish

Collaborators

  • gapgao
  • southerncross
  • stekovinbranturry
  • wyuanhpp
  • yixian