npm.io
0.2.1 • Published 6 years ago

eslint-plugin-ad-hok

Licence
MIT
Version
0.2.1
Deps
1
Size
39 kB
Vulns
0
Weekly
0

eslint-plugin-ad-hok

Ad-hok specific linting rules for ESLint

Installation

Install ESLint

npm install --save-dev eslint

Install the plugin

npm install --save-dev eslint-plugin-ad-hok

Configuration

Using preset

Use the recommended preset to get reasonable defaults:

"extends": [
  "ad-hok/recommended"
]

You may also optionally specify settings that will be shared across all the plugin rules.

"settings": {
  "ad-hok/possibly-magic-helper-regex": "add.*|suppress.*", // defaults to "add.*"
  "ad-hok/nonmagic-helper-whitelist": [
    "addTranslationHelpers",
    "addEffectOnMount"
  ],
  "ad-hok/should-fix-flow-flowmax": true, // if you're using eslint-plugin-known-imports
}
Manually

If you don't use the preset, include the rules that you wish to use:

"plugins": ["ad-hok"],
"rules": {
  "ad-hok/no-unnecessary-flowmax": "error",
  "ad-hok/needs-flowmax": "error",
  "ad-hok/prefer-flowmax": ["error", "whenUsingUnknownHelpers"],
  "ad-hok/no-flowmax-in-forwardref": "error"
},
"settings": { // these are all optional
  "ad-hok/possibly-magic-helper-regex": ...,
  "ad-hok/nonmagic-helper-whitelist": ...,
  "ad-hok/should-fix-flow-flowmax": ...
}

Rules

Configuration presets

This plugin exports a recommended configuration that provides reasonable defaults for enforcing ad-hok best practices

To enable this configuration use the extends property in your .eslintrc config file:

{
  "extends": ["plugin:ad-hok/recommended"]
}

See ESLint documentation for more information about extending configuration files

The rules enabled in this configuration are:

License

MIT

Keywords