Enforces project practices
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install @dspot/eslint-plugin
:
npm install @dspot/eslint-plugin@https://github.com/DSpotDevelopers/dspot-eslint-plugin --save-dev
//If using yarn
yarn add -D @dspot/eslint-plugin@https://github.com/DSpotDevelopers/dspot-eslint-plugin
Add @dspot/eslint-plugin
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"@dspot/eslint-plugin"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@dspot/rule-name": "error"
}
}
Name | Description |
---|---|
no-business-in-controller | disallow usage of business logic in Controllers (NestJS) |
no-complex-logic-in-view-attributes | disallow using complex expressions in attributes of elements inside Functional Components for "Views" |
no-method-declaration-in-view | disallow declaring functions within Functional Components for "Views" |
no-prop-object-from-custom-hook-spread | disallow to use Spread for Prop objects from custom hooks (ie. View Models) |
no-react-hooks-in-view | disallow to use React Hooks in Functional Components for "Views" |
require-props-object | disallow to use multiple properties when assigning to a single Element |