redux → Redux Toolkit
@omnimod/plugin-redux-to-toolkit migrates legacy Redux to Redux Toolkit. It repoints imports and rewrites store creation; the semantic migrations that need human judgement are flagged rather than guessed.
bash
omnimod run redux-to-toolkit "src/**/*.{ts,tsx,js,jsx}" --writeThe target project needs @reduxjs/toolkit installed.
Example
ts
// before
import { createStore } from "redux";
export const store = createStore(rootReducer);
// after
import { configureStore } from "@reduxjs/toolkit";
export const store = configureStore({ reducer: rootReducer });Automated
createStore/legacy_createStore→configureStore, rewritingcreateStore(rootReducer, preloadedState)intoconfigureStore({ reducer, preloadedState }).- The
reduximport is retargeted to@reduxjs/toolkit. Helpers RTK re-exports verbatim (combineReducers,compose,bindActionCreators,applyMiddleware) move with it; any redux-only export is split back onto a residualreduximport.
Flagged for follow-up
- Switch-statement reducers → convert to
createSlice(diagnostic + TODO). - Middleware/enhancers passed to
createStoreare noted so you can move them toconfigureStore'smiddleware/enhancersoptions. connect()→ prefer theuseSelector/useDispatchhooks.redux-saga/redux-thunk→ migrate async logic tocreateAsyncThunk/ listener middleware.
