-
Notifications
You must be signed in to change notification settings - Fork 37
/
.eslintrc.js
108 lines (108 loc) Β· 2.96 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'react-app',
'plugin:react/recommended',
'plugin:cypress/recommended',
'plugin:import/recommended',
'plugin:import/react',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react', 'cypress', 'jsdoc', 'import', 'react-hooks'],
env: { browser: true, node: true, es6: true, jest: true, 'cypress/globals': true },
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
jsdoc: { exemptEmptyFunctions: false },
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
project: 'packages/*/tsconfig.json',
},
},
},
rules: {
'react/prop-types': 0,
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/array-type': ['error', { default: 'array-simple', readonly: 'array-simple' }],
'require-jsdoc': 1,
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'import/default': 0,
'import/order': [
'error',
{
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
pathGroups: [
{
pattern: '@material-ui/**',
group: 'builtin',
position: 'before',
},
{
pattern: '@sensenet/**',
group: 'builtin',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['@sensenet/**'],
},
],
'object-shorthand': 'error',
'dot-notation': 'error',
'no-useless-concat': 'error',
radix: 'error',
yoda: 'error',
'prefer-arrow-callback': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-useless-constructor': 'error',
'prefer-template': 'error',
'prefer-destructuring': ['error', { array: false, object: true }],
'default-case': 'error',
'sort-imports': ['error', { ignoreCase: true, ignoreDeclarationSort: true }],
'react/self-closing-comp': [
'error',
{
component: true,
html: true,
},
],
},
overrides: [
{
files: ['**/test/**/*.{ts,tsx}'],
rules: {
'dot-notation': 'off',
},
},
{
files: ['examples/**/*.{ts,tsx}', 'apps/**/*.{ts,tsx}'],
rules: {
'require-jsdoc': 'off',
},
},
],
}