0.3.0 • Published 7 years ago

eslint-config-yellow-tugboat v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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.

RulesDef : object

Kind: global namespace

RulesDef.config

The rule configuration.

Kind: static constant of RulesDef
Properties

NameTypeDescription
extendsstringRuleset extends eslint:recommended
rulesobjectThe rules that customize beyond the base set.
rules.indentEslintRuleRequire two spaces for consistency.
rules.linebreak-styleEslintRuleUse consistent line endings.
rules.camelcaseEslintRuleUse consistent variable casing.
rules.quotesEslintRuleEncourage single quotes for consistency. Double quotes are more likely to be quoted and have more visual weight.
rules.semiEslintRuleSemicolons add clarity.
rules.comma-dangleEslintRuleComma dangles simplify diffs.
rules.curlyEslintRuleCurly braces clarify intent.
rules.no-callerEslintRuleRarely applicable or allowed.
rules.brace-styleEslintRuleUse Stroustrup style to create distinct block-sections, but remain somewhat condensed.
rules.padding-line-between-statementsEslintRuleEnforce spacing around multiline blocks.
rules.no-whitespace-before-propertyEslintRuleDiscourage superfluous whitespace. Inline whitespace should occur only as necessary.
rules.no-multi-spacesEslintRuleInline whitespace should be simple.
rules.no-multiple-empty-linesEslintRuleMultiple lines create excessive separation removing block context from operation. Many lines for clarity implies refactoring should occur.
rules.newline-per-chained-callEsLintRuleFormat chains for better readability.
rules.key-spacingEslintRuleHave uniform object declarations.
rules.no-trailing-spacesEslintRuleDiscourage superfluous whitespace.
rules.func-call-spacingEslintRuleDiscourage superfluous whitespace.
rules.padded-blocksEslintRuleDiscourage whitespace that separates block context from operations within the block.
rules.space-before-blocksEslintRuleRequire separation between keywords and blocks for readability.
rules.keyword-spacingEslintRuleBe consistent and always require it for readability.
rules.space-unary-opsEslintRuleWord operators always need a space to be readable, nonword operators should always be attached to what they are operating on for clarity.
rules.spaced-commentEslintRuleHave standardized comments
rules.no-unsafe-negationEslintRuleEncourage clarity around negation.
rules.no-global-assignEslintRuleDo not allow replacing of built-in values / types.
rules.no-varEslintRuleUse let of const preferred
rules.no-floating-decimalEslintRuleEnsure number clarity
rules.no-implicit-globalsEslintRuleUse reasonable scoping
rules.no-evalEslintRuleAvoid dangerous coding
rules.no-implied-evalEslintRuleAvoid dangerous coding
rules.no-label-varEslintRuleAvoid confusion
rules.no-labelsEslintRuleGenerally should not be used for loops (refactor instead), never allowed for Switch statements
rules.max-lenEslintRulePrevent code from being excessively wide, but allow specific exceptions.
rules.max-depthEslintRulePrevent overly nested blocks.
rules.max-statementsEslintRulePrevent excessive function length.
rules.complexityEslintRuleLimit cyclomatic complexity
rules.no-confusing-arrowEslintRuleClarity is important.
rules.arrow-parensEslintRuleRequire parens always for consistency.
rules.arrow-body-styleEslintRuleSimple arrow expressions are easy to read and can be convenient to read properties.
rules.arrow-spacingEslintRuleRequire reasonable whitespace consistent with other spacing rules.
rules.no-fallthroughEslintRuleRequire explicit fall through on Switches.
rules.no-unneeded-ternaryEslintRuleKeep it simple whenever possible.
rules.no-lonely-ifEslintRuleLimit unnecessary nesting.
rules.no-else-returnEslintRuleDo 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-commentsEslintRuleDon'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

License

MIT

Copyright

© 2016-2017 Yellow Tugboat