-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep entry code in the main folder, and out of lib/ #8
Comments
In that case (several js files), index.js should be in the lib/ folder too to have all the code in only one place. The same could be specified for other folders/files (test, bin, src, doc...): when having only one file of a kind have in the root of the project, when having several put all of them inside their folder. |
I believe everything should live under lib and there should be no *.js files in the root folder of the package. |
I think too, but I find acceptable to have an |
I still think it's better to have them in a folder... this also helps with things like doing lint testing, etc. The hope is to encourage good/best practices, but to do that, somewhere someone has to pick what's the best option for the community, going forward. |
Why?
How so? |
Well, the first is a choice. The second is because it makes it easier to apply a lint to a directory rather than a directory and a random group of files. And you probably want to treat tests with a different lint profile. |
I wouldn't read files but instead follow the require()s tree. |
Well, based on some input, it seems like requiring that everything is in either "lib" or the code directory is configured in package.json is the best option. |
👍 |
Putting your entry code in more folders just makes it harder for everyone else to get to. I mean, unless you want to hide your code I guess. :)
If you have other files required by your index.js, or whichever other entry file, that's fine to go into lib/ or other top-level files, if it doesn't belong in another module.
From: https://twitter.com/konobi/status/639536896968892416
The text was updated successfully, but these errors were encountered: