-
Notifications
You must be signed in to change notification settings - Fork 37
/
.eslintrc.js
65 lines (65 loc) · 1.7 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module.exports = {
// parser: 'babel-eslint',
parser: '@typescript-eslint/parser',
extends: [
'airbnb',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
],
plugins: ['@typescript-eslint', 'react-hooks'],
rules: {
/**
* JavaScript
*/
'no-unused-vars': [
'error',
{ args: 'after-used', argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'react/jsx-filename-extension': [
'error',
{ extensions: ['.js', '.jsx', '.tsx'] },
],
'react/destructuring-assignment': 'off',
// TODO re-enable after https://github.com/yannickcr/eslint-plugin-react/issues/1809
'react/sort-comp': 'off',
'no-console': ['error', { allow: ['error'] }],
'arrow-body-style': 'off',
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to', 'route'],
aspects: ['noHref', 'invalidHref', 'preferButton'],
},
],
'react-hooks/rules-of-hooks': 'error',
'import/prefer-default-export': 'off',
/**
* TypeScript
*/
'@typescript-eslint/no-unused-vars': [
'error',
{ args: 'after-used', argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'@typescript-eslint/explicit-function-return-type': 'off',
// Reenable this once we have more complete and comprehensive types
'@typescript-eslint/no-explicit-any': 'off',
},
overrides: [
{
files: ['*.js', '*.jsx'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
}