1.0.4 ā¢ Published 27 days ago
@arabasta/eslint-plugin-redux-use-app-functions v1.0.4
@arabasta/eslint-plugin-redux-use-app-functions
ESLint plugin that enforces the usage of redux app specific functions.
Installation
Assuming you already have ESLint installed, run:
# npm
npm install --save-dev @arabasta/eslint-plugin-redux-use-app-functions
# yarn
yarn add --dev @arabasta/eslint-plugin-redux-use-app-functions
# pnpm
pnpm add --save-dev @arabasta/eslint-plugin-redux-use-app-functions
Usage
Flat config (eslint.config.js)
// ...
import reduxUseAppFunctions from '@arabasta/eslint-plugin-redux-use-app-functions';
export default [
// ...
reduxUseAppFunctions.configs.recommended,
];
Legacy config (.eslintrc)
{
"extends": [
// ...
"plugin:@arabasta/redux-use-app-functions/recommended-legacy"
]
}
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