forked from nhost/nhost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
79 lines (79 loc) · 2.22 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
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: ['next', 'airbnb', 'airbnb-typescript', 'airbnb/hooks', 'prettier'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
ignorePatterns: [
'**/.eslintrc.js',
'**/prettier.config.js',
'**/next.config.js',
],
rules: {
'react/react-in-jsx-scope': 'off',
'react/jsx-props-no-spreading': 'off',
'react/require-default-props': 'off',
'react-hooks/exhaustive-deps': 'warn',
'import/order': 'off',
'import/extensions': ['error', 'never', { json: 'always' }],
'react/jsx-filename-extension': ['warn', { extensions: ['.jsx', '.tsx'] }],
'react/jsx-no-bind': [
'error',
{ allowArrowFunctions: true, allowFunctions: true },
],
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': ['error', { devDependencies: true }],
curly: ['error', 'all'],
'no-undef': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': [
'error',
{ ignoreTypeReferences: true },
],
'no-console': ['warn', { allow: ['error'] }],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' },
],
'no-restricted-imports': [
'warn',
{
patterns: [
{
group: ['..*'],
message:
'Please use absolute imports instead. (e.g: @/components/, @/hooks/, etc.)',
},
{
group: ['@testing-library/react*'],
message: 'Please use @/tests/testUtils instead.',
},
],
},
],
},
};