summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/streams/.eslintrc.js
blob: 5abd6cd4c23afe06fb986300d86942a2b858536b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
// ESLint rules for the Blink streams implementation.
// Based on the devtools rules, with extensive additions and modifications to
// reflect existing usage.

// eslint-disable-next-line no-undef
module.exports = {
  root: true,

  env: {browser: true, es6: true},

  parserOptions: {ecmaVersion: 8},

  // ESLint rules
  //
  // All available rules: http://eslint.org/docs/rules/
  //
  // All rules should have severity "error". For individual exceptions, use
  // comments like:
  // eslint-disable-next-line no-console
  //
  // If a rule is causing problems in multiple places, just remove it.
  rules: {
    // syntax preferences
    quotes: [
      'error', 'single',
      {avoidEscape: true, allowTemplateLiterals: true}
    ],
    semi: 'error',
    'no-extra-semi': 'error',
    'comma-style': ['error', 'last'],
    'wrap-iife': ['error', 'inside'],
    'spaced-comment': 'error',
    eqeqeq: 'error',
    'accessor-pairs':
        ['error', {getWithoutSet: false, setWithoutGet: false}],
    curly: ['error', 'all'],
    'new-parens': 'error',
    'func-call-spacing': 'error',
    'arrow-parens': ['error', 'as-needed'],

    'max-len': ['error', {code: 80, ignoreUrls: true}],

    // Security
    strict: ['error', 'function'],

    // no
    'no-alert': 'error',
    'no-caller': 'error',
    'no-cond-assign': 'error',
    'no-console': 'error',
    'no-debugger': 'error',
    'no-dupe-args': 'error',
    'no-dupe-keys': 'error',
    'no-duplicate-case': 'error',
    'no-else-return': 'error',
    'no-empty': 'error',
    'no-empty-character-class': 'error',
    'no-empty-pattern': 'error',
    'no-eq-null': 'error',
    'no-ex-assign': 'error',
    'no-extra-boolean-cast': 'error',
    'no-extra-parens': [
      'error', 'all', {
        conditionalAssign: false,
        nestedBinaryExpressions: false,
        returnAssign: false
      }
    ],
    'no-eval': 'error',
    'no-fallthrough': 'error',
    'no-floating-decimal': 'error',
    'no-func-assign': 'error',
    'no-implied-eval': 'error',
    'no-implicit-coercion': 'error',
    'no-implicit-globals': 'error',
    'no-inner-declarations': 'off',
    'no-invalid-regexp': 'error',
    'no-irregular-whitespace': 'error',
    'no-labels': 'error',
    'no-loop-func': 'off',
    'no-magic-numbers': 'off',
    'no-multi-str': 'error',
    'no-negated-in-lhs': 'error',
    'no-new-func': 'error',
    'no-new-wrappers': 'error',
    'no-new-object': 'error',
    'no-octal': 'error',
    'no-octal-escape': 'error',
    'no-self-compare': 'error',
    'no-sequences': 'error',
    'no-shadow-restricted-names': 'error',
    'no-sparse-arrays': 'error',
    'no-undef': 'error',
    'no-unexpected-multiline': 'error',
    'no-unsafe-finally': 'error',
    'no-unreachable': 'error',
    'no-unsafe-negation': 'error',
    'no-unused-vars': 'error',
    'no-useless-call': 'error',
    'no-useless-concat': 'error',
    'no-useless-escape': 'error',
    'no-void': 'error',
    'no-with': 'error',
    radix: 'error',
    'use-isnan': 'error',
    'valid-typeof': 'error',

    // ES6
    'no-const-assign': 'error',
    'no-dupe-class-members': 'error',
    'no-new-symbol': 'error',
    'no-this-before-super': 'error',
    'no-var': 'error',
    'prefer-const': 'error',
    'prefer-rest-params': 'error',
    'prefer-spread': 'error',
    'template-curly-spacing': ['error', 'never'],

    // spacing details
    'space-infix-ops': 'error',
    'space-in-parens': ['error', 'never'],
    'no-whitespace-before-property': 'error',
    'keyword-spacing': [
      'error', {
        overrides: {
          if: {after: true},
          else: {after: true},
          for: {after: true},
          while: {after: true},
          do: {after: true},
          switch: {after: true},
          return: {after: true}
        }
      }
    ],
    'arrow-spacing': ['error', {after: true, before: true}],
    'one-var': ['error', 'never'],
    'operator-assignment': ['error', 'always'],
    'operator-linebreak': ['error', 'after'],
    'padded-blocks': ['error', 'never'],
    'space-before-blocks': ['error', 'always'],
    'space-before-function-paren': ['error', 'never'],
    'space-unary-ops': ['error', {words: true, nonwords: false}],

    // file whitespace
    'no-multiple-empty-lines': 'error',
    'no-mixed-spaces-and-tabs': 'error',
    'no-trailing-spaces': 'error',
    'linebreak-style': ['error', 'unix'],

    indent: ['error', 2, {SwitchCase: 1}],

    'brace-style': ['error', '1tbs', {allowSingleLine: true}],

    'key-spacing': [
      'error', {beforeColon: false, afterColon: true, mode: 'strict'}
    ],

    'quote-props': ['error', 'as-needed'],

    'unicode-bom': ['error', 'never']
  }
};