lo1tuma / eslint-plugin-ramda Goto Github PK
View Code? Open in Web Editor NEWMoved to https://github.com/ramda/eslint-plugin-ramda
License: MIT License
Moved to https://github.com/ramda/eslint-plugin-ramda
License: MIT License
R.multiply(1) // could be written as R.identity
R.multiply(-1) // could be written as R.negate
R.allPass([ a, b ]) // could be written as R.both(a, b)
Note: those functions are not equivalent with ramda 0.18.0, but in current master (see ramda/ramda#1475).
Same applies for R.anyPass
and R.either
R.anyPass([ a, b ]) // could be written as R.either(a,b);
Not sure if this should be in the same rule or if we want to have two separate rules.
R.when(R.complement(p), f) === R.unless(p, f)
R.unless(R.complement(p), f) === R.when(p, f)
The ramda documentation mentions a few functions that are officially deprecated (e.g. isSet
, mapObj
).
This rule should warn whenever such a rule is used.
I think R.path(['x'], x) === R.prop('x', x)
should hold in all or at least most cases (didn't write a property-tests though, so not 100% sure).
This should be a warning:
R.add(1) // could be written as R.inc
R.add(-1) // could be written as R.dec
R.complement(R.not)
better written Boolean
R.ifElse(R.is(Array), R.head, R.identity) // could be written as R.when(R.is(Array), R.head)
R.ifElse(R.isEmpty, R.identity, R.toLower) // could be written as R.unless(R.isEmpty, R.toLower)
R.cond([
[ R.is(Array), R.head ],
[ R.T, R.identity ]
]); // could be written as R.ifElse(R.is(Array), R.head, R.identity)
R.always(true) // could be written as R.T
R.always(false) // could be written as R.F
All functions for composition, such as compose
, composeP
, composeK
and their pipe
equivalents should report unnecessary usages with a single argument, e.g. const fn2 = compose(fn1);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.