Our rules are similar to AirBnB or Meteor rules, standard template of ESLint rules, although we have tweaked them a little with what is working best for us.
A couple of notable Reaction specific style rules:
- Double quoted strings
- Well spaced function
- 160 character line length
- npm packages
- meteor core packages
- meteor (Atmosphere) packages
- local app files
Review Meteor Code Style for additional guidelines that are typical of Meteor projects.
In the Reaction app root, we have Reaction specific configuration files that can be used with most editors with the appropriate tools installed.
These configurations also include additional rules supporting ES2015 and
We've been using the Open Source Atom editor for some time now and can recommend it.
Setting up Atom is a quick command where we use the shell command
apm to install the same Atom linting packages as we use for Reaction.
apm install editorconfig atom-beautify linter linter-eslint linter-markdown linter-jsonlint linter-docker
Reaction installs the
eslint v3.x packages eslint, eslint-plugin-react, babel-eslint from npm as development dependencies.
In the Reaction app root, we have a Reaction
.eslintrc - http://eslint.org/
For more details, see the ESLint Getting Started Guide.
In our Markdown documentation, we use remark-lint to ensure consistent Markdown styling.
Pull request branches are evaluated using BitHound for insecure dependencies and code quality.
- must pass a Linting check and no errors are accepted.
- must pass a Dependency check and no priority packages are accepted.
- must pass
In many cases, documentation updates can be required as well.
Pull requests are submitted to a peer code review process before acceptance.
File Naming Conventions
In general we use hyphens (-) and camelCase for folder names, and camelCase alone for file names. Underscores are not to be used for file or folder names unless expressly required. Be aware that not all operating systems are case sensitive, so it's not ok to have two files named the same with differing case.
- Folder names for packages must contain only lowercased alpha numeric characters and may be hyphenated if joining more than one word
- Folder names all normal directories must start with a lowercased letter and may camel cased if joining more than one word
// Packages in /imports/plugins ui-grid/ example-paymentmethod/ social/ taxes-avalara/ // All other folder names everywhere addressBook/
- Package name should contain hyphens to make it easier to read.
- Underscores are not to be used unless expressly required.
- File names must start with a lowercased letter and may be camel cased if joining more than one word.
- File names may contain multiple (.) characters as needed
settingsContainer.js publishContainer.js addressBook.js bootstrap.rtl.js index.js // This is an exception as it's part of Meteor's naming convention addressBook.app-test.js
- Hyphens and underscores are not to be used unless expressly required; such is the case with Meteor for
*.app-test.jsfiles. Or for migration files to make the filename more readable.
settings_container.js publish-container.js address_book.js