forked from xdan/jodit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
174 lines (167 loc) · 4.13 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
// eslint-disable-next-line strict
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
'header',
'mocha',
'eslint-plugin-tsdoc',
'simple-import-sort',
'import'
],
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended'
],
env: {
browser: true,
node: true
},
rules: {
complexity: ['warn', 20],
'no-octal-escape': 0,
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'mocha/no-skipped-tests': 'error',
'mocha/no-exclusive-tests': 'error',
'tsdoc/syntax': 'warn',
strict: ['error', 'never'],
'import/no-cycle': ['error', { maxDepth: 3 }],
'no-with': 'error',
'no-caller': 'error',
'no-delete-var': 'error',
'no-proto': 'off',
'valid-typeof': 'error',
'no-undef': 'off',
eqeqeq: ['error', 'always', { null: 'never' }],
'no-new': 'error',
'no-new-func': 'error',
'no-new-object': 'error',
'no-new-symbol': 'error',
'no-new-wrappers': 'error',
'no-array-constructor': 'error',
'new-parens': 'error',
'max-classes-per-file': ['error', 1],
'no-extend-native': 'off',
'no-global-assign': 'error',
'no-implicit-globals': 'error',
'no-implicit-coercion': 'error',
camelcase: 'off',
quotes: ['error', 'single', { avoidEscape: true }],
'quote-props': [
'error',
'as-needed',
{ keywords: false, numbers: false }
],
'jsx-quotes': 'error',
'header/header': [2, 'src/header.js'],
'no-mixed-spaces-and-tabs': 'off',
'no-empty': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-this-alias': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'error',
'no-fallthrough': 'off',
'no-console': ['error', { allow: ['warn', 'error', 'info'] }],
'simple-import-sort/exports': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'simple-import-sort/imports': [
'error',
{
groups: [
[
'jodit/types.*\\u0000$',
'jodit/types',
'jodit/.*\\u0000$',
'jodit/core',
'jodit/config',
'jodit/modules'
],
// Side effect imports.
['^\\u0000'],
// Parent imports. Put `..` last.
[
'^\\.\\.(?!/?$)\u0000',
'^\\.\\./?.*\\u0000$',
'^\\.\\.(?!/?$)',
'^\\.\\./?$'
],
// Other relative imports. Put same-folder imports and `.` last.
[
'^\\./?.*\\u0000$',
'^\\./(?=.*/)(?!/?$)',
'^\\.(?!/?$)',
'^\\./?$'
],
// Style imports.
['^.+\\.s?(css|less)$']
]
}
]
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/explicit-function-return-type': ['error']
}
}
],
globals: {
Set: true,
setCursorToChar: true,
createPoint: true,
afterEach: true,
SynchronousPromise: true,
mocha: true,
chai: true,
Promise: true,
defaultPermissions: true,
getOpenedPopup: true,
getOpenedDialog: true,
getBox: true,
offset: true,
i18nkeys: true,
appendTestDiv: true,
getButton: true,
clickTrigger: true,
clickButton: true,
sortAttributes: true,
onLoadImage: true,
sortStyles: true,
simulateEvent: true,
simulatePaste: true,
beforeEach: true,
describe: true,
it: true,
getJodit: true,
Jodit: true,
expect: true,
unmockPromise: true,
appendTestArea: true,
mockPromise: true,
fillBoxBr: true,
selectCells: true,
before: true,
after: true,
FileImage: true,
FileXLS: true
}
};