klaim 1.10.6 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -4
- package/deno.json +1 -1
- package/dist/klaim.es.js +31 -9
- package/eslint.config.mjs +211 -211
- package/package.json +5 -5
- package/src/core/Api.ts +6 -5
- package/src/core/Element.ts +256 -229
- package/src/core/Group.ts +9 -5
- package/src/core/Klaim.ts +207 -188
- package/src/core/Registry.ts +28 -21
- package/src/tools/rateLimit.ts +18 -18
- package/src/tools/timeout.ts +9 -2
- package/tests/01.api.test.ts +12 -7
- package/tests/02.route.test.ts +6 -4
- package/tests/03.hook.test.ts +2 -2
- package/tests/04.klaim.test.ts +2 -2
- package/tests/05.cache.test.ts +6 -6
- package/tests/06.retry.test.ts +54 -54
- package/tests/07.validate.test.ts +1 -1
- package/tests/09.pagination.test.ts +33 -33
- package/tests/10.ratelimit.test.ts +9 -9
- package/tests/11.timeout.test.ts +6 -6
package/README.md
CHANGED
|
@@ -42,10 +42,6 @@
|
|
|
42
42
|
- **Response Validation**: Validate responses using schemas for increased reliability and consistency.
|
|
43
43
|
- **Pagination**: Handle paginated requests easily with support for both page and offset based pagination.
|
|
44
44
|
|
|
45
|
-
## ⌛ Next features
|
|
46
|
-
|
|
47
|
-
- Error Handling (Version: 1.11)
|
|
48
|
-
|
|
49
45
|
## 📥 Installation
|
|
50
46
|
|
|
51
47
|
Install Klaim via npm:
|
|
@@ -451,6 +447,20 @@ parameters. Klaim does not handle the pagination logic, only the parameters mana
|
|
|
451
447
|
- [JSR](https://jsr.io/@antharuu/klaim)
|
|
452
448
|
- [GitHub](https://github.com/antharuu/klaim)
|
|
453
449
|
|
|
450
|
+
## 📢 Project Status
|
|
451
|
+
|
|
452
|
+
Klaim is now considered **feature complete**. The library has reached a state where it provides all the core functionality originally envisioned *(even more)*, and no new features are currently planned.
|
|
453
|
+
|
|
454
|
+
However, this doesn't mean the project is abandoned:
|
|
455
|
+
|
|
456
|
+
- **Bug fixes and maintenance** will continue to be addressed
|
|
457
|
+
- **Issues** remain open for bug reports and suggestions
|
|
458
|
+
- **Pull requests** are welcome if you'd like to contribute additional features or improvements
|
|
459
|
+
|
|
460
|
+
If you have ideas for new features that would enhance Klaim, please feel free to open an issue to discuss them. Collaborative contributions through pull requests are especially appreciated!
|
|
461
|
+
|
|
462
|
+
Thank you for your interest in this project. I personally will be moving on to focus on other libraries, but I'm grateful for all the support and feedback the community has provided.
|
|
463
|
+
|
|
454
464
|
## 🤝 Contributing
|
|
455
465
|
|
|
456
466
|
Contributions are welcome! Please see the [Contributing Guide](CONTRIBUTING.md) for more details.
|
package/deno.json
CHANGED
package/dist/klaim.es.js
CHANGED
|
@@ -16,9 +16,7 @@ function F(n, t) {
|
|
|
16
16
|
const e = Date.now(), a = t.duration * 1e3;
|
|
17
17
|
let r = A.get(n);
|
|
18
18
|
r || (r = { timestamps: [] }, A.set(n, r));
|
|
19
|
-
const i = r.timestamps.filter(
|
|
20
|
-
(s) => e - s < a
|
|
21
|
-
);
|
|
19
|
+
const i = r.timestamps.filter((s) => e - s < a);
|
|
22
20
|
return i.length >= t.limit ? !1 : (i.push(e), r.timestamps = i, !0);
|
|
23
21
|
}
|
|
24
22
|
function S(n, t) {
|
|
@@ -52,10 +50,11 @@ const H = {
|
|
|
52
50
|
class k {
|
|
53
51
|
/**
|
|
54
52
|
* Creates a new element with the specified properties
|
|
53
|
+
*
|
|
55
54
|
* @param {("api"|"route"|"group")} type - Element type identifier
|
|
56
55
|
* @param {string} name - Unique name for the element
|
|
57
56
|
* @param {string} url - Base URL or path segment
|
|
58
|
-
* @param {IHeaders} [headers
|
|
57
|
+
* @param {IHeaders} [headers] - HTTP headers for the element
|
|
59
58
|
*/
|
|
60
59
|
constructor(t, e, a, r = {}) {
|
|
61
60
|
o(this, "type");
|
|
@@ -78,18 +77,21 @@ class k {
|
|
|
78
77
|
o(this, "timeout", !1);
|
|
79
78
|
/**
|
|
80
79
|
* Enables response caching for this element
|
|
81
|
-
*
|
|
80
|
+
*
|
|
81
|
+
* @param {number} [duration] - Cache duration in seconds
|
|
82
82
|
* @returns {this} The element instance for chaining
|
|
83
83
|
*/
|
|
84
84
|
o(this, "withCache", (t = 20) => (this.cache = t, this));
|
|
85
85
|
/**
|
|
86
86
|
* Enables request retries for this element
|
|
87
|
-
*
|
|
87
|
+
*
|
|
88
|
+
* @param {number} [maxRetries] - Maximum number of retry attempts
|
|
88
89
|
* @returns {this} The element instance for chaining
|
|
89
90
|
*/
|
|
90
91
|
o(this, "withRetry", (t = 2) => (this.retry = t, this));
|
|
91
92
|
/**
|
|
92
93
|
* Enables rate limiting for this element
|
|
94
|
+
*
|
|
93
95
|
* @param {Partial<IRateLimitConfig>} [config] - Rate limiting configuration options
|
|
94
96
|
* @returns {this} The element instance for chaining
|
|
95
97
|
* @example
|
|
@@ -103,6 +105,7 @@ class k {
|
|
|
103
105
|
}, this));
|
|
104
106
|
/**
|
|
105
107
|
* Enables request timeout for this element
|
|
108
|
+
*
|
|
106
109
|
* @param {number} [duration] - Timeout duration in seconds
|
|
107
110
|
* @param {string} [message] - Custom error message
|
|
108
111
|
* @returns {this} The element instance for chaining
|
|
@@ -112,6 +115,7 @@ class k {
|
|
|
112
115
|
}
|
|
113
116
|
/**
|
|
114
117
|
* Adds a before-request middleware callback
|
|
118
|
+
*
|
|
115
119
|
* @param {ICallback<ICallbackBeforeArgs>} callback - Function to execute before the request
|
|
116
120
|
* @returns {this} The element instance for chaining
|
|
117
121
|
*/
|
|
@@ -120,6 +124,7 @@ class k {
|
|
|
120
124
|
}
|
|
121
125
|
/**
|
|
122
126
|
* Adds an after-request middleware callback
|
|
127
|
+
*
|
|
123
128
|
* @param {ICallback<ICallbackAfterArgs>} callback - Function to execute after the response
|
|
124
129
|
* @returns {this} The element instance for chaining
|
|
125
130
|
*/
|
|
@@ -128,6 +133,7 @@ class k {
|
|
|
128
133
|
}
|
|
129
134
|
/**
|
|
130
135
|
* Adds a request lifecycle middleware callback
|
|
136
|
+
*
|
|
131
137
|
* @param {ICallback<ICallbackCallArgs>} callback - Function to execute during the request
|
|
132
138
|
* @returns {this} The element instance for chaining
|
|
133
139
|
*/
|
|
@@ -136,7 +142,8 @@ class k {
|
|
|
136
142
|
}
|
|
137
143
|
/**
|
|
138
144
|
* Configures pagination settings for this element
|
|
139
|
-
*
|
|
145
|
+
*
|
|
146
|
+
* @param {IPaginationConfig} [config] - Pagination configuration options
|
|
140
147
|
* @returns {this} The element instance for chaining
|
|
141
148
|
* @example
|
|
142
149
|
* ```typescript
|
|
@@ -311,7 +318,11 @@ const R = {};
|
|
|
311
318
|
function V(n, t) {
|
|
312
319
|
return async (...e) => {
|
|
313
320
|
if (t.pagination) {
|
|
314
|
-
const [
|
|
321
|
+
const [
|
|
322
|
+
i = 0,
|
|
323
|
+
s = {},
|
|
324
|
+
l = {}
|
|
325
|
+
] = e;
|
|
315
326
|
return N(n, t, i, s, l);
|
|
316
327
|
}
|
|
317
328
|
const [a = {}, r = {}] = e;
|
|
@@ -416,20 +427,26 @@ function Y({ route: n, api: t, response: e, data: a }) {
|
|
|
416
427
|
};
|
|
417
428
|
}
|
|
418
429
|
const f = class f {
|
|
430
|
+
/**
|
|
431
|
+
*
|
|
432
|
+
*/
|
|
419
433
|
constructor() {
|
|
420
434
|
/**
|
|
421
435
|
* Map storing all registered elements with their full paths as keys
|
|
436
|
+
*
|
|
422
437
|
* @private
|
|
423
438
|
*/
|
|
424
439
|
o(this, "_elements", /* @__PURE__ */ new Map());
|
|
425
440
|
/**
|
|
426
441
|
* Reference to the current parent element during registration
|
|
442
|
+
*
|
|
427
443
|
* @private
|
|
428
444
|
*/
|
|
429
445
|
o(this, "_currentParent", null);
|
|
430
446
|
}
|
|
431
447
|
/**
|
|
432
448
|
* Gets the singleton instance of the Registry
|
|
449
|
+
*
|
|
433
450
|
* @returns The singleton Registry instance
|
|
434
451
|
*/
|
|
435
452
|
static get i() {
|
|
@@ -461,6 +478,7 @@ const f = class f {
|
|
|
461
478
|
}
|
|
462
479
|
/**
|
|
463
480
|
* Gets the current parent element in the registration context
|
|
481
|
+
*
|
|
464
482
|
* @returns The current parent element or null if none is set
|
|
465
483
|
*/
|
|
466
484
|
getCurrentParent() {
|
|
@@ -659,7 +677,7 @@ class x extends k {
|
|
|
659
677
|
* Group.create("admin", () => {
|
|
660
678
|
* Route.get("list", "/admin/users");
|
|
661
679
|
* });
|
|
662
|
-
*
|
|
680
|
+
*
|
|
663
681
|
* // Group multiple APIs
|
|
664
682
|
* Group.create("shared", () => {
|
|
665
683
|
* Api.create("users", "https://users-api.com", () => {
|
|
@@ -729,6 +747,10 @@ class x extends k {
|
|
|
729
747
|
/**
|
|
730
748
|
* Enables request timeout for the group and its children.
|
|
731
749
|
* Children can override with their own timeout configuration.
|
|
750
|
+
*
|
|
751
|
+
* @param duration - Timeout duration in seconds
|
|
752
|
+
* @param message - Error message if the timeout is reached
|
|
753
|
+
* @returns The current instance for chaining
|
|
732
754
|
*/
|
|
733
755
|
withTimeout(t = $.duration, e = $.message) {
|
|
734
756
|
return super.withTimeout(t, e), c.i.getChildren(c.i.getFullPath(this)).forEach((a) => {
|
package/eslint.config.mjs
CHANGED
|
@@ -1,211 +1,211 @@
|
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
1
|
+
// @ts-check
|
|
2
|
+
import stylistic from '@stylistic/eslint-plugin';
|
|
3
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
4
|
+
import JSdoc from 'eslint-plugin-jsdoc';
|
|
5
|
+
|
|
6
|
+
import eslint from '@eslint/js';
|
|
7
|
+
import tseslint from 'typescript-eslint';
|
|
8
|
+
|
|
9
|
+
export default tseslint.config(
|
|
10
|
+
eslint.configs.recommended,
|
|
11
|
+
...tseslint.configs.recommended,
|
|
12
|
+
{
|
|
13
|
+
plugins: {
|
|
14
|
+
'@stylistic': stylistic,
|
|
15
|
+
'simple-import-sort': simpleImportSort,
|
|
16
|
+
jsdoc: JSdoc
|
|
17
|
+
},
|
|
18
|
+
files: ['src/**/*.ts'],
|
|
19
|
+
rules: {
|
|
20
|
+
// ----------------------------------------
|
|
21
|
+
// ---------------------- Simple Import Sort
|
|
22
|
+
// ----------------------------------------
|
|
23
|
+
'simple-import-sort/exports': 'error',
|
|
24
|
+
'simple-import-sort/imports': [
|
|
25
|
+
'error',
|
|
26
|
+
{
|
|
27
|
+
groups: [
|
|
28
|
+
['^\\u0000'],
|
|
29
|
+
['^@?\\w'],
|
|
30
|
+
['^/'],
|
|
31
|
+
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
|
|
32
|
+
[
|
|
33
|
+
'^\\./(?=.*/)(?!/?$)',
|
|
34
|
+
'^\\.(?!/?$)',
|
|
35
|
+
'^\\./?$'
|
|
36
|
+
],
|
|
37
|
+
['^.+\\.s?css$']
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
// ----------------------------------------
|
|
42
|
+
// ---------------------- TypeScript
|
|
43
|
+
// ----------------------------------------
|
|
44
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
45
|
+
'@typescript-eslint/ban-ts-comment': 'off',
|
|
46
|
+
'@typescript-eslint/no-dynamic-delete': 'off',
|
|
47
|
+
'@typescript-eslint/no-namespace': 'off',
|
|
48
|
+
'@typescript-eslint/no-empty-object-type': 'off',
|
|
49
|
+
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
50
|
+
'@typescript-eslint/consistent-indexed-object-style': 'error',
|
|
51
|
+
'@typescript-eslint/no-unused-expressions': 'error',
|
|
52
|
+
|
|
53
|
+
// ----------------------------------------
|
|
54
|
+
// ---------------------- Stylistic
|
|
55
|
+
// ----------------------------------------
|
|
56
|
+
'@stylistic/array-bracket-spacing': ['error', 'always'],
|
|
57
|
+
'@stylistic/function-paren-newline': ['error', 'multiline'],
|
|
58
|
+
'@stylistic/multiline-ternary': ['error', 'always-multiline'],
|
|
59
|
+
'@stylistic/quotes': [
|
|
60
|
+
'error',
|
|
61
|
+
'double',
|
|
62
|
+
{
|
|
63
|
+
avoidEscape: true,
|
|
64
|
+
allowTemplateLiterals: true
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
'@stylistic/semi': [
|
|
68
|
+
'error',
|
|
69
|
+
'always',
|
|
70
|
+
{
|
|
71
|
+
omitLastInOneLineBlock: true,
|
|
72
|
+
omitLastInOneLineClassBody: true
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
'@stylistic/space-before-function-paren': ['error', 'always'],
|
|
76
|
+
'@stylistic/space-in-parens': ['error', 'never'],
|
|
77
|
+
'@stylistic/space-infix-ops': ['error', { int32Hint: false }],
|
|
78
|
+
'@stylistic/space-before-blocks': ['error', 'always'],
|
|
79
|
+
'@stylistic/space-unary-ops': ['error', { words: true, nonwords: false }],
|
|
80
|
+
'@stylistic/keyword-spacing': ['error', { before: true, after: true }],
|
|
81
|
+
'@stylistic/block-spacing': ['error', 'always'],
|
|
82
|
+
'@stylistic/comma-dangle': ['error', 'never'],
|
|
83
|
+
'@stylistic/array-bracket-newline': ['error', { multiline: true }],
|
|
84
|
+
'@stylistic/array-element-newline': ['error', { multiline: true, minItems: 3 }],
|
|
85
|
+
'@stylistic/object-curly-newline': ['error', { multiline: true, consistent: true }],
|
|
86
|
+
'@stylistic/max-len': [
|
|
87
|
+
'error',
|
|
88
|
+
{
|
|
89
|
+
code: 120,
|
|
90
|
+
tabWidth: 4,
|
|
91
|
+
ignoreComments: true,
|
|
92
|
+
ignoreUrls: true,
|
|
93
|
+
ignoreStrings: true,
|
|
94
|
+
ignoreTemplateLiterals: true,
|
|
95
|
+
ignoreRegExpLiterals: true,
|
|
96
|
+
ignorePattern: 'd=.*'
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
'@stylistic/padded-blocks': ['error', 'never'],
|
|
100
|
+
'@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }],
|
|
101
|
+
'@stylistic/eol-last': ['error', 'always'],
|
|
102
|
+
'@stylistic/lines-between-class-members': ['error', 'always'],
|
|
103
|
+
'@stylistic/brace-style': [
|
|
104
|
+
'error',
|
|
105
|
+
'1tbs',
|
|
106
|
+
{ allowSingleLine: true }
|
|
107
|
+
],
|
|
108
|
+
'@stylistic/object-curly-spacing': ['error', 'always'],
|
|
109
|
+
'@stylistic/arrow-spacing': ['error', { before: true, after: true }],
|
|
110
|
+
'@stylistic/implicit-arrow-linebreak': ['error', 'beside'],
|
|
111
|
+
'@stylistic/arrow-parens': ['error', 'as-needed'],
|
|
112
|
+
'@stylistic/no-trailing-spaces': ['error'],
|
|
113
|
+
'@stylistic/no-tabs': ['error'],
|
|
114
|
+
'@stylistic/no-whitespace-before-property': ['error'],
|
|
115
|
+
'@stylistic/template-curly-spacing': ['error', 'never'],
|
|
116
|
+
'@stylistic/rest-spread-spacing': ['error', 'never'],
|
|
117
|
+
'@stylistic/operator-linebreak': ['error', 'before'],
|
|
118
|
+
'@stylistic/type-annotation-spacing': [
|
|
119
|
+
'error',
|
|
120
|
+
{
|
|
121
|
+
before: false,
|
|
122
|
+
after: true,
|
|
123
|
+
overrides: {
|
|
124
|
+
arrow: {
|
|
125
|
+
before: true,
|
|
126
|
+
after: true
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
'@stylistic/type-generic-spacing': ['error'],
|
|
132
|
+
'@stylistic/type-named-tuple-spacing': ['error'],
|
|
133
|
+
|
|
134
|
+
// ----------------------------------------
|
|
135
|
+
// ---------------------- JSdoc
|
|
136
|
+
// ----------------------------------------
|
|
137
|
+
'jsdoc/check-access': 'error',
|
|
138
|
+
'jsdoc/check-alignment': 'error',
|
|
139
|
+
'jsdoc/check-param-names': 'error',
|
|
140
|
+
'jsdoc/check-property-names': 'error',
|
|
141
|
+
'jsdoc/check-tag-names': 'error',
|
|
142
|
+
'jsdoc/check-types': 'error',
|
|
143
|
+
'jsdoc/check-values': 'error',
|
|
144
|
+
'jsdoc/empty-tags': 'error',
|
|
145
|
+
'jsdoc/implements-on-classes': 'error',
|
|
146
|
+
'jsdoc/multiline-blocks': 'error',
|
|
147
|
+
'jsdoc/no-defaults': 'error',
|
|
148
|
+
'jsdoc/no-multi-asterisks': 'error',
|
|
149
|
+
'jsdoc/require-jsdoc': [
|
|
150
|
+
'error',
|
|
151
|
+
{
|
|
152
|
+
require: {
|
|
153
|
+
FunctionDeclaration: true,
|
|
154
|
+
MethodDefinition: true,
|
|
155
|
+
ClassDeclaration: true,
|
|
156
|
+
ArrowFunctionExpression: true,
|
|
157
|
+
FunctionExpression: true
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
'jsdoc/require-param': 'error',
|
|
162
|
+
'jsdoc/require-param-description': 'error',
|
|
163
|
+
'jsdoc/require-param-name': 'error',
|
|
164
|
+
'jsdoc/require-property': 'error',
|
|
165
|
+
'jsdoc/require-property-description': 'error',
|
|
166
|
+
'jsdoc/require-property-name': 'error',
|
|
167
|
+
'jsdoc/require-returns': 'error',
|
|
168
|
+
'jsdoc/require-returns-check': 'error',
|
|
169
|
+
'jsdoc/require-returns-description': 'error',
|
|
170
|
+
'jsdoc/require-yields': 'error',
|
|
171
|
+
'jsdoc/require-yields-check': 'error',
|
|
172
|
+
'jsdoc/tag-lines': [
|
|
173
|
+
'error',
|
|
174
|
+
'never',
|
|
175
|
+
{
|
|
176
|
+
applyToEndTag: false,
|
|
177
|
+
count: 1,
|
|
178
|
+
startLines: 1,
|
|
179
|
+
endLines: 0
|
|
180
|
+
}
|
|
181
|
+
],
|
|
182
|
+
'jsdoc/valid-types': 'error',
|
|
183
|
+
|
|
184
|
+
// ----------------------------------------
|
|
185
|
+
// ---------------------- General
|
|
186
|
+
// ----------------------------------------
|
|
187
|
+
|
|
188
|
+
'no-void': 'off',
|
|
189
|
+
'no-undef': 'off',
|
|
190
|
+
indent: ['error', 4],
|
|
191
|
+
'no-console': [
|
|
192
|
+
'error',
|
|
193
|
+
{
|
|
194
|
+
allow: ['warn', 'error', 'info', 'table']
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
camelcase: [
|
|
198
|
+
'error',
|
|
199
|
+
{
|
|
200
|
+
properties: 'never',
|
|
201
|
+
ignoreDestructuring: true,
|
|
202
|
+
allow: ['^_[a-z]+_[a-z]+$']
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
'dot-notation': 'off',
|
|
206
|
+
'no-underscore-dangle': 'off',
|
|
207
|
+
'func-style': ['error', 'declaration'],
|
|
208
|
+
'no-unused-expressions': 'off'
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
);
|