forked from skymavis/sdk-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
82 lines (77 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
80
81
82
module.exports = {
$schema: 'https://json.schemastore.org/eslintrc',
root: true,
parser: '@typescript-eslint/parser',
extends: [
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
],
plugins: ['react-hooks', 'simple-import-sort', 'import'],
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
ignorePatterns: ['dist/', 'node_modules/', '.next'],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-unused-vars': 'off',
'react-hooks/rules-of-hooks': 'error',
'react/no-direct-mutation-state': 'error',
'react/prop-types': 'off',
'react/no-unescaped-entities': 'off',
'react/react-in-jsx-scope': 'off',
'simple-import-sort/imports': [
'error',
{
groups: [
['^\\u0000'],
['^node:', '^@?\\w'], // packages
['^(lib)(/.*|$)', '^(common|modules|services|components|utils|hook|hooks|config)(/.*|$)'], // next alias
['^'],
['^\\.'], // relative
['^.+\\.s?css$'], // style
],
},
],
'simple-import-sort/exports': 'error',
'sort-imports': 'off',
'import/order': 'off',
'import/no-unresolved': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-useless-path-segments': 'error',
'import/no-named-as-default': 'off',
'prettier/prettier': [
'error',
{
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 120,
tabWidth: 2,
arrowParens: 'avoid',
bracketSameLine: false,
},
],
'no-console': [
'error',
{
allow: ['debug', 'error'],
},
],
},
settings: {
react: { version: 'detect' },
},
};