sahat / hackathon-starter

A boilerplate for Node.js web applications
MIT License
34.88k stars 8.18k forks source link

Future plans to grab modules in an ES6 manner? #1129

Closed mwiegant closed 3 years ago

mwiegant commented 3 years ago

Hi all,

Please excuse me if I am asking a dumb question. I was quite familiar with nodeJS back in 2013-15, and am now starting a new project based off of the hackathon-starter. There are a lot of ways to do essentially the same thing in node, especially in regards to modules, so I am trying to decide on the best way to do things before moving forward.

In particular, I'm wondering on the best way to structure modules. From reading this article, among others, it seems like the newest convention for module import / export is:

myModule.js export function myFunction() { // myFunction Scope }

app.js import { myFunction } from 'myModule';

My concern is the age-old one: Do I decide to write code in the "newest" way or do I decide to write code the way it already exists in the codebase. With that in mind, are there any plans to refactor modules in this project or the way modules are used to conform to the ES6 manner?

Please be kind in your criticisms of me :)

YasharF commented 3 years ago

As far as the code formatting and best practices go, Hackathon-Starter uses the following Lint rules: https://github.com/sahat/hackathon-starter/blob/master/.eslintrc . The style rules for imports and modules are in-part based on the rules defined in the latest versions of eslint-config-airbnb-base and eslint-plugin-import. You can find more about what these rules define as good or bad for imports at https://github.com/airbnb/javascript#modules and https://github.com/benmosher/eslint-plugin-import#rules

We typically update the format if a new revision of eslint-config-airbnb-base or eslint-plugin-import specifies that the current code style is no longer OK.