@mokahr/eslint-plugin-moka

0.0.9 • Public • Published

eslint-plugin-moka

Eslint Plugin of Moka

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-moka:

$ npm install eslint-plugin-moka --save-dev

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

Usage

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

{
    "plugins": [
        "moka"
    ]
}

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

{
    "rules": {
        "moka/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

Package Sidebar

Install

npm i @mokahr/eslint-plugin-moka

Weekly Downloads

0

Version

0.0.9

License

ISC

Unpacked Size

24.3 kB

Total Files

12

Last publish

Collaborators

  • gapgao
  • yixian
  • wyuanhpp
  • stekovinbranturry
  • southerncross