Skip to content

4Catalyzer/javascript

Repository files navigation

4Catalyzer JavaScript Style Guide

An utterly unreasonable JavaScript style guide, mostly for trolling @jquense.

Use the Airbnb JavaScript style guide, except where it conflicts with how prettier would handle it. Also use prettier.

Exceptions

This guide is intended to present general guidelines. Most modules should follow this style guide and pass the associated lint checks. However, specific modules should freely disregard specific guidelines and use corresponding ESLint pragmas whenever necessary. Disable the relevant rule or rules with eslint-disable, and enable them again with eslint-enable when you're done.

function renderApp() {
  /* eslint-disable global-require */
  const ClientApplication = require('./ClientApplication');
  /* eslint-enable global-require */

  ReactDOM.render(
    <AppContainer>
      <ClientApplication />
    </AppContainer>,
    document.getElementById('app'),
  );
}

Directory layout

Follow the React Router huge-apps example. Use shared/ at the deepest possible level for shared modules.

Line width

79 characters, because @taion doesn't want to have to resize the width of his buffers when switching between JavaScript and PEP 8-compliant Python.