forked from nhn/tui.calendar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
119 lines (118 loc) · 3.08 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
109
110
111
112
113
114
115
116
117
118
119
const defaultExtends = [
'tui',
'prettier',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
];
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
parser: 'typescript-eslint-parser',
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: [
'unused-imports',
'simple-import-sort',
'prettier',
'react',
'react-hooks',
'@typescript-eslint',
'jest',
],
extends: defaultExtends,
settings: {
react: {
pragma: 'h',
version: '16.13',
},
},
globals: {
fixture: true,
},
ignorePatterns: ['**/*.d.ts'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/ban-types': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'no-duplicate-imports': 'off',
'@typescript-eslint/no-duplicate-imports': 'error',
'no-shadow': 'off',
'no-use-before-define': 0,
// use unused-imports plugin
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{ args: 'after-used', argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'react/prop-types': 0,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'jest/no-conditional-expect': 0,
'simple-import-sort/imports': [
'warn',
{
groups: [
// Side effect imports.
['^\\u0000'],
// Preact.
['^preact'],
// Any other packages.
['^(\\w|@)(?!src/|test/|stories/|t/)'],
// Source files.
['^@src/'],
// stories files
['^@stories/'],
// Types.
['^@t/'],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything not matched in another group.
['^'],
// Relative imports.
// Anything that starts with a dot.
['^\\.'],
],
},
],
'simple-import-sort/exports': 'warn',
complexity: ['error', { max: 8 }],
'no-warning-comments': 0,
},
overrides: [
{
files: ['*.spec.ts', '*.spec.tsx'],
extends: ['plugin:jest/recommended'],
rules: {
'max-nested-callbacks': ['error', { max: 5 }],
'jest/expect-expect': [
'warn',
{
assertFunctionNames: ['expect', 'assert*'],
},
],
'jest/no-conditional-expect': 'warn',
},
},
{
files: ['apps/calendar/playwright/**/*.ts'],
extends: ['plugin:playwright/playwright-test'],
rules: {
'playwright/no-force-option': 'off',
'max-nested-callbacks': ['error', { max: 5 }],
'dot-notation': ['error', { allowKeywords: true }],
},
},
],
};