eslint-plugin-taro-function-name
v2.0.1
Published
An eslint plugin to enforce method or function name stick to the conventions.
Downloads
6
Maintainers
Readme
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
}