-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.js
47 lines (47 loc) · 1.52 KB
/
.eslintrc.js
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
module.exports = {
root: true,
ignorePatterns: ['node_modules', 'dist'],
plugins: ['react', 'jsx-a11y', '@typescript-eslint'],
extends: ['eslint:recommended', 'airbnb', 'plugin:react/recommended', 'plugin:react/jsx-runtime', 'plugin:jsx-a11y/recommended', 'prettier'],
rules: {
'arrow-parens': [
'error',
'as-needed',
{
requireForBlockBody: true,
},
],
'no-invalid-this': 'error',
'prefer-arrow-callback': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: 'function-declaration',
unnamedComponents: 'arrow-function',
},
],
'no-restricted-syntax': [
'error',
// The following four selectors prevent the usage of async/await
{
selector: 'AwaitExpression',
message: 'async/await is not allowed',
},
],
'react/jsx-props-no-spreading': 'off',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
plugins: ['@typescript-eslint'],
extends: ['plugin:@typescript-eslint/recommended-type-checked', 'airbnb-typescript', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/no-floating-promises': 'off',
},
},
],
};