buildo / eslint-plugin-fp-ts

ESLint rules for fp-ts
112 stars 8 forks source link

Prefer RNEA.from(Readonly)Array #60

Open thewilkybarkid opened 3 years ago

thewilkybarkid commented 3 years ago

Thanks for the plugin, learnt a couple of things already with it.

O.fromPredicate((array) => array.length > 0) could be replaced with RNEA.fromArray/RNEA.fromReadonlyArray (found a few usages in https://github.com/sciety/sciety/commit/103fe14d019960d9cc7ebd863b022f199887c02e).

thewilkybarkid commented 3 years ago

Maybe the rule should be 'prefer constructor' (combining with #61 and similar).

thewilkybarkid commented 3 years ago

O.filter((array) => array.length > 0) should be covered too.