-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
94 lines (87 loc) · 2.71 KB
/
.eslintrc.cjs
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
/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
globals: {
React: true,
JSX: true,
},
extends: [
'airbnb',
'airbnb-typescript',
'airbnb/hooks',
'eslint:recommended',
'next/core-web-vitals',
'plugin:prettier/recommended',
'plugin:react/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
tsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.json',
warnOnUnsupportedTypeScriptVersion: false,
},
plugins: ['prettier', 'react'],
rules: {
// @typescript-eslint
'no-unused-vars': 'off', // off base rule, use @typescript-eslint/no-unused-vars instead
'@typescript-eslint/no-unused-vars': [
'warn',
{ args: 'none', argsIgnorePattern: '^_', caughtErrors: 'none', ignoreRestSiblings: true },
],
'@typescript-eslint/naming-convention': 'warn',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-use-before-define': 'off',
// others
'arrow-body-style': 'off',
'comma-dangle': 'off',
'consistent-return': 'off',
'default-case': 'warn',
'max-len': 'off',
'no-alert': 'off',
'no-console': 'off',
'no-empty': 'warn',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-restricted-exports': 'off',
'no-underscore-dangle': 'off',
// import
'import/prefer-default-export': 0,
// prettier
'prettier/prettier': 'error',
// react-hooks
'react-hooks/exhaustive-deps': 'warn',
'react-hooks/rules-of-hooks': 'error',
// react
'react/button-has-type': 'warn',
'react/destructuring-assignment': 'off',
'react/display-name': 'off',
'react/forbid-prop-types': 'off',
'react/function-component-definition': 'off',
'react/jsx-filename-extension': 'off',
'react/jsx-key': 'warn',
'react/jsx-no-bind': 'off',
'react/jsx-no-constructed-context-values': 'warn',
'react/jsx-no-useless-fragment': 'warn',
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': 'off',
'react/no-array-index-key': 'off',
'react/no-children-prop': 'off',
'react/no-inline-styles': 'off',
'react/no-unescaped-entities': 'off',
'react/no-unknown-property': 'off',
'react/no-unstable-nested-components': ['warn', { allowAsProps: true }],
'react/no-unused-prop-types': 'warn',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'react/self-closing-comp': 'warn',
'react/jsx-pascal-case': ['warn', { ignore: ['Icons.*'] }],
// jsx-a11y
'jsx-a11y/label-has-associated-control': 'warn',
'jsx-a11y/anchor-is-valid': 'warn',
},
};