eslint-config-yellow-tugboat
Linting rules based on the Yellow Tugboat coding standards.
You can install this module using npm:
npm install eslint-config-yellow-tugboat
About
The linting rules here are primarily further restrictions of eslint:recommended
with the intent
of creating even more consistent and readable code.
object
RulesDef : Kind: global namespace
- RulesDef :
object
- .config
- .EslintRule :
string
|array
RulesDef.config
The rule configuration.
Kind: static constant of RulesDef
Properties
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. |
rules.no-caller | 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. |
rules.no-whitespace-before-property | EslintRule |
Discourage superfluous whitespace. Inline whitespace should occur only as necessary. |
rules.no-multi-spaces | EslintRule |
Inline whitespace should be simple. |
rules.no-multiple-empty-lines | 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. |
rules.no-trailing-spaces | 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. |
rules.space-before-blocks | EslintRule |
Require separation between keywords and blocks for readability. |
rules.keyword-spacing | EslintRule |
Be consistent and always require it for readability. |
rules.space-unary-ops | 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 |
rules.no-unsafe-negation | EslintRule |
Encourage clarity around negation. |
rules.no-global-assign | EslintRule |
Do not allow replacing of built-in values / types. |
rules.no-var | EslintRule |
Use let of const preferred |
rules.no-floating-decimal | EslintRule |
Ensure number clarity |
rules.no-implicit-globals | EslintRule |
Use reasonable scoping |
rules.no-eval | EslintRule |
Avoid dangerous coding |
rules.no-implied-eval | EslintRule |
Avoid dangerous coding |
rules.no-label-var | EslintRule |
Avoid confusion |
rules.no-labels | 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 |
rules.no-confusing-arrow | 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. |
rules.no-fallthrough | EslintRule |
Require explicit fall through on Switches . |
rules.no-unneeded-ternary | EslintRule |
Keep it simple whenever possible. |
rules.no-lonely-if | EslintRule |
Limit unnecessary nesting. |
rules.no-else-return | 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. |
rules.no-warning-comments | EslintRule |
Don't forget there are 'TODO's and 'FIXME's, but don't error on them just nag. |
string
| array
RulesDef.EslintRule : 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
License
MIT
Copyright
© 2016-2017 Yellow Tugboat