konobi / kwalitee

Package for measuring node package kwalitee
MIT License
12 stars 5 forks source link

require()s at top of file #21

Open piranna opened 9 years ago

piranna commented 9 years ago

file require()s entries should be at the top of the page, maybe with interlazed with some variables definitions, but in the recomended order: Node.js build-ins, third-party modules, and last modules on the same project. This can be easily identified by the usage of relative paths on the requires.

konobi commented 9 years ago

While I like that organization myself, I'm not sure how valuable it is in itself. For example, "kwalitee" would fail because it has to do require() based on programmatic names for modules. Do you have some esprima style code that'd work for this sort of detection?

piranna commented 9 years ago

Your use case is something that fails on browserify and need some hacks, so could be considered "bad code", or at least show a warning. This can be identified because require() argument is a variable and didn't solved to a constant when browserify/esprima was called.

konobi commented 9 years ago

Sure, but kwalitee isn't meant for the browser.