Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
91 lines (76 sloc) 5.95 KB


Linting rules based on the Yellow Tugboat coding standards.

You can install this module using npm: npm install eslint-config-yellow-tugboat


The linting rules here are primarily further restrictions of eslint:recommended with the intent of creating even more consistent and readable code.

RulesDef : object

Kind: global namespace


The rule configuration.

Kind: static constant of RulesDef

Name Type Description
extends string Ruleset extends eslint:recommended
rules object The rules that customize beyond the base set.
rules.indent EslintRule Require two spaces for consistency.
rules.linebreak-style EslintRule Use consistent line endings.
rules.camelcase EslintRule Use consistent variable casing.
rules.quotes EslintRule Encourage single quotes for consistency. Double quotes are more likely to be quoted and have more visual weight.
rules.semi EslintRule Semicolons add clarity.
rules.comma-dangle EslintRule Comma dangles simplify diffs.
rules.curly EslintRule Curly braces clarify intent. EslintRule Rarely applicable or allowed.
rules.brace-style EslintRule Use Stroustrup style to create distinct block-sections, but remain somewhat condensed.
rules.padding-line-between-statements EslintRule Enforce spacing around multiline blocks. EslintRule Discourage superfluous whitespace. Inline whitespace should occur only as necessary. EslintRule Inline whitespace should be simple. EslintRule Multiple lines create excessive separation removing block context from operation. Many lines for clarity implies refactoring should occur.
rules.newline-per-chained-call EsLintRule Format chains for better readability.
rules.key-spacing EslintRule Have uniform object declarations. EslintRule Discourage superfluous whitespace.
rules.func-call-spacing EslintRule Discourage superfluous whitespace.
rules.padded-blocks EslintRule Discourage whitespace that separates block context from operations within the block. EslintRule Require separation between keywords and blocks for readability.
rules.keyword-spacing EslintRule Be consistent and always require it for readability. EslintRule Word operators always need a space to be readable, nonword operators should always be attached to what they are operating on for clarity.
rules.spaced-comment EslintRule Have standardized comments EslintRule Encourage clarity around negation. EslintRule Do not allow replacing of built-in values / types. EslintRule Use let of const preferred EslintRule Ensure number clarity EslintRule Use reasonable scoping EslintRule Avoid dangerous coding EslintRule Avoid dangerous coding EslintRule Avoid confusion EslintRule Generally should not be used for loops (refactor instead), never allowed for Switch statements
rules.max-len EslintRule Prevent code from being excessively wide, but allow specific exceptions.
rules.max-depth EslintRule Prevent overly nested blocks.
rules.max-statements EslintRule Prevent excessive function length.
rules.complexity EslintRule Limit cyclomatic complexity EslintRule Clarity is important.
rules.arrow-parens EslintRule Require parens always for consistency.
rules.arrow-body-style EslintRule Simple arrow expressions are easy to read and can be convenient to read properties.
rules.arrow-spacing EslintRule Require reasonable whitespace consistent with other spacing rules. EslintRule Require explicit fall through on Switches. EslintRule Keep it simple whenever possible. EslintRule Limit unnecessary nesting. EslintRule Do not use if-else for multiple returns. Use implicit else block to limit visual artifacts or if the dual-block adds clarity then assign output to a temporary variable. EslintRule Don't forget there are 'TODO's and 'FIXME's, but don't error on them just nag.

RulesDef.EslintRule : string | array

An ESLint rule where a "level" string is accepted in the simpliest case and array with ordered items in the more complex. The items are "level" string, "top-priority value" any, and "other parameters" object. See ESLint documentation for specific rules.

Kind: static typedef of RulesDef




© 2016-2017 Yellow Tugboat

You can’t perform that action at this time.