@dereekb/util 13.11.13 → 13.11.15
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/eslint/index.cjs.js +10008 -394
- package/eslint/index.esm.js +9982 -392
- package/eslint/package.json +4 -4
- package/eslint/src/lib/comments.d.ts +14 -3
- package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
- package/eslint/src/lib/index.d.ts +26 -3
- package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
- package/eslint/src/lib/no-inline-string-empty-object-intersection.rule.d.ts +44 -0
- package/eslint/src/lib/no-inline-type-import.rule.d.ts +38 -0
- package/eslint/src/lib/no-sister-re-export.rule.d.ts +69 -0
- package/eslint/src/lib/plugin.d.ts +52 -1
- package/eslint/src/lib/prefer-canonical-jsdoc.rule.d.ts +68 -0
- package/eslint/src/lib/prefer-config-object.rule.d.ts +61 -0
- package/eslint/src/lib/prefer-maybe-type.rule.d.ts +72 -0
- package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +1 -1
- package/eslint/src/lib/prefer-suggested-string.rule.d.ts +51 -0
- package/eslint/src/lib/require-constant-naming.rule.d.ts +63 -0
- package/eslint/src/lib/require-dbx-action-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-auth-companion-tags.rule.d.ts +45 -0
- package/eslint/src/lib/require-dbx-docs-ui-example-companion-tags.rule.d.ts +42 -0
- package/eslint/src/lib/require-dbx-filter-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-form-field-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-companion-tags.rule.d.ts +46 -0
- package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-model-snapshot-field-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-pipe-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-dbx-rule-companion-tags.rule.d.ts +44 -0
- package/eslint/src/lib/require-dbx-util-companion-tags.rule.d.ts +74 -0
- package/eslint/src/lib/require-dbx-web-companion-tags.rule.d.ts +43 -0
- package/eslint/src/lib/require-default-prefix-naming.rule.d.ts +60 -0
- package/eslint/src/lib/require-deprecated-alias-placement.rule.d.ts +75 -0
- package/eslint/src/lib/require-exported-jsdoc-example.rule.d.ts +61 -0
- package/eslint/src/lib/require-no-side-effects.rule.d.ts +1 -1
- package/eslint/src/lib/require-readonly-config-params.rule.d.ts +57 -0
- package/eslint/src/lib/require-single-return.rule.d.ts +42 -0
- package/fetch/index.cjs.js +95 -80
- package/fetch/index.esm.js +95 -80
- package/fetch/package.json +2 -2
- package/fetch/src/lib/error.d.ts +2 -2
- package/fetch/src/lib/fetch.d.ts +15 -15
- package/fetch/src/lib/fetch.file.d.ts +5 -5
- package/fetch/src/lib/fetch.limit.d.ts +2 -2
- package/fetch/src/lib/fetch.page.d.ts +1 -1
- package/fetch/src/lib/fetch.page.iterate.d.ts +4 -4
- package/fetch/src/lib/fetch.type.d.ts +3 -2
- package/fetch/src/lib/fetch.url.d.ts +13 -13
- package/fetch/src/lib/json.d.ts +12 -12
- package/fetch/src/lib/timeout.d.ts +2 -2
- package/fetch/src/lib/url.d.ts +11 -11
- package/index.cjs.js +2592 -2329
- package/index.esm.js +2590 -2327
- package/package.json +1 -1
- package/src/lib/array/array.boolean.d.ts +20 -20
- package/src/lib/array/array.d.ts +73 -72
- package/src/lib/array/array.factory.d.ts +8 -5
- package/src/lib/array/array.filter.d.ts +23 -20
- package/src/lib/array/array.find.d.ts +9 -8
- package/src/lib/array/array.index.d.ts +15 -14
- package/src/lib/array/array.indexed.d.ts +22 -19
- package/src/lib/array/array.make.d.ts +3 -2
- package/src/lib/array/array.map.d.ts +5 -5
- package/src/lib/array/array.number.d.ts +27 -27
- package/src/lib/array/array.random.d.ts +11 -10
- package/src/lib/array/array.set.d.ts +14 -14
- package/src/lib/array/array.string.d.ts +31 -31
- package/src/lib/array/array.unique.d.ts +22 -20
- package/src/lib/array/array.value.d.ts +3 -2
- package/src/lib/assertion/assert.error.d.ts +8 -8
- package/src/lib/assertion/assertion.d.ts +5 -5
- package/src/lib/assertion/assertion.generic.d.ts +3 -3
- package/src/lib/assertion/assertion.number.d.ts +6 -6
- package/src/lib/auth/auth.role.claims.d.ts +12 -11
- package/src/lib/auth/auth.role.d.ts +3 -3
- package/src/lib/auth/pkce.d.ts +2 -2
- package/src/lib/boolean.d.ts +11 -11
- package/src/lib/cache/cache.memoize.d.ts +6 -6
- package/src/lib/contact/domain.d.ts +9 -9
- package/src/lib/contact/email.d.ts +11 -11
- package/src/lib/contact/phone.d.ts +12 -12
- package/src/lib/contact/random.d.ts +11 -9
- package/src/lib/date/date.d.ts +60 -59
- package/src/lib/date/date.time.d.ts +2 -2
- package/src/lib/date/date.unix.d.ts +8 -8
- package/src/lib/date/duration.d.ts +17 -17
- package/src/lib/date/expires.d.ts +29 -27
- package/src/lib/date/hour.d.ts +23 -23
- package/src/lib/date/minute.d.ts +6 -6
- package/src/lib/date/time.d.ts +10 -9
- package/src/lib/date/week.d.ts +32 -31
- package/src/lib/encryption/encryption.object.d.ts +3 -3
- package/src/lib/error/error.d.ts +13 -12
- package/src/lib/error/error.server.d.ts +4 -4
- package/src/lib/file/pdf.d.ts +4 -4
- package/src/lib/filter/filter.d.ts +3 -2
- package/src/lib/function/function.boolean.d.ts +4 -3
- package/src/lib/function/function.forward.d.ts +6 -4
- package/src/lib/getter/getter.d.ts +24 -19
- package/src/lib/getter/getter.map.d.ts +6 -5
- package/src/lib/getter/getter.util.d.ts +3 -2
- package/src/lib/grouping.d.ts +25 -24
- package/src/lib/hash.d.ts +11 -10
- package/src/lib/iterable/iterable.d.ts +39 -39
- package/src/lib/iterable/iterable.map.d.ts +3 -3
- package/src/lib/key.d.ts +16 -16
- package/src/lib/map/map.d.ts +12 -12
- package/src/lib/map/map.intersection.d.ts +3 -3
- package/src/lib/map/map.key.d.ts +16 -14
- package/src/lib/misc/host.d.ts +2 -2
- package/src/lib/model/id.batch.d.ts +4 -3
- package/src/lib/model/id.factory.d.ts +4 -3
- package/src/lib/model/model.conversion.d.ts +19 -14
- package/src/lib/model/model.conversion.field.d.ts +2 -2
- package/src/lib/model/model.copy.d.ts +5 -4
- package/src/lib/model/model.d.ts +48 -46
- package/src/lib/model/model.modify.d.ts +10 -8
- package/src/lib/nodejs/stream.d.ts +6 -5
- package/src/lib/number/bitwise.dencoder.d.ts +12 -12
- package/src/lib/number/bound.d.ts +16 -13
- package/src/lib/number/dollar.d.ts +6 -5
- package/src/lib/number/encoded.d.ts +7 -7
- package/src/lib/number/factory.d.ts +4 -3
- package/src/lib/number/number.d.ts +37 -37
- package/src/lib/number/random.d.ts +11 -10
- package/src/lib/number/round.d.ts +34 -30
- package/src/lib/number/sort.d.ts +3 -2
- package/src/lib/number/transform.d.ts +5 -4
- package/src/lib/object/object.array.d.ts +6 -6
- package/src/lib/object/object.array.delta.d.ts +3 -2
- package/src/lib/object/object.d.ts +12 -12
- package/src/lib/object/object.empty.d.ts +3 -3
- package/src/lib/object/object.equal.d.ts +11 -10
- package/src/lib/object/object.filter.pojo.d.ts +74 -74
- package/src/lib/object/object.filter.tuple.d.ts +26 -26
- package/src/lib/object/object.flatten.d.ts +4 -4
- package/src/lib/object/object.key.d.ts +6 -4
- package/src/lib/object/object.map.d.ts +15 -13
- package/src/lib/page/page.d.ts +5 -5
- package/src/lib/page/page.filter.d.ts +8 -8
- package/src/lib/path/path.d.ts +98 -88
- package/src/lib/promise/callback.d.ts +2 -2
- package/src/lib/promise/is.d.ts +6 -6
- package/src/lib/promise/poll.d.ts +9 -9
- package/src/lib/promise/promise.d.ts +33 -30
- package/src/lib/promise/promise.factory.d.ts +4 -3
- package/src/lib/promise/promise.loop.d.ts +11 -11
- package/src/lib/promise/promise.task.d.ts +6 -5
- package/src/lib/promise/promise.type.d.ts +3 -3
- package/src/lib/promise/use.d.ts +3 -3
- package/src/lib/relation/relation.d.ts +15 -15
- package/src/lib/service/handler.config.d.ts +20 -16
- package/src/lib/service/handler.d.ts +3 -2
- package/src/lib/service/typed.service.d.ts +2 -2
- package/src/lib/set/set.d.ts +62 -59
- package/src/lib/set/set.delta.d.ts +5 -4
- package/src/lib/set/set.hashset.d.ts +5 -5
- package/src/lib/set/set.selection.d.ts +5 -4
- package/src/lib/sort.d.ts +11 -11
- package/src/lib/storage/storage.d.ts +2 -1
- package/src/lib/storage/storage.error.d.ts +4 -4
- package/src/lib/storage/storage.memory.d.ts +7 -7
- package/src/lib/storage/storage.object.d.ts +5 -5
- package/src/lib/string/case.d.ts +6 -6
- package/src/lib/string/char.d.ts +30 -29
- package/src/lib/string/dencoder.d.ts +25 -20
- package/src/lib/string/factory.d.ts +11 -8
- package/src/lib/string/html.d.ts +19 -19
- package/src/lib/string/mimetype.d.ts +9 -8
- package/src/lib/string/prefix.d.ts +8 -8
- package/src/lib/string/replace.d.ts +45 -39
- package/src/lib/string/search.d.ts +5 -4
- package/src/lib/string/sort.d.ts +13 -4
- package/src/lib/string/string.d.ts +44 -43
- package/src/lib/string/transform.d.ts +32 -23
- package/src/lib/string/tree.d.ts +5 -4
- package/src/lib/string/url.d.ts +5 -4
- package/src/lib/tree/tree.array.d.ts +5 -4
- package/src/lib/tree/tree.expand.d.ts +6 -6
- package/src/lib/tree/tree.explore.d.ts +13 -10
- package/src/lib/tree/tree.flatten.d.ts +10 -10
- package/src/lib/type.d.ts +42 -12
- package/src/lib/value/address.d.ts +7 -7
- package/src/lib/value/bound.d.ts +70 -66
- package/src/lib/value/build.d.ts +6 -6
- package/src/lib/value/comparator.d.ts +19 -17
- package/src/lib/value/cron.d.ts +2 -2
- package/src/lib/value/decision.d.ts +6 -5
- package/src/lib/value/equal.d.ts +11 -9
- package/src/lib/value/indexed.d.ts +101 -85
- package/src/lib/value/label.d.ts +2 -2
- package/src/lib/value/map.d.ts +20 -16
- package/src/lib/value/maybe.d.ts +36 -36
- package/src/lib/value/modifier.d.ts +24 -23
- package/src/lib/value/point.d.ts +85 -77
- package/src/lib/value/url.d.ts +2 -2
- package/src/lib/value/use.d.ts +36 -33
- package/src/lib/value/vector.d.ts +15 -14
- package/test/index.cjs.js +41 -36
- package/test/index.esm.js +41 -36
- package/test/package.json +2 -2
- package/test/src/lib/jest/jest.fail.d.ts +2 -2
- package/test/src/lib/shared/shared.d.ts +20 -20
- package/test/src/lib/shared/shared.fail.d.ts +21 -16
- package/test/src/lib/shared/shared.function.d.ts +4 -4
- package/test/src/lib/shared/shared.wrap.d.ts +10 -10
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Maybe } from '@dereekb/util';
|
|
2
|
+
interface AstNode {
|
|
3
|
+
readonly type: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Options for the require-dbx-model-firebase-index-companion-tags rule.
|
|
8
|
+
*/
|
|
9
|
+
export interface UtilRequireDbxModelFirebaseIndexCompanionTagsRuleOptions {
|
|
10
|
+
readonly allowedScopes?: readonly string[];
|
|
11
|
+
readonly knownCompanions?: readonly string[];
|
|
12
|
+
readonly requireBareMarker?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ESLint rule definition for require-dbx-model-firebase-index-companion-tags.
|
|
16
|
+
*/
|
|
17
|
+
export interface UtilRequireDbxModelFirebaseIndexCompanionTagsRuleDefinition {
|
|
18
|
+
readonly meta: {
|
|
19
|
+
readonly type: 'suggestion';
|
|
20
|
+
readonly fixable: 'code';
|
|
21
|
+
readonly docs: {
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly recommended: boolean;
|
|
24
|
+
};
|
|
25
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
26
|
+
readonly schema: readonly object[];
|
|
27
|
+
};
|
|
28
|
+
create(context: {
|
|
29
|
+
options: UtilRequireDbxModelFirebaseIndexCompanionTagsRuleOptions[];
|
|
30
|
+
report: (descriptor: {
|
|
31
|
+
loc?: AstNode;
|
|
32
|
+
messageId: string;
|
|
33
|
+
data?: Record<string, string>;
|
|
34
|
+
fix?: (fixer: AstNode) => Maybe<AstNode | AstNode[]>;
|
|
35
|
+
}) => void;
|
|
36
|
+
sourceCode: AstNode;
|
|
37
|
+
}): Record<string, (node: AstNode) => void>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ESLint rule enforcing `@dbxModelFirebaseIndex` companion tags. Mirrors the
|
|
41
|
+
* scanner schema at `packages/dbx-components-mcp/src/scan/model-firebase-index-extract.ts`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const UTIL_REQUIRE_DBX_MODEL_FIREBASE_INDEX_COMPANION_TAGS_RULE: UtilRequireDbxModelFirebaseIndexCompanionTagsRuleDefinition;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Maybe } from '@dereekb/util';
|
|
2
|
+
interface AstNode {
|
|
3
|
+
readonly type: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Options for the require-dbx-model-snapshot-field-companion-tags rule.
|
|
8
|
+
*/
|
|
9
|
+
export interface UtilRequireDbxModelSnapshotFieldCompanionTagsRuleOptions {
|
|
10
|
+
readonly allowedKinds?: readonly string[];
|
|
11
|
+
readonly knownCompanions?: readonly string[];
|
|
12
|
+
readonly requireBareMarker?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ESLint rule definition for require-dbx-model-snapshot-field-companion-tags.
|
|
16
|
+
*/
|
|
17
|
+
export interface UtilRequireDbxModelSnapshotFieldCompanionTagsRuleDefinition {
|
|
18
|
+
readonly meta: {
|
|
19
|
+
readonly type: 'suggestion';
|
|
20
|
+
readonly fixable: 'code';
|
|
21
|
+
readonly docs: {
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly recommended: boolean;
|
|
24
|
+
};
|
|
25
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
26
|
+
readonly schema: readonly object[];
|
|
27
|
+
};
|
|
28
|
+
create(context: {
|
|
29
|
+
options: UtilRequireDbxModelSnapshotFieldCompanionTagsRuleOptions[];
|
|
30
|
+
report: (descriptor: {
|
|
31
|
+
loc?: AstNode;
|
|
32
|
+
messageId: string;
|
|
33
|
+
data?: Record<string, string>;
|
|
34
|
+
fix?: (fixer: AstNode) => Maybe<AstNode | AstNode[]>;
|
|
35
|
+
}) => void;
|
|
36
|
+
sourceCode: AstNode;
|
|
37
|
+
}): Record<string, (node: AstNode) => void>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ESLint rule enforcing `@dbxModelSnapshotField` companion tags. Mirrors the
|
|
41
|
+
* scanner schema at `packages/dbx-components-mcp/src/scan/model-snapshot-fields-extract.ts`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const UTIL_REQUIRE_DBX_MODEL_SNAPSHOT_FIELD_COMPANION_TAGS_RULE: UtilRequireDbxModelSnapshotFieldCompanionTagsRuleDefinition;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-pipe-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxPipeCompanionTagsRuleOptions {
|
|
9
|
+
readonly allowedCategories?: readonly string[];
|
|
10
|
+
readonly knownCompanions?: readonly string[];
|
|
11
|
+
readonly requireBareMarker?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ESLint rule definition for require-dbx-pipe-companion-tags.
|
|
15
|
+
*/
|
|
16
|
+
export interface UtilRequireDbxPipeCompanionTagsRuleDefinition {
|
|
17
|
+
readonly meta: {
|
|
18
|
+
readonly type: 'suggestion';
|
|
19
|
+
readonly fixable: 'code';
|
|
20
|
+
readonly docs: {
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly recommended: boolean;
|
|
23
|
+
};
|
|
24
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
25
|
+
readonly schema: readonly object[];
|
|
26
|
+
};
|
|
27
|
+
create(context: {
|
|
28
|
+
options: UtilRequireDbxPipeCompanionTagsRuleOptions[];
|
|
29
|
+
report: (descriptor: {
|
|
30
|
+
loc?: AstNode;
|
|
31
|
+
messageId: string;
|
|
32
|
+
data?: Record<string, string>;
|
|
33
|
+
}) => void;
|
|
34
|
+
sourceCode: AstNode;
|
|
35
|
+
}): Record<string, (node: AstNode) => void>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* ESLint rule enforcing `@dbxPipe` companion tags. Mirrors the scanner schema
|
|
39
|
+
* at `packages/dbx-components-mcp/src/scan/pipes-extract.ts` so violations
|
|
40
|
+
* surface at lint time instead of at manifest-regeneration time.
|
|
41
|
+
*/
|
|
42
|
+
export declare const UTIL_REQUIRE_DBX_PIPE_COMPANION_TAGS_RULE: UtilRequireDbxPipeCompanionTagsRuleDefinition;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-rule-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxRuleCompanionTagsRuleOptions {
|
|
9
|
+
readonly allowedSeverities?: readonly string[];
|
|
10
|
+
readonly allowedSeeAlsoKinds?: readonly string[];
|
|
11
|
+
readonly knownCompanions?: readonly string[];
|
|
12
|
+
readonly requireBareMarker?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ESLint rule definition for require-dbx-rule-companion-tags.
|
|
16
|
+
*/
|
|
17
|
+
export interface UtilRequireDbxRuleCompanionTagsRuleDefinition {
|
|
18
|
+
readonly meta: {
|
|
19
|
+
readonly type: 'suggestion';
|
|
20
|
+
readonly fixable: 'code';
|
|
21
|
+
readonly docs: {
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly recommended: boolean;
|
|
24
|
+
};
|
|
25
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
26
|
+
readonly schema: readonly object[];
|
|
27
|
+
};
|
|
28
|
+
create(context: {
|
|
29
|
+
options: UtilRequireDbxRuleCompanionTagsRuleOptions[];
|
|
30
|
+
report: (descriptor: {
|
|
31
|
+
loc?: AstNode;
|
|
32
|
+
messageId: string;
|
|
33
|
+
data?: Record<string, string>;
|
|
34
|
+
}) => void;
|
|
35
|
+
sourceCode: AstNode;
|
|
36
|
+
}): Record<string, (node: AstNode) => void>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* ESLint rule enforcing `@dbxRule` companion tags on enum members in
|
|
40
|
+
* `codes.ts` files. Mirrors the extractor at
|
|
41
|
+
* `packages/dbx-components-mcp/scripts/extract-rule-catalog.mjs`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const UTIL_REQUIRE_DBX_RULE_COMPANION_TAGS_RULE: UtilRequireDbxRuleCompanionTagsRuleDefinition;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Maybe } from '@dereekb/util';
|
|
2
|
+
interface AstNode {
|
|
3
|
+
readonly type: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Options for the require-dbx-util-companion-tags rule.
|
|
8
|
+
*/
|
|
9
|
+
export interface UtilRequireDbxUtilCompanionTagsRuleOptions {
|
|
10
|
+
/**
|
|
11
|
+
* When provided, `@dbxUtilCategory` values must be in this list. When omitted, any kebab-case
|
|
12
|
+
* slug is accepted.
|
|
13
|
+
*/
|
|
14
|
+
readonly allowedCategories?: readonly string[];
|
|
15
|
+
/**
|
|
16
|
+
* Override the set of values accepted for `@dbxUtilKind`. Defaults to `['function', 'class', 'const', 'factory']`.
|
|
17
|
+
*/
|
|
18
|
+
readonly allowedKinds?: readonly string[];
|
|
19
|
+
/**
|
|
20
|
+
* Override the companion-tag whitelist (without the `dbxUtil` prefix). Defaults to `['Category', 'Kind', 'Tags', 'Related']`.
|
|
21
|
+
*/
|
|
22
|
+
readonly knownCompanions?: readonly string[];
|
|
23
|
+
/**
|
|
24
|
+
* When true (default), only the bare `@dbxUtil` tag triggers the rule. When false, any
|
|
25
|
+
* `@dbxUtil*` tag triggers it (useful for partial-block detection).
|
|
26
|
+
*/
|
|
27
|
+
readonly requireBareMarker?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* ESLint rule definition for require-dbx-util-companion-tags.
|
|
31
|
+
*/
|
|
32
|
+
export interface UtilRequireDbxUtilCompanionTagsRuleDefinition {
|
|
33
|
+
readonly meta: {
|
|
34
|
+
readonly type: 'suggestion';
|
|
35
|
+
readonly fixable: 'code';
|
|
36
|
+
readonly docs: {
|
|
37
|
+
readonly description: string;
|
|
38
|
+
readonly recommended: boolean;
|
|
39
|
+
};
|
|
40
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
41
|
+
readonly schema: readonly object[];
|
|
42
|
+
};
|
|
43
|
+
create(context: {
|
|
44
|
+
options: UtilRequireDbxUtilCompanionTagsRuleOptions[];
|
|
45
|
+
report: (descriptor: {
|
|
46
|
+
node?: AstNode;
|
|
47
|
+
loc?: AstNode;
|
|
48
|
+
messageId: string;
|
|
49
|
+
data?: Record<string, string>;
|
|
50
|
+
fix?: (fixer: AstNode) => Maybe<AstNode | AstNode[]>;
|
|
51
|
+
}) => void;
|
|
52
|
+
sourceCode: AstNode;
|
|
53
|
+
}): Record<string, (node: AstNode) => void>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* ESLint rule enforcing that exports tagged `@dbxUtil` carry the registry-required companion tags
|
|
57
|
+
* with valid value formats. Mirrors the scanner schema at
|
|
58
|
+
* `packages/dbx-components-mcp/src/scan/utils-extract.ts` so violations surface at lint time
|
|
59
|
+
* instead of at manifest-regeneration time.
|
|
60
|
+
*
|
|
61
|
+
* Checks:
|
|
62
|
+
*
|
|
63
|
+
* - `@dbxUtilCategory` is present (required) with a kebab-case slug value.
|
|
64
|
+
* - `@dbxUtilKind` (optional) has a value from the configured enum.
|
|
65
|
+
* - `@dbxUtilRelated` (optional) items are all kebab-case slugs.
|
|
66
|
+
* - `@dbxUtilTags` (optional) tokens are all lowercase.
|
|
67
|
+
* - Unknown `@dbxUtil*` tags (typos like `@dbxUtilCateogry`) are flagged.
|
|
68
|
+
* - Companion tags appear at most once each.
|
|
69
|
+
*
|
|
70
|
+
* Only the `@dbxUtilTags` lowercase fix is auto-applied. Category, kind, and related-slug
|
|
71
|
+
* violations are report-only — they require human / agent judgment on the correct value.
|
|
72
|
+
*/
|
|
73
|
+
export declare const UTIL_REQUIRE_DBX_UTIL_COMPANION_TAGS_RULE: UtilRequireDbxUtilCompanionTagsRuleDefinition;
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-web-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxWebCompanionTagsRuleOptions {
|
|
9
|
+
readonly allowedCategories?: readonly string[];
|
|
10
|
+
readonly allowedKinds?: readonly string[];
|
|
11
|
+
readonly knownCompanions?: readonly string[];
|
|
12
|
+
readonly requireBareMarker?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ESLint rule definition for require-dbx-web-companion-tags.
|
|
16
|
+
*/
|
|
17
|
+
export interface UtilRequireDbxWebCompanionTagsRuleDefinition {
|
|
18
|
+
readonly meta: {
|
|
19
|
+
readonly type: 'suggestion';
|
|
20
|
+
readonly fixable: 'code';
|
|
21
|
+
readonly docs: {
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly recommended: boolean;
|
|
24
|
+
};
|
|
25
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
26
|
+
readonly schema: readonly object[];
|
|
27
|
+
};
|
|
28
|
+
create(context: {
|
|
29
|
+
options: UtilRequireDbxWebCompanionTagsRuleOptions[];
|
|
30
|
+
report: (descriptor: {
|
|
31
|
+
loc?: AstNode;
|
|
32
|
+
messageId: string;
|
|
33
|
+
data?: Record<string, string>;
|
|
34
|
+
}) => void;
|
|
35
|
+
sourceCode: AstNode;
|
|
36
|
+
}): Record<string, (node: AstNode) => void>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* ESLint rule enforcing `@dbxWebComponent` companion tags. Mirrors the scanner
|
|
40
|
+
* schema at `packages/dbx-components-mcp/src/scan/ui-components-extract.ts`.
|
|
41
|
+
*/
|
|
42
|
+
export declare const UTIL_REQUIRE_DBX_WEB_COMPANION_TAGS_RULE: UtilRequireDbxWebCompanionTagsRuleDefinition;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options accepted by the require-default-prefix-naming rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDefaultPrefixNamingRuleOptions {
|
|
9
|
+
/**
|
|
10
|
+
* JSDoc tag that exempts a matching const from the rule.
|
|
11
|
+
* Defaults to `@dbxAllowDefaultPrefix`.
|
|
12
|
+
*/
|
|
13
|
+
readonly exemptJsdocTag?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* ESLint rule definition for require-default-prefix-naming.
|
|
17
|
+
*/
|
|
18
|
+
export interface UtilRequireDefaultPrefixNamingRuleDefinition {
|
|
19
|
+
readonly meta: {
|
|
20
|
+
readonly type: 'suggestion';
|
|
21
|
+
readonly fixable: undefined;
|
|
22
|
+
readonly docs: {
|
|
23
|
+
readonly description: string;
|
|
24
|
+
readonly recommended: boolean;
|
|
25
|
+
};
|
|
26
|
+
readonly messages: {
|
|
27
|
+
readonly defaultShouldBePrefix: string;
|
|
28
|
+
};
|
|
29
|
+
readonly schema: readonly object[];
|
|
30
|
+
};
|
|
31
|
+
create(context: {
|
|
32
|
+
options: UtilRequireDefaultPrefixNamingRuleOptions[];
|
|
33
|
+
report: (descriptor: {
|
|
34
|
+
node: AstNode;
|
|
35
|
+
messageId: string;
|
|
36
|
+
data?: Record<string, string>;
|
|
37
|
+
}) => void;
|
|
38
|
+
sourceCode: AstNode;
|
|
39
|
+
}): Record<string, (node: AstNode) => void>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ESLint rule that enforces the dbx-components naming convention: when a SCREAMING_CASE binding
|
|
43
|
+
* contains the segment `DEFAULT` (e.g. `FOO_DEFAULT_BAR` or `FOO_BAR_DEFAULT`), the `DEFAULT_`
|
|
44
|
+
* segment must appear as the leading prefix instead (`DEFAULT_FOO_BAR`).
|
|
45
|
+
*
|
|
46
|
+
* Rationale: keeping `DEFAULT_` as a leading prefix makes default-providing constants trivially
|
|
47
|
+
* groupable in IDE symbol lists and import bars, and matches the rest of the codebase's
|
|
48
|
+
* `DEFAULT_X_Y_Z` pattern.
|
|
49
|
+
*
|
|
50
|
+
* Applies to every `VariableDeclarator` whose binding is UPPER_SNAKE_CASE. PascalCase, camelCase,
|
|
51
|
+
* underscore-prefixed (internal), and mixed names are ignored.
|
|
52
|
+
*
|
|
53
|
+
* Not auto-fixable: renaming a binding has cross-file impact that an autofix can't safely
|
|
54
|
+
* propagate. Use the exempt JSDoc tag (default `@dbxAllowDefaultPrefix`) to silence the rule on a
|
|
55
|
+
* specific declaration when the heuristics get it wrong.
|
|
56
|
+
*
|
|
57
|
+
* @see `dbx__note__typescript-programming` → Constant Naming.
|
|
58
|
+
*/
|
|
59
|
+
export declare const UTIL_REQUIRE_DEFAULT_PREFIX_NAMING_RULE: UtilRequireDefaultPrefixNamingRuleDefinition;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* ESLint fixer interface (loose-typed because the rule keeps its own no-deps `AstNode = any`).
|
|
7
|
+
*/
|
|
8
|
+
interface RuleFixer {
|
|
9
|
+
readonly removeRange: (range: readonly [number, number]) => unknown;
|
|
10
|
+
readonly replaceTextRange: (range: readonly [number, number], text: string) => unknown;
|
|
11
|
+
readonly insertTextAfterRange: (range: readonly [number, number], text: string) => unknown;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ESLint rule definition for require-deprecated-alias-placement.
|
|
15
|
+
*/
|
|
16
|
+
export interface UtilRequireDeprecatedAliasPlacementRuleDefinition {
|
|
17
|
+
readonly meta: {
|
|
18
|
+
readonly type: 'suggestion';
|
|
19
|
+
readonly fixable: 'code';
|
|
20
|
+
readonly docs: {
|
|
21
|
+
readonly description: string;
|
|
22
|
+
readonly recommended: boolean;
|
|
23
|
+
};
|
|
24
|
+
readonly messages: {
|
|
25
|
+
readonly missingCompatMarker: string;
|
|
26
|
+
readonly deprecatedAliasNotAtBottom: string;
|
|
27
|
+
readonly nonDeprecatedAfterMarker: string;
|
|
28
|
+
};
|
|
29
|
+
readonly schema: readonly object[];
|
|
30
|
+
};
|
|
31
|
+
create(context: RuleContext): Record<string, (node: AstNode) => void>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fix function signature used throughout the rule. Returned by helper builders and consumed by
|
|
35
|
+
* `context.report({ fix })`.
|
|
36
|
+
*/
|
|
37
|
+
type FixFn = (fixer: RuleFixer) => unknown;
|
|
38
|
+
/**
|
|
39
|
+
* Narrow shape of the ESLint rule context the rule actually uses.
|
|
40
|
+
*/
|
|
41
|
+
interface RuleContext {
|
|
42
|
+
readonly report: (descriptor: {
|
|
43
|
+
node: AstNode;
|
|
44
|
+
messageId: string;
|
|
45
|
+
fix?: FixFn;
|
|
46
|
+
}) => void;
|
|
47
|
+
readonly sourceCode: AstNode;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* ESLint rule requiring that exports carrying a `@deprecated` JSDoc tag live at the bottom of the
|
|
51
|
+
* file under a `// COMPAT: Deprecated aliases` line comment, and that no non-deprecated exports
|
|
52
|
+
* follow the marker. The rule mirrors the workspace's "Deprecated Alias Placement" convention so
|
|
53
|
+
* that deprecated aliases stay segregated from current code and are easy to spot for removal.
|
|
54
|
+
*
|
|
55
|
+
* The rule reports at most one violation per concern (missing marker, alias above marker,
|
|
56
|
+
* non-deprecated below marker) to keep editor noise manageable; once the first violation in a
|
|
57
|
+
* category is fixed, re-linting will surface the next one.
|
|
58
|
+
*
|
|
59
|
+
* Autofix coverage:
|
|
60
|
+
* - `missingCompatMarker` — inserts `// COMPAT: Deprecated aliases` and consolidates all
|
|
61
|
+
* deprecated blocks at the bottom of the file. When the deprecated tail is already at the
|
|
62
|
+
* bottom of the file, only the marker line is inserted (no statements are moved). When
|
|
63
|
+
* deprecated exports are interleaved with non-deprecated ones, the autofix removes each
|
|
64
|
+
* deprecated block from its current location and re-emits them in source order at the bottom
|
|
65
|
+
* of the file under the marker.
|
|
66
|
+
* - `deprecatedAliasNotAtBottom` — moves the misplaced deprecated block from above the marker to
|
|
67
|
+
* just after the marker. One block per pass; ESLint's autofix loop converges across multiple
|
|
68
|
+
* violations.
|
|
69
|
+
* - `nonDeprecatedAfterMarker` — moves the misplaced non-deprecated block from below the marker
|
|
70
|
+
* to just before the marker. One block per pass.
|
|
71
|
+
*
|
|
72
|
+
* @see `dbx__note__typescript-programming` → Deprecated Alias Placement
|
|
73
|
+
*/
|
|
74
|
+
export declare const UTIL_REQUIRE_DEPRECATED_ALIAS_PLACEMENT_RULE: UtilRequireDeprecatedAliasPlacementRuleDefinition;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options accepted by the require-exported-jsdoc-example rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireExportedJsdocExampleRuleOptions {
|
|
9
|
+
/**
|
|
10
|
+
* JSDoc tag that opts a function out of the rule. Defaults to `@dbxAllowSkipExample`.
|
|
11
|
+
*/
|
|
12
|
+
readonly exemptJsdocTag?: string;
|
|
13
|
+
/**
|
|
14
|
+
* When true (the default), zero-parameter functions are skipped because their behavior is
|
|
15
|
+
* usually clear from the description alone.
|
|
16
|
+
*/
|
|
17
|
+
readonly exemptNoArguments?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ESLint rule definition for require-exported-jsdoc-example.
|
|
21
|
+
*/
|
|
22
|
+
export interface UtilRequireExportedJsdocExampleRuleDefinition {
|
|
23
|
+
readonly meta: {
|
|
24
|
+
readonly type: 'suggestion';
|
|
25
|
+
readonly fixable: undefined;
|
|
26
|
+
readonly docs: {
|
|
27
|
+
readonly description: string;
|
|
28
|
+
readonly recommended: boolean;
|
|
29
|
+
};
|
|
30
|
+
readonly messages: {
|
|
31
|
+
readonly missingExample: string;
|
|
32
|
+
};
|
|
33
|
+
readonly schema: readonly object[];
|
|
34
|
+
};
|
|
35
|
+
create(context: {
|
|
36
|
+
options: UtilRequireExportedJsdocExampleRuleOptions[];
|
|
37
|
+
report: (descriptor: {
|
|
38
|
+
node: AstNode;
|
|
39
|
+
messageId: string;
|
|
40
|
+
data?: Record<string, string>;
|
|
41
|
+
}) => void;
|
|
42
|
+
sourceCode: AstNode;
|
|
43
|
+
}): Record<string, (node: AstNode) => void>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* ESLint rule that requires exported `function` declarations whose JSDoc is already present to
|
|
47
|
+
* also include at least one `@example` tag.
|
|
48
|
+
*
|
|
49
|
+
* Differences from `jsdoc/require-example`:
|
|
50
|
+
* - Fires only on **exported** FunctionDeclarations (top-level `export function …` or
|
|
51
|
+
* `export default function …`). Internal helpers stay quiet.
|
|
52
|
+
* - Fires only when the function actually has a leading JSDoc block — undocumented functions are
|
|
53
|
+
* handled by `jsdoc/require-jsdoc`.
|
|
54
|
+
* - Honors the `@dbxAllowSkipExample` JSDoc tag for per-declaration opt-out.
|
|
55
|
+
*
|
|
56
|
+
* Not auto-fixable: there's no way to synthesize a useful `@example` block automatically.
|
|
57
|
+
*
|
|
58
|
+
* @see `dbx__note__typescript-jsdocs` → "Function JSDocs Must Include Examples".
|
|
59
|
+
*/
|
|
60
|
+
export declare const UTIL_REQUIRE_EXPORTED_JSDOC_EXAMPLE_RULE: UtilRequireExportedJsdocExampleRuleDefinition;
|
|
61
|
+
export {};
|
|
@@ -63,5 +63,5 @@ export interface UtilRequireNoSideEffectsRuleDefinition {
|
|
|
63
63
|
* declaration (other than the required impl-leading line comment on overloaded functions), and
|
|
64
64
|
* when no JSDoc is present, creates a minimal one carrying both tags.
|
|
65
65
|
*/
|
|
66
|
-
export declare const
|
|
66
|
+
export declare const UTIL_REQUIRE_NO_SIDE_EFFECTS_RULE: UtilRequireNoSideEffectsRuleDefinition;
|
|
67
67
|
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options accepted by the require-readonly-config-params rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireReadonlyConfigParamsRuleOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Additional name suffixes to treat as config-shaped (joined with the defaults `Config`, `Params`).
|
|
11
|
+
*/
|
|
12
|
+
readonly additionalSuffixes?: readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* JSDoc tag that exempts a matching interface from the readonly requirement.
|
|
15
|
+
* Defaults to `@dbxMutable`.
|
|
16
|
+
*/
|
|
17
|
+
readonly exemptJsdocTag?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ESLint rule definition for require-readonly-config-params.
|
|
21
|
+
*/
|
|
22
|
+
export interface UtilRequireReadonlyConfigParamsRuleDefinition {
|
|
23
|
+
readonly meta: {
|
|
24
|
+
readonly type: 'suggestion';
|
|
25
|
+
readonly fixable: 'code';
|
|
26
|
+
readonly docs: {
|
|
27
|
+
readonly description: string;
|
|
28
|
+
readonly recommended: boolean;
|
|
29
|
+
};
|
|
30
|
+
readonly messages: {
|
|
31
|
+
readonly missingReadonly: string;
|
|
32
|
+
};
|
|
33
|
+
readonly schema: readonly object[];
|
|
34
|
+
};
|
|
35
|
+
create(context: {
|
|
36
|
+
options: UtilRequireReadonlyConfigParamsRuleOptions[];
|
|
37
|
+
report: (descriptor: {
|
|
38
|
+
node: AstNode;
|
|
39
|
+
messageId: string;
|
|
40
|
+
data?: Record<string, string>;
|
|
41
|
+
fix?: (fixer: AstNode) => AstNode | AstNode[];
|
|
42
|
+
}) => void;
|
|
43
|
+
sourceCode: AstNode;
|
|
44
|
+
}): Record<string, (node: AstNode) => void>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* ESLint rule requiring `readonly` on every property of `*Config` / `*Params` interfaces so that Config
|
|
48
|
+
* and Params shapes stay structurally immutable at the type level. Properties that are missing the
|
|
49
|
+
* modifier are flagged and the rule auto-fixes them by inserting `readonly` before the property name.
|
|
50
|
+
*
|
|
51
|
+
* Interfaces tagged with the configured exempt JSDoc (default `@dbxMutable`) are skipped — used for
|
|
52
|
+
* Firestore model data interfaces that legitimately need mutable hydration fields.
|
|
53
|
+
*
|
|
54
|
+
* @see `dbx__note__typescript-programming` → Readonly Interface Properties
|
|
55
|
+
*/
|
|
56
|
+
export declare const UTIL_REQUIRE_READONLY_CONFIG_PARAMS_RULE: UtilRequireReadonlyConfigParamsRuleDefinition;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* ESLint rule definition for require-single-return.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireSingleReturnRuleDefinition {
|
|
9
|
+
readonly meta: {
|
|
10
|
+
readonly type: 'suggestion';
|
|
11
|
+
readonly docs: {
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly recommended: boolean;
|
|
14
|
+
};
|
|
15
|
+
readonly messages: {
|
|
16
|
+
readonly multipleReturns: string;
|
|
17
|
+
};
|
|
18
|
+
readonly schema: readonly object[];
|
|
19
|
+
};
|
|
20
|
+
create(context: {
|
|
21
|
+
report: (descriptor: {
|
|
22
|
+
node: AstNode;
|
|
23
|
+
messageId: string;
|
|
24
|
+
data?: Record<string, string>;
|
|
25
|
+
}) => void;
|
|
26
|
+
}): Record<string, (node: AstNode) => void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* ESLint rule enforcing the workspace convention of a single `return` statement per function. Functions
|
|
30
|
+
* with multiple early returns should be refactored to assign their result to a local variable and return
|
|
31
|
+
* it once. Nested function-likes are analyzed independently — only returns inside the current function
|
|
32
|
+
* scope (and the blocks that share it) count toward its tally.
|
|
33
|
+
*
|
|
34
|
+
* Simple early-exit guard clauses are exempt: a `ReturnStatement` that is the consequent — or the last
|
|
35
|
+
* statement of the consequent `BlockStatement` — of an `IfStatement` with no `else` does not count
|
|
36
|
+
* toward the tally. This permits the standard guard-clause idiom while still flagging if/else, switch,
|
|
37
|
+
* try/catch, and returns mixed into main logic.
|
|
38
|
+
*
|
|
39
|
+
* @see `dbx__note__typescript-programming` → Single Return Per Function
|
|
40
|
+
*/
|
|
41
|
+
export declare const UTIL_REQUIRE_SINGLE_RETURN_RULE: UtilRequireSingleReturnRuleDefinition;
|
|
42
|
+
export {};
|