1.0.3 ⢠Published 1 year ago
@stoyan-eslint/eslint-plugin-redux-use-app-functions v1.0.3
eslint-plugin-redux-use-app-functions
This ESLint plugin enforces the usage of the app specific functions.
Installation
Assuming you already have ESLint installed, run:
# npm
npm install @stoyan-eslint/eslint-plugin-redux-use-app-functions --save-dev
# yarn
yarn add @stoyan-eslint/eslint-plugin-redux-use-app-functions --dev
Then extend the recommended eslint config:
{
"extends": [
// ...
"plugin:@stoyan-eslint/redux-use-app-functions/recommended"
]
}
Rules
ā
Set in the recommended
configuration\
š§ Automatically fixable by the --fix
CLI option
Rule | Description | ā | š§ | |
---|---|---|---|---|
use-app-selector | Enforces the usage of useAppSelector | ā | š§ | |
use-app-dispatch | Enforces the usage of useAppDispatch | ā | š§ | |
use-create-app-async-thunk | Enforces the usage of createAppAsyncThunk | ā | š§ |
use-app-selector
Examples of incorrect code for this rule:
useSelector();
Examples of correct code for this rule:
useAppSelector();
use-app-dispatch
Examples of incorrect code for this rule:
useDispatch();
Examples of correct code for this rule:
useAppDispatch();
use-create-app-async-thunk
Examples of incorrect code for this rule:
createAsyncThunk();
Examples of correct code for this rule:
createAppAsyncThunk();
License
MIT