ESLint plugin for Remeda.
First, you'll first need to install ESLint:
npm add eslint -D
Next, install eslint-plugin-remeda
:
npm add eslint-plugin-remeda -D
This plugin was originally derived from eslint-plugin-lodash-f (fork of eslint-plugin-lodash) and used that as a base to build upon.
Enable all of the rules that you would like to use. All rules are off by default, unless you use one of the plugin's configurations which turn all relevant rules on.
forEach
.R.filter
over R.forEach
with an if
statement inside.R.find
over R.filter
followed by selecting the first result.R.flatMap
over consecutive R.map
and R.flat
.R.map
over R.forEach
with a push
inside.??
when doing a comparison with a non-nullish value as test.R.constant
over functions returning literals.R.isEmpty
over manual checking for length value.R.isNil
over checks for both null and undefined.R.is*
methods over typeof
and instanceof
checks when applicable.R.doNothing
over empty functions.R.some
over comparing findIndex
to -1.R.times
over R.map
without using the iteratee's arguments.Contributions are always welcome! For more info, read our contribution guide.