aboutsummaryrefslogtreecommitdiffstats
path: root/.eslintrc.js
blob: 0576317087c02e68174b2b004e730107448f4d44 (plain) (blame)
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
module.exports = {
  root: true,
  parser: '@babel/eslint-parser',
  parserOptions: {
    ecmaFeatures: {
      jsx: true,
    },
    ecmaVersion: 2018,
    sourceType: 'module',
    project: './tsconfig.json',
  },
  extends: ['eslint-config-airbnb', 'plugin:unicorn/recommended'],
  plugins: ['jest'],
  settings: {
    react: {
      pragma: 'React', // Pragma to use, default to "React"
      version: 'detect', // React version. "detect" automatically picks the version you have installed.
    },
  },
  globals: {
    window: true,
    document: true,
    FormData: true,
    localStorage: true,
    navigator: true,
    Element: true,
    use: true,
    FileReader: true,
  },
  env: {
    browser: true,
    es6: true,
    node: true,
    jest: true,
  },
  overrides: [
    {
      files: ['**/*.ts', '**/*.tsx'],
      extends: ['airbnb-typescript', 'plugin:unicorn/recommended'],
      parser: '@typescript-eslint/parser',
      plugins: ['@typescript-eslint'],
      rules: {
        // eslint
        'arrow-parens': 0,
        'array-callback-return': 1,
        'class-methods-use-this': 0,
        'consistent-return': 0,
        'function-paren-newline': 0,
        'implicit-arrow-linebreak': 0,
        'linebreak-style': 0,
        'max-len': 0,
        'no-confusing-arrow': 0,
        'no-console': 0,
        'no-param-reassign': 0,
        'no-restricted-syntax': 0,
        'no-return-assign': 1,
        'no-underscore-dangle': 0,
        'no-use-before-define': 0,
        'prefer-destructuring': 1,
        'object-curly-newline': 0,
        'operator-linebreak': 0,
        // @typescript-eslint
        '@typescript-eslint/indent': 0,
        '@typescript-eslint/no-shadow': 0,
        '@typescript-eslint/no-unused-expressions': 0,
        // eslint-plugin-import
        'import/extensions': 0,
        'import/no-cycle': 1,
        'import/no-extraneous-dependencies': 0,
        'import/no-unresolved': 0,
        'import/prefer-default-export': 0,
        // eslint-plugin-react
        'react/destructuring-assignment': 0,
        'react/button-has-type': 0,
        'react/forbid-prop-types': 0,
        'react/jsx-curly-newline': 0,
        'react/jsx-no-bind': 0,
        'react/jsx-no-target-blank': 0,
        'react/jsx-props-no-spreading': 0,
        'react/no-deprecated': 1,
        'react/no-array-index-key': 0,
        'react/prefer-stateless-function': 0,
        'react/sort-comp': 0,
        'react/state-in-constructor': 0,
        'react/static-property-placement': 0,
        //  eslint-plugin-jsx-a11y
        'jsx-a11y/click-events-have-key-events': 1,
        'jsx-a11y/mouse-events-have-key-events': 1,
        'jsx-a11y/label-has-for': [
          2,
          {
            components: ['Label'],
            required: {
              every: ['id'],
            },
            allowChildren: false,
          },
        ],
        'jsx-a11y/no-static-element-interactions': 0,
        'jsx-a11y/no-noninteractive-element-interactions': 1,
        //  eslint-plugin-unicorn
        'unicorn/filename-case': 0,
        'unicorn/no-null': 0,
        'unicorn/no-useless-undefined': 0,
        'unicorn/prefer-module': 0,
        'unicorn/prevent-abbreviations': 0,
        'unicorn/prefer-node-protocol': 0,
        'unicorn/import-style': [
          2,
          {
            styles: {
              path: {
                named: true,
              },
            },
          },
        ],
        'unicorn/consistent-destructuring': 0,
      },
    },
  ],
  rules: {
    // eslint
    'arrow-parens': 0,
    'class-methods-use-this': 0,
    'consistent-return': 1,
    'implicit-arrow-linebreak': 0,
    indent: 0,
    'function-paren-newline': 0,
    'linebreak-style': 0,
    'max-len': 0,
    'no-await-in-loop': 1,
    'no-console': [
      1,
      {
        allow: ['warn', 'error'],
      },
    ],
    'no-param-reassign': 1,
    'no-restricted-syntax': 0,
    'no-underscore-dangle': 0,
    'operator-linebreak': 0,
    'prefer-destructuring': 1,
    'object-curly-newline': 0,
    // eslint-plugin-import
    'import/extensions': 0,
    'import/prefer-default-export': 0,
    'import/no-extraneous-dependencies': 0, // various false positives, re-enable at some point
    'import/no-unresolved': 0,
    // eslint-plugin-react
    'react/forbid-prop-types': 1,
    'react/destructuring-assignment': 0,
    'react/jsx-curly-newline': 0,
    'react/jsx-filename-extension': 1,
    'react/jsx-one-expression-per-line': 0,
    'react/jsx-no-bind': 1,
    'react/jsx-props-no-spreading': 0,
    'react/prefer-stateless-function': 1,
    'react/prop-types': 0,
    'react/static-property-placement': 0,
    'react/state-in-constructor': 1,
    'react/sort-comp': 0,
    //  eslint-plugin-jsx-a11y
    'jsx-a11y/click-events-have-key-events': 1,
    'jsx-a11y/no-static-element-interactions': 1,
    'jsx-a11y/no-noninteractive-element-interactions': 1,
    //  eslint-plugin-unicorn
    'unicorn/filename-case': 0,
    'unicorn/no-null': 0,
    'unicorn/no-useless-undefined': 0,
    'unicorn/prefer-module': 0,
    'unicorn/prevent-abbreviations': 0,
    'unicorn/prefer-node-protocol': 0,
    'unicorn/import-style': [
      2,
      {
        styles: {
          path: {
            named: true,
          },
        },
      },
    ],
    'unicorn/consistent-destructuring': 0,
  },
};