No release in over a year
37signals house style for Ruby programming
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

37signals house style

Ruby

RuboCop has built-in support for pulling config from a gem. We provide a rubocop-37signals gem for this purpose.

To introduce our house style to an app, add rubocop-37signals to your Gemfile:

gem "rubocop-37signals", github: "basecamp/house-style", require: false

And create a boilerplate .rubocop.yml that inherits from rubocop-37signals:

# 37signals house style
inherit_gem: { rubocop-37signals: rubocop.yml }

For non-Rails apps:

# 37signals house style
inherit_gem: { rubocop-37signals: rubocop-ruby.yml }

App-specific config may follow, overriding the house style.

JavaScript

We use ESLint for our JavaScript. You'll need eslint 9 or higher to use our shared config.

The configurations is based on @eslint/js's recommended config, with a few more stylistic rules added to reflect our preferences.

To use our ruleset as a baseline, add the @37signals/eslint-config package:

npm install --save-dev @37signals/eslint-config

Or with Yarn:

yarn add --dev @37signals/eslint-config

And extend it in your eslint.config.mjs file:

import houseStyle from "@37signals/eslint-config"

export default [
  houseStyle,
  {
    rules: {
      "no-unused-vars": [ "off" ]
      ...
    }
  }
]

SCSS

We use Stylelint for our SCSS.

Our config extends stylelint-config-recommended-scss and makes it a little more lax.

To see the rules, read the config itself.

To use our small ruleset as a baseline, add the @37signals/stylelint-config-scss package:

npm install --save-dev @37signals/stylelint-config-scss

# or
yarn add --dev @37signals/stylelint-config-scss

And extend it in your Stylelint config:

{
  "extends": "@37signals/stylelint-config-scss",

  "rules": {
    
  }
}