0.0.1 • Published 4 years ago
eslint-plugin-function-body v0.0.1
eslint-plugin-function-body
An eslint plugin to check if two different function have same body
Installation
You'll first need to install ESlint:
npm i eslint --save-devNext, install eslint-plugin-function-body:
npm install eslint-plugin-function-body --save-devUsage
Add function-body to the plugin section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugin": [
"function-body"
],
"rules": {
"function-body/function-body-check": "error"
}
}Demo
function foo() {
const a = 1;
}
function bod() {
const b = 1;
}
class Test {
c() {
const a = 1;
}
}10:3 error Two different function c and foo should not have same body
* 1 problem (1 error, 0 warnings)0.0.1
4 years ago