Open markerikson opened 10 months ago
other previously suggested rules:
...getDefaultMiddleware()
state = foo
inside immer reducersa no no-op selector lint rule seems a little less necessary now it's checked in runtime, but i suppose it would be nice to be done with static code analysis too
No immediate destructuring of object returned from useSelector
(Btw I was exploring this, but then I noticed eslint is on the verge of releasing a pretty big v9, so I guess I'll wait for that)
we'd probably want to put reselect related rules under the same plugin as well - we can always offer a "reselect-only" config
some community-made packages we may want to see if we agree with any rules from:
another thing to possibly catch:
const middleware: Middleware =>
api =>
next =>
async (action) => {}
the final function for a middleware should never use the async keyword, because then every dispatch returns a promise.
While it's not a "lint rule" thing per se, there was a request here for some form of static analysis that would make it easier to jump from an action creator in a component file straight to the corresponding reducer:
based on https://phryneas.de/redux-typescript-no-discriminating-union - a lint rule that prevents dispatches without an action creator
"No connect
in Function Components" is something I'd like now in our codebase with developers stuck in 10 year old paradigms
Maybe it's worth coming up with our own set of lint rules (no
x => x
selectors?)