From c9ad100bd1cbd1ff7cab5fd219176724a5d0cf1b Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Thu, 19 Dec 2019 14:58:57 +0100 Subject: [PATCH] more config --- index.js | 50 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index c49c3e5..290ba7e 100644 --- a/index.js +++ b/index.js @@ -132,17 +132,47 @@ module.exports = { 'function-call-argument-newline': ['error', 'consistent'], 'function-paren-newline': ['error', 'multiline-arguments'], 'id-blacklist': 'off', - 'id-length': null, // https://eslint.org/docs/rules/id-length // enforce minimum and maximum identifier lengths - 'id-match': null, // https://eslint.org/docs/rules/id-match // require identifiers to match a specified regular expression - 'implicit-arrow-linebreak': null, // https://eslint.org/docs/rules/implicit-arrow-linebreak // enforce the location of arrow function bodies + 'id-length': 'off', + 'id-match': ['error', '^([nsoa]([A-Z][a-z]+)+|[a-z])$'], + 'implicit-arrow-linebreak': ['error', 'beside'], indent: ['error', 2], - 'jsx-quotes': null, // https://eslint.org/docs/rules/jsx-quotes // enforce the consistent use of either double or single quotes in JSX attributes - 'key-spacing': null, // https://eslint.org/docs/rules/key-spacing // enforce consistent spacing between keys and values in object literal properties - 'keyword-spacing': null, // https://eslint.org/docs/rules/keyword-spacing // enforce consistent spacing before and after keywords - 'line-comment-position': null, // https://eslint.org/docs/rules/line-comment-position // enforce position of line comments - 'linebreak-style': null, // https://eslint.org/docs/rules/linebreak-style // enforce consistent linebreak style - 'lines-around-comment': null, // https://eslint.org/docs/rules/lines-around-comment // require empty lines around comments - 'lines-between-class-members': null, // https://eslint.org/docs/rules/lines-between-class-members // require or disallow an empty line between class members + 'jsx-quotes': 'error', + 'key-spacing': [ + 'error', + { + singleLine: { + beforeColon: false, + afterColon: true, + mode: 'strict' + }, + align: { + align: 'value', + beforeColon: false, + afterColon: true, + mode: 'minimum' + }, + multiline: { + beforeColon: false, + afterColon: true, + mode: 'strict' + } + } + ], + 'keyword-spacing': 'error', + 'line-comment-position': 'error', + 'linebreak-style': ['error', 'unix'], + 'lines-around-comment': [ + 'error', + { + beforeBlockComment: true, + beforeLineComment: true + } + ], + 'lines-between-class-members': [ + 'error', + 'always', + { exceptAftersingleLine: true } + ], 'max-depth': null, // https://eslint.org/docs/rules/max-depth // enforce a maximum depth that blocks can be nested 'max-len': null, // https://eslint.org/docs/rules/max-len // enforce a maximum line length 'max-lines': null, // https://eslint.org/docs/rules/max-lines // enforce a maximum number of lines per file