From 0586e0c7b8c8a8f8b5d22c80a4e5c275d33d10d4 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Fri, 20 Dec 2019 10:17:57 +0100 Subject: [PATCH] more config --- index.js | 60 ++++++++++++++++++++++++++------------------------------ 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/index.js b/index.js index ca4d41d..5feb003 100644 --- a/index.js +++ b/index.js @@ -166,10 +166,10 @@ module.exports = { 'always', { exceptAftersingleLine: true } ], - 'max-depth': ['warn', 4], - 'max-len': ['warn', { code: 80, tabWidth: 4 }], + 'max-depth': ['error', 4], + 'max-len': ['error', { code: 80, tabWidth: 4 }], 'max-lines': [ - 'warn', + 'error', { max: 300, skipBlankLines: true, @@ -177,43 +177,39 @@ module.exports = { } ], 'max-lines-per-function': [ - 'warn', + 'error', { max: 50, skipBlankLines: true, skipComments: true, IIFEs: true }], - 'max-nested-callbacks': null, // https://eslint.org/docs/rules/max-nested-callbacks // enforce a maximum depth that callbacks can be nested - 'max-params': null, // https://eslint.org/docs/rules/max-params // enforce a maximum number of parameters in function definitions - 'max-statements': null, // https://eslint.org/docs/rules/max-statements // enforce a maximum number of statements allowed in function blocks - 'max-statements-per-line': null, // https://eslint.org/docs/rules/max-statements-per-line // enforce a maximum number of statements allowed per line - 'multiline-comment-style': null, // https://eslint.org/docs/rules/multiline-comment-style // enforce a particular style for multiline comments - 'multiline-ternary': null, // https://eslint.org/docs/rules/multiline-ternary // enforce newlines between operands of ternary expressions - 'new-cap': null, // https://eslint.org/docs/rules/new-cap // require constructor names to begin with a capital letter - 'new-parens': null, // https://eslint.org/docs/rules/new-parens // enforce or disallow parentheses when invoking a constructor with no arguments - 'newline-per-chained-call': null, // https://eslint.org/docs/rules/newline-per-chained-call // require a newline after each call in a method chain - 'no-array-constructor': null, // https://eslint.org/docs/rules/no-array-constructor // disallow `Array` constructors - 'no-bitwise': null, // https://eslint.org/docs/rules/no-bitwise // disallow bitwise operators - 'no-continue': null, // https://eslint.org/docs/rules/no-continue // disallow `continue` statements - 'no-inline-comments': null, // https://eslint.org/docs/rules/no-inline-comments // disallow inline comments after code - 'no-lonely-if': null, // https://eslint.org/docs/rules/no-lonely-if // disallow `if` statements as the only statement in `else` blocks - 'no-mixed-operators': null, // https://eslint.org/docs/rules/no-mixed-operators // disallow mixed binary operators - 'no-multi-assign': null, // https://eslint.org/docs/rules/no-multi-assign // disallow use of chained assignment expressions + 'max-nested-callbacks': ['error', 3], + 'max-params': ['error', 3], + 'max-statements': ['error', 20], + 'max-statements-per-line': 'error', + 'multiline-comment-style': ['error', 'starred-block'], + 'multiline-ternary': ['error', 'always-multiline'], // https://eslint.org/docs/rules/multiline-ternary // enforce newlines between operands of ternary expressions + 'new-cap': 'error', // https://eslint.org/docs/rules/new-cap // require constructor names to begin with a capital letter + 'new-parens': ['error', 'never'], // https://eslint.org/docs/rules/new-parens // enforce or disallow parentheses when invoking a constructor with no arguments + 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 1 }], // https://eslint.org/docs/rules/newline-per-chained-call // require a newline after each call in a method chain + 'no-array-constructor': 'error', // https://eslint.org/docs/rules/no-array-constructor // disallow `Array` constructors + 'no-bitwise': 'warn', // https://eslint.org/docs/rules/no-bitwise // disallow bitwise operators + 'no-inline-comments': 'error', // https://eslint.org/docs/rules/no-inline-comments // disallow inline comments after code + 'no-lonely-if': 'error', // https://eslint.org/docs/rules/no-lonely-if // disallow `if` statements as the only statement in `else` blocks + 'no-mixed-operators': 'error', // https://eslint.org/docs/rules/no-mixed-operators // disallow mixed binary operators + 'no-multi-assign': 'error', // https://eslint.org/docs/rules/no-multi-assign // disallow use of chained assignment expressions 'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 1, maxBOF: 0 }], - 'no-negated-condition': null, // https://eslint.org/docs/rules/no-negated-condition // disallow negated conditions - 'no-nested-ternary': null, // https://eslint.org/docs/rules/no-nested-ternary // disallow nested ternary expressions - 'no-new-object': null, // https://eslint.org/docs/rules/no-new-object // disallow `Object` constructors - 'no-plusplus': null, // https://eslint.org/docs/rules/no-plusplus // disallow the unary operators `++` and `--` - 'no-restricted-syntax': null, // https://eslint.org/docs/rules/no-restricted-syntax // disallow specified syntax - 'no-tabs': null, // https://eslint.org/docs/rules/no-tabs // disallow all tabs - 'no-ternary': null, // https://eslint.org/docs/rules/no-ternary // disallow ternary operators + 'no-negated-condition': 'error', // https://eslint.org/docs/rules/no-negated-condition // disallow negated conditions + 'no-nested-ternary': 'error', // https://eslint.org/docs/rules/no-nested-ternary // disallow nested ternary expressions + 'no-new-object': 'error', // https://eslint.org/docs/rules/no-new-object // disallow `Object` constructors + 'no-tabs': 'error', // https://eslint.org/docs/rules/no-tabs // disallow all tabs 'no-trailing-spaces': 'error', - 'no-underscore-dangle': null, // https://eslint.org/docs/rules/no-underscore-dangle // disallow dangling underscores in identifiers - 'no-unneeded-ternary': null, // https://eslint.org/docs/rules/no-unneeded-ternary // disallow ternary operators when simpler alternatives exist - 'no-whitespace-before-property': null, // https://eslint.org/docs/rules/no-whitespace-before-property // disallow whitespace before properties - 'nonblock-statement-body-position': null, // https://eslint.org/docs/rules/nonblock-statement-body-position // enforce the location of single-line statements - 'object-curly-newline': null, // https://eslint.org/docs/rules/object-curly-newline // enforce consistent line breaks inside braces + 'no-underscore-dangle': 'error', // https://eslint.org/docs/rules/no-underscore-dangle // disallow dangling underscores in identifiers + 'no-unneeded-ternary': 'error', // https://eslint.org/docs/rules/no-unneeded-ternary // disallow ternary operators when simpler alternatives exist + 'no-whitespace-before-property': 'error', // https://eslint.org/docs/rules/no-whitespace-before-property // disallow whitespace before properties + 'nonblock-statement-body-position': ['error', 'below'], // https://eslint.org/docs/rules/nonblock-statement-body-position // enforce the location of single-line statements + 'object-curly-newline': ['error', 'multiline'], // https://eslint.org/docs/rules/object-curly-newline // enforce consistent line breaks inside braces 'object-curly-spacing': null, // https://eslint.org/docs/rules/object-curly-spacing // enforce consistent spacing inside braces 'object-property-newline': null, // https://eslint.org/docs/rules/object-property-newline // enforce placing object properties on separate lines 'one-var': null, // https://eslint.org/docs/rules/one-var // enforce variables to be declared either together or separately in functions