queerviolet / bones

MIT License
36 stars 119 forks source link

Add ESLint for better team consistency #19

Closed glebec closed 7 years ago

glebec commented 7 years ago

Similar to #18, following a shared code style arguably tends to result in less context switching, friction, feelings of code ownership which discourage multi-author editing, etc.

A number of good ESLint configs such as AirBnB, Standard, and Prettier exist. At Fullstack we often recommend the use of eslint-config-fullstack as a purpose-built config for students working with Node, Express, Sequelize, React, and Redux.

Students collaborating on a project may, however, have different override rules applied according to their taste. Bones could ship with the Fullstack config, ESLint, and related peer deps as dev dependencies, making linting project-based. A root eslint config in Bones would then serve as a place for teammates to agree upon shared rule overrides (or even opt into an entirely different config).

Also like #18, this addition would mean not only adding the linter and config, but reformatting the entirety of Bones to match. Accordingly, this issue may or may not apply to the original queerviolet/Bones, but rather certain forks (which cannot receive their own issues — yay GitHub).

omriAckley commented 7 years ago

I definitely think we should encourage code style standardization within teams. Honestly, there's something really cool some of my senior teams did last time—the team started the project by discussing code style / linter config. I think this is ideal. I like the idea that we'd push / encourage them to decide and discuss, but not actually dictate a particular style. That being said, it might be an unnecessary use of time, and so maybe just having one for them by default is for the best.

glebec commented 7 years ago

I think having them discuss a style they want to opt into is a good idea, but we should have a default they can build off of or switch away from. As it is, even if they do opt into a given style, they'll first have to refactor Bones to match anyway — in addition to figuring out how to get the config set up.

It's the kind of thing that they probably can afford to spend a little more time on in a long project, e.g. Capstone, but might be too much bikeshedding for a short project like Grace Shopper.

glebec commented 7 years ago

A first draft of this (to be improved) is in glebec/bones. Closing this here.