-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
60 lines (60 loc) · 2 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
module.exports = {
extends: [
'airbnb',
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
plugins: ['@typescript-eslint', 'react', 'react-hooks', 'prettier'],
env: {
browser: true,
node: true,
jest: true,
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
jsx: true,
ecmaVersion: 2018,
sourceType: 'module',
},
rules: {
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-unused-vars': 'off', // compiler catches these well enough
'arrow-parens': 'off', // let Prettier handle parens
camelcase: 'off', // underscores are a thing
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
exports: 'never',
functions: 'never', // function commas are weird
imports: 'always-multiline',
objects: 'always-multiline',
},
],
curly: ['error', 'all'],
'function-paren-newline': 'off', // let Prettier handle line breaks
'max-len': 'off', // let Prettier handle line wrapping
'implicit-arrow-linebreak': 'off', // let Prettier handle line breaks
'import/no-extraneous-dependencies': 'off', // We need zero deps for npm
'object-curly-newline': 'off', // let Prettier handle line breaks
'operator-linebreak': 'off', // let Prettier handle line breaks
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
'react/jsx-one-expression-per-line': 'off', // let Prettier handle linke wrapping
'react/prop-types': 'off', // not needed in TS
'sort-keys': 'error',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
};