green-code-initiative / ecoCode-javascript

Reduce the environmental footprint of your JS/TS software programs
https://ecocode.io
GNU General Public License v3.0
21 stars 18 forks source link

Prefer collections with pagination (team 106 critères) #6

Closed poulainpi closed 1 year ago

poulainpi commented 1 year ago

This rule aims to reduce the size and thus the network weight of API returns that may contain many elements. This rule is built for the NestJS framework but can work with a controller @Controller() and a decorated method @Get().

utarwyn commented 1 year ago

I'm thinking about this rule and wonder if we correctly differentiate between getting a collection of resources and getting a specific resource via its identifier. It shouldn't be a warning if you want to retrieve only one resource, right?

FanchGadjo commented 1 year ago

Great ! Thanks everyone.