github.com/anthdm/go-ethereum@v1.8.4-0.20180412101906-60516c83b011/dashboard/assets/.eslintrc (about)

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