github.com/sberex/go-sberex@v1.8.2-0.20181113200658-ed96ac38f7d7/dashboard/assets/.eslintrc (about) 1 // This file is part of the go-sberex library. The go-sberex library is 2 // free software: you can redistribute it and/or modify it under the terms 3 // of the GNU Lesser General Public License as published by the Free 4 // Software Foundation, either version 3 of the License, or (at your option) 5 // any later version. 6 // 7 // The go-sberex library is distributed in the hope that it will be useful, 8 // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser 10 // General Public License <http://www.gnu.org/licenses/> for more details. 11 12 // React syntax style mostly according to https://github.com/airbnb/javascript/tree/master/react 13 { 14 'env': { 15 'browser': true, 16 'node': true, 17 'es6': true, 18 }, 19 'parser': 'babel-eslint', 20 'parserOptions': { 21 'sourceType': 'module', 22 'ecmaVersion': 6, 23 'ecmaFeatures': { 24 'jsx': true, 25 } 26 }, 27 'extends': 'airbnb', 28 'plugins': [ 29 'flowtype', 30 'react', 31 ], 32 'rules': { 33 'no-tabs': 'off', 34 'indent': ['error', 'tab'], 35 'react/jsx-indent': ['error', 'tab'], 36 'react/jsx-indent-props': ['error', 'tab'], 37 'react/prefer-stateless-function': 'off', 38 'jsx-quotes': ['error', 'prefer-single'], 39 'no-plusplus': 'off', 40 'no-console': ['error', { allow: ['error'] }], 41 42 // Specifies the maximum length of a line. 43 'max-len': ['warn', 120, 2, { 44 'ignoreUrls': true, 45 'ignoreComments': false, 46 'ignoreRegExpLiterals': true, 47 'ignoreStrings': true, 48 'ignoreTemplateLiterals': true, 49 }], 50 // Enforces consistent spacing between keys and values in object literal properties. 51 'key-spacing': ['error', {'align': { 52 'beforeColon': false, 53 'afterColon': true, 54 'on': 'value' 55 }}], 56 // Prohibits padding inside curly braces. 57 'object-curly-spacing': ['error', 'never'], 58 'no-use-before-define': 'off', // messageAPI 59 'default-case': 'off', 60 61 'flowtype/boolean-style': ['error', 'boolean'], 62 'flowtype/define-flow-type': 'warn', 63 'flowtype/generic-spacing': ['error', 'never'], 64 'flowtype/no-primitive-constructor-types': 'error', 65 'flowtype/no-weak-types': 'error', 66 'flowtype/object-type-delimiter': ['error', 'comma'], 67 'flowtype/require-valid-file-annotation': 'error', 68 'flowtype/semi': ['error', 'always'], 69 'flowtype/space-after-type-colon': ['error', 'always'], 70 'flowtype/space-before-generic-bracket': ['error', 'never'], 71 'flowtype/space-before-type-colon': ['error', 'never'], 72 'flowtype/union-intersection-spacing': ['error', 'always'], 73 'flowtype/use-flow-type': 'warn', 74 'flowtype/valid-syntax': 'warn', 75 }, 76 'settings': { 77 'flowtype': { 78 'onlyFilesWithFlowAnnotation': true, 79 } 80 }, 81 }