-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patheslint.config.js
More file actions
110 lines (109 loc) · 3.06 KB
/
eslint.config.js
File metadata and controls
110 lines (109 loc) · 3.06 KB
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
import tsPlugin from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import globals from 'globals';
export default [
{ ignores: ['node_modules', 'public', 'build', 'dist'] },
{
files: ['**/*.{js,jsx,ts,tsx,d.ts}'],
languageOptions: {
parser: tsParser,
ecmaVersion: 2020,
sourceType: 'module',
globals: globals.browser,
},
plugins: {
react,
'react-hooks': reactHooks,
'@typescript-eslint': tsPlugin,
import: importPlugin,
},
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
},
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'react/function-component-definition': [
2,
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
'arrow-body-style': ['error', 'as-needed'],
'react/jsx-pascal-case': 'error',
camelcase: ['error', { properties: 'never' }],
'react/jsx-handler-names': [
'error',
{
eventHandlerPropPrefix: 'handle',
},
],
'import/no-default-export': 'off',
'import/prefer-default-export': 'off',
'import/no-unresolved': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/prop-types': 'off',
'prefer-const': 'error',
'no-var': 'error',
'no-unused-vars': 'off',
eqeqeq: 'error',
'prefer-destructuring': [
'error',
{
array: false,
object: true,
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'index'],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before',
},
{
pattern: '@/**',
group: 'internal',
},
],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'never',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
'@typescript-eslint/no-unused-vars': [
'warn',
{
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-useless-rename': 'error',
'object-shorthand': 'error',
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react/react-in-jsx-scope': 'off',
},
},
prettierConfig,
];