1.0.2 • Published 4 years ago

eslint-plugin-function-call-context v1.0.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

eslint-plugin-function-call-context

ESLint plugin to verify that some functions are called in the correct context.

Configuration

"rules": {
  "function-call-context/call-in-function": ["error", {
    "functions": ["functionA", "functionB"],
    "methods": ["methodA", "methodB"]
  }],
}

Rules

call-in-function

This rule checks that certain functions are called inside of another function.

This can be useful if you don't want to run these functions right when the script is loaded.

Invalid

const myVar = myFunction()

Valid

function outerFunction() {
  const myVar = myFunction()
}

Options

"function-call-context/call-in-function": [<enabled>, {
  "functions": [<string>],
  "methods": [<string>]
}]