-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
91 lines (89 loc) · 2.83 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
88
89
90
91
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'airbnb',
'airbnb/hooks',
'prettier',
],
plugins: ['@typescript-eslint', 'import', 'simple-import-sort', 'react', 'react-hooks', 'jsx-a11y', 'prettier'],
settings: {
react: { version: 'detect' },
'import/parser': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
node: { extensions: ['.js', '.jsx', '.ts', '.tsx'] },
},
},
rules: {
// Prettier
'prettier/prettier': ['error', { endOfLine: 'auto' }],
// JavaScript
'class-methods-use-this': 'off',
curly: ['error', 'all'],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-empty-function': 'off',
'no-implicit-coercion': 'error',
'no-redeclare': 'off',
'no-shadow': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'no-use-before-define': 'off',
'arrow-body-style': 'off',
// TypeScript
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'allow',
},
{ selector: 'function', format: ['camelCase', 'PascalCase'] },
{ selector: 'typeLike', format: ['PascalCase'] },
],
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-redeclare': ['warn', { ignoreDeclarationMerge: true }],
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
'@typescript-eslint/no-use-before-define': 'off',
'react/function-component-definition': [
'error',
{ namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' },
],
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
'react/jsx-props-no-spreading': 'off',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
// Import
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': ['error', { devDependencies: ['**/*.config.{js,ts}'] }],
'import/prefer-default-export': 'off',
'import/no-unresolved': 'off',
// simple-import-sort
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
},
};