-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
87 lines (81 loc) · 2.27 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
module.exports = {
env: {
browser: true,
es2020: true,
},
extends: [
'plugin:react/recommended',
'airbnb',
'plugin:@next/next/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:react-hooks/recommended',
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 11,
sourceType: 'module',
},
plugins: [
'react',
'prettier',
'eslint-plugin-prettier',
'simple-import-sort',
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src/'],
},
},
},
rules: {
'react/jsx-filename-extension': [
'warn',
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
],
// 'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx'] }],
'import/extensions': ['error', 'never', { pattern: { '.svg': 'always' } }],
// 'react/function-component-definition': [
// 2,
// {
// namedComponents: 'arrow-function',
// unnamedComponents: 'arrow-function',
// },
// ],
'react/function-component-definition': 'off',
// We will use TypeScript's types for component props instead
'react/prop-types': 'off',
'react/require-default-props': 'off',
'import/prefer-default-export': 'off',
// No need to import React when using Next.js
'react/react-in-jsx-scope': 'off',
// 'implicit-arrow-linebreak': ['error', 'below'],
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
// space-before-function-paren: off,
'object-curly-newline': 'off',
'implicit-arrow-linebreak': 'off',
// 'comma-dangle': 'off',
'arrow-parens': 'off',
'react/jsx-props-no-spreading': 'off',
'no-unused-vars': 'warn',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
indent: 'off',
// '@typescript-eslint/indent': ['error', 2], // 2 spaces === 1 tab
// '@typescript-eslint/indent': 'off',
// '@typescript-eslint/no-explicit-any': 'off',
// '@typescript-eslint/no-unused-vars': 'off',
'react/jsx-no-bind': [
'error',
{
allowFunctions: true,
ignoreDOMComponents: true,
allowArrowFunctions: true,
},
],
},
};