ESLint plugin for disabling empty object literals ({}
).
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-no-empty-object-literals
:
$ npm install eslint-plugin-no-empty-object-literals --save-dev
Add no-empty-object-literals
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"no-empty-object-literals"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"no-empty-object-literals/rule": 2
}
}
no-empty-object-literals/rule
: Disable empty object literals ({}
).