jfmengels / eslint-plugin-fp

ESLint rules for functional programming
MIT License
970 stars 36 forks source link

no-mutating-methods allowedObjects doesn't work if chained #50

Open j-oshb opened 5 years ago

j-oshb commented 5 years ago

The following will pass:

/* eslint fp/no-mutating-methods: ["error", {"allowedObjects": ["mongo"]}] */
mongo.sort()

Whereas the following will fail:

/* eslint fp/no-mutating-methods: ["error", {"allowedObjects": ["mongo"]}] */
mongo.collection().sort()

I'd like to see both pass, but maybe this is by design?