1.4.0 • Published 1 year ago
eslint-plugin-remeda v1.4.0
ESLint Plugin Remeda
ESLint plugin for Remeda.
Installation
First, you'll first need to install ESLint:
npm add eslint -DNext, install eslint-plugin-remeda:
npm add eslint-plugin-remeda -DPreamble
This plugin was originally derived from eslint-plugin-lodash-f (fork of eslint-plugin-lodash) and used that as a base to build upon.
Rules
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.
- collection-method-value: Use value returned from collection methods properly.
- collection-return: Always return a value in iteratees of Remeda collection methods that aren't
forEach. - prefer-filter: Prefer
R.filteroverR.forEachwith anifstatement inside. - prefer-find: Prefer
R.findoverR.filterfollowed by selecting the first result. - prefer-flat-map: Prefer
R.flatMapover consecutiveR.mapandR.flat. - prefer-map: Prefer
R.mapoverR.forEachwith apushinside. - prefer-nullish-coalescing: Prefer
??when doing a comparison with a non-nullish value as test. - prefer-constant: Prefer
R.constantover functions returning literals. - prefer-is-empty: Prefer
R.isEmptyover manual checking for length value. - prefer-is-nil: Prefer
R.isNilover checks for both null and undefined. - prefer-remeda-typecheck: Prefer using
R.is*methods overtypeofandinstanceofchecks when applicable. - prefer-do-nothing: Prefer
R.doNothingover empty functions. - prefer-some: Prefer using
R.someover comparingfindIndexto -1. - prefer-times: Prefer
R.timesoverR.mapwithout using the iteratee's arguments.
Contributing
Contributions are always welcome! For more info, read our contribution guide.