@dereekb/util 13.11.14 → 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
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { type UtilRequireNoSideEffectsRuleDefinition } from './require-no-side-effects.rule';
|
|
2
2
|
import { type UtilPreferNoSideEffectsInJsdocRuleDefinition } from './prefer-no-side-effects-in-jsdoc.rule';
|
|
3
|
+
import { type UtilNoSisterReExportRuleDefinition } from './no-sister-re-export.rule';
|
|
4
|
+
import { type UtilRequireSingleReturnRuleDefinition } from './require-single-return.rule';
|
|
5
|
+
import { type UtilRequireReadonlyConfigParamsRuleDefinition } from './require-readonly-config-params.rule';
|
|
6
|
+
import { type UtilPreferConfigObjectRuleDefinition } from './prefer-config-object.rule';
|
|
7
|
+
import { type UtilPreferMaybeTypeRuleDefinition } from './prefer-maybe-type.rule';
|
|
8
|
+
import { type UtilNoInlineTypeImportRuleDefinition } from './no-inline-type-import.rule';
|
|
9
|
+
import { type UtilRequireDeprecatedAliasPlacementRuleDefinition } from './require-deprecated-alias-placement.rule';
|
|
10
|
+
import { type UtilPreferCanonicalJsdocRuleDefinition } from './prefer-canonical-jsdoc.rule';
|
|
11
|
+
import { type UtilRequireDbxUtilCompanionTagsRuleDefinition } from './require-dbx-util-companion-tags.rule';
|
|
12
|
+
import { type UtilRequireDbxPipeCompanionTagsRuleDefinition } from './require-dbx-pipe-companion-tags.rule';
|
|
13
|
+
import { type UtilRequireDbxFilterCompanionTagsRuleDefinition } from './require-dbx-filter-companion-tags.rule';
|
|
14
|
+
import { type UtilRequireDbxWebCompanionTagsRuleDefinition } from './require-dbx-web-companion-tags.rule';
|
|
15
|
+
import { type UtilRequireDbxDocsUiExampleCompanionTagsRuleDefinition } from './require-dbx-docs-ui-example-companion-tags.rule';
|
|
16
|
+
import { type UtilRequireDbxModelSnapshotFieldCompanionTagsRuleDefinition } from './require-dbx-model-snapshot-field-companion-tags.rule';
|
|
17
|
+
import { type UtilRequireDbxModelFirebaseIndexCompanionTagsRuleDefinition } from './require-dbx-model-firebase-index-companion-tags.rule';
|
|
18
|
+
import { type UtilRequireDbxActionCompanionTagsRuleDefinition } from './require-dbx-action-companion-tags.rule';
|
|
19
|
+
import { type UtilRequireDbxFormFieldCompanionTagsRuleDefinition } from './require-dbx-form-field-companion-tags.rule';
|
|
20
|
+
import { type UtilRequireDbxModelCompanionTagsRuleDefinition } from './require-dbx-model-companion-tags.rule';
|
|
21
|
+
import { type UtilRequireDbxAuthCompanionTagsRuleDefinition } from './require-dbx-auth-companion-tags.rule';
|
|
22
|
+
import { type UtilRequireDbxRuleCompanionTagsRuleDefinition } from './require-dbx-rule-companion-tags.rule';
|
|
23
|
+
import { type UtilRequireConstantNamingRuleDefinition } from './require-constant-naming.rule';
|
|
24
|
+
import { type UtilRequireDefaultPrefixNamingRuleDefinition } from './require-default-prefix-naming.rule';
|
|
25
|
+
import { type UtilRequireExportedJsdocExampleRuleDefinition } from './require-exported-jsdoc-example.rule';
|
|
26
|
+
import { type UtilNoInlineStringEmptyObjectIntersectionRuleDefinition } from './no-inline-string-empty-object-intersection.rule';
|
|
27
|
+
import { type UtilPreferSuggestedStringRuleDefinition } from './prefer-suggested-string.rule';
|
|
3
28
|
/**
|
|
4
29
|
* ESLint plugin interface for @dereekb/util rules.
|
|
5
30
|
*/
|
|
@@ -7,6 +32,32 @@ export interface UtilEslintPlugin {
|
|
|
7
32
|
readonly rules: {
|
|
8
33
|
readonly 'require-no-side-effects': UtilRequireNoSideEffectsRuleDefinition;
|
|
9
34
|
readonly 'prefer-no-side-effects-in-jsdoc': UtilPreferNoSideEffectsInJsdocRuleDefinition;
|
|
35
|
+
readonly 'no-sister-re-export': UtilNoSisterReExportRuleDefinition;
|
|
36
|
+
readonly 'require-single-return': UtilRequireSingleReturnRuleDefinition;
|
|
37
|
+
readonly 'require-readonly-config-params': UtilRequireReadonlyConfigParamsRuleDefinition;
|
|
38
|
+
readonly 'prefer-config-object': UtilPreferConfigObjectRuleDefinition;
|
|
39
|
+
readonly 'prefer-config-object-hard': UtilPreferConfigObjectRuleDefinition;
|
|
40
|
+
readonly 'prefer-maybe-type': UtilPreferMaybeTypeRuleDefinition;
|
|
41
|
+
readonly 'no-inline-type-import': UtilNoInlineTypeImportRuleDefinition;
|
|
42
|
+
readonly 'require-deprecated-alias-placement': UtilRequireDeprecatedAliasPlacementRuleDefinition;
|
|
43
|
+
readonly 'prefer-canonical-jsdoc': UtilPreferCanonicalJsdocRuleDefinition;
|
|
44
|
+
readonly 'require-dbx-util-companion-tags': UtilRequireDbxUtilCompanionTagsRuleDefinition;
|
|
45
|
+
readonly 'require-dbx-pipe-companion-tags': UtilRequireDbxPipeCompanionTagsRuleDefinition;
|
|
46
|
+
readonly 'require-dbx-filter-companion-tags': UtilRequireDbxFilterCompanionTagsRuleDefinition;
|
|
47
|
+
readonly 'require-dbx-web-companion-tags': UtilRequireDbxWebCompanionTagsRuleDefinition;
|
|
48
|
+
readonly 'require-dbx-docs-ui-example-companion-tags': UtilRequireDbxDocsUiExampleCompanionTagsRuleDefinition;
|
|
49
|
+
readonly 'require-dbx-model-snapshot-field-companion-tags': UtilRequireDbxModelSnapshotFieldCompanionTagsRuleDefinition;
|
|
50
|
+
readonly 'require-dbx-model-firebase-index-companion-tags': UtilRequireDbxModelFirebaseIndexCompanionTagsRuleDefinition;
|
|
51
|
+
readonly 'require-dbx-action-companion-tags': UtilRequireDbxActionCompanionTagsRuleDefinition;
|
|
52
|
+
readonly 'require-dbx-form-field-companion-tags': UtilRequireDbxFormFieldCompanionTagsRuleDefinition;
|
|
53
|
+
readonly 'require-dbx-model-companion-tags': UtilRequireDbxModelCompanionTagsRuleDefinition;
|
|
54
|
+
readonly 'require-dbx-auth-companion-tags': UtilRequireDbxAuthCompanionTagsRuleDefinition;
|
|
55
|
+
readonly 'require-dbx-rule-companion-tags': UtilRequireDbxRuleCompanionTagsRuleDefinition;
|
|
56
|
+
readonly 'require-constant-naming': UtilRequireConstantNamingRuleDefinition;
|
|
57
|
+
readonly 'require-default-prefix-naming': UtilRequireDefaultPrefixNamingRuleDefinition;
|
|
58
|
+
readonly 'require-exported-jsdoc-example': UtilRequireExportedJsdocExampleRuleDefinition;
|
|
59
|
+
readonly 'no-inline-string-empty-object-intersection': UtilNoInlineStringEmptyObjectIntersectionRuleDefinition;
|
|
60
|
+
readonly 'prefer-suggested-string': UtilPreferSuggestedStringRuleDefinition;
|
|
10
61
|
};
|
|
11
62
|
}
|
|
12
63
|
/**
|
|
@@ -15,4 +66,4 @@ export interface UtilEslintPlugin {
|
|
|
15
66
|
* Register as a plugin in your flat ESLint config, then enable individual rules
|
|
16
67
|
* under the chosen plugin prefix (e.g. 'dereekb-util/require-no-side-effects').
|
|
17
68
|
*/
|
|
18
|
-
export declare const
|
|
69
|
+
export declare const UTIL_ESLINT_PLUGIN: UtilEslintPlugin;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Maybe } from '@dereekb/util';
|
|
2
|
+
interface AstNode {
|
|
3
|
+
readonly type: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Options for the prefer-canonical-jsdoc rule. Each `checkX` flag toggles a related group of
|
|
8
|
+
* messageIds; default is `true` for all checks.
|
|
9
|
+
*/
|
|
10
|
+
export interface UtilPreferCanonicalJsdocRuleOptions {
|
|
11
|
+
readonly checkDescription?: boolean;
|
|
12
|
+
readonly checkParam?: boolean;
|
|
13
|
+
readonly checkReturns?: boolean;
|
|
14
|
+
readonly checkThrows?: boolean;
|
|
15
|
+
readonly checkTagOrder?: boolean;
|
|
16
|
+
readonly checkExampleFence?: boolean;
|
|
17
|
+
readonly checkTypeRestating?: boolean;
|
|
18
|
+
readonly checkSingleLine?: boolean;
|
|
19
|
+
readonly workspaceTagPrefixes?: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* ESLint rule definition for prefer-canonical-jsdoc.
|
|
23
|
+
*/
|
|
24
|
+
export interface UtilPreferCanonicalJsdocRuleDefinition {
|
|
25
|
+
readonly meta: {
|
|
26
|
+
readonly type: 'suggestion';
|
|
27
|
+
readonly fixable: 'code';
|
|
28
|
+
readonly docs: {
|
|
29
|
+
readonly description: string;
|
|
30
|
+
readonly recommended: boolean;
|
|
31
|
+
};
|
|
32
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
33
|
+
readonly schema: readonly object[];
|
|
34
|
+
};
|
|
35
|
+
create(context: {
|
|
36
|
+
options: UtilPreferCanonicalJsdocRuleOptions[];
|
|
37
|
+
report: (descriptor: {
|
|
38
|
+
node?: AstNode;
|
|
39
|
+
loc?: AstNode;
|
|
40
|
+
messageId: string;
|
|
41
|
+
data?: Record<string, string>;
|
|
42
|
+
fix?: (fixer: AstNode) => Maybe<AstNode | AstNode[]>;
|
|
43
|
+
}) => void;
|
|
44
|
+
sourceCode: AstNode;
|
|
45
|
+
}): Record<string, (node: AstNode) => void>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* ESLint rule enforcing the workspace's canonical JSDoc shape. Applies only when a JSDoc block
|
|
49
|
+
* already exists on a function-like declaration; presence is `jsdoc/require-jsdoc`'s concern.
|
|
50
|
+
*
|
|
51
|
+
* The rule defends the shape established across `@dereekb/util`, `@dereekb/date`, `@dereekb/firebase`,
|
|
52
|
+
* and `@dereekb/dbx-core`:
|
|
53
|
+
*
|
|
54
|
+
* - Description: capitalized first paragraph ending with terminal punctuation, optional elaboration paragraphs
|
|
55
|
+
* separated by exactly one blank `* ` line.
|
|
56
|
+
* - `@param name - Capitalized description.` with hyphen and surrounding spaces.
|
|
57
|
+
* - `@returns Capitalized description.` without a hyphen.
|
|
58
|
+
* - `@throws {ErrorType} Capitalized condition.` with brace-wrapped error type.
|
|
59
|
+
* - Tag order: `@param*`, `@returns`, `@throws*`, workspace tags (`@dbx*`, `@see`), `@example`, `@__NO_SIDE_EFFECTS__`.
|
|
60
|
+
* - `@example` body fenced as triple-backtick `ts` block.
|
|
61
|
+
* - No type-restating descriptions ("a string …", "an array of …").
|
|
62
|
+
* - Single-line JSDocs forbidden on functions with parameters.
|
|
63
|
+
*
|
|
64
|
+
* Heuristics are tuned to pass on the canonical examples in the existing codebase; warnings on
|
|
65
|
+
* older non-canonical JSDocs are expected and acceptable per workspace policy.
|
|
66
|
+
*/
|
|
67
|
+
export declare const UTIL_PREFER_CANONICAL_JSDOC_RULE: UtilPreferCanonicalJsdocRuleDefinition;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options accepted by the prefer-config-object rule (and the hard variant).
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilPreferConfigObjectRuleOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Maximum number of positional parameters before the rule fires. Defaults to 2 for the warn
|
|
11
|
+
* variant (`prefer-config-object`) and 4 for the hard variant (`prefer-config-object-hard`).
|
|
12
|
+
*/
|
|
13
|
+
readonly maxParams?: number;
|
|
14
|
+
/**
|
|
15
|
+
* JSDoc tag that exempts a function from this rule. Defaults to `@dbxAllowMultiParams`.
|
|
16
|
+
*/
|
|
17
|
+
readonly allowJsdocTag?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ESLint rule definition for prefer-config-object.
|
|
21
|
+
*/
|
|
22
|
+
export interface UtilPreferConfigObjectRuleDefinition {
|
|
23
|
+
readonly meta: {
|
|
24
|
+
readonly type: 'suggestion';
|
|
25
|
+
readonly docs: {
|
|
26
|
+
readonly description: string;
|
|
27
|
+
readonly recommended: boolean;
|
|
28
|
+
};
|
|
29
|
+
readonly messages: {
|
|
30
|
+
readonly tooManyParams: string;
|
|
31
|
+
};
|
|
32
|
+
readonly schema: readonly object[];
|
|
33
|
+
};
|
|
34
|
+
create(context: {
|
|
35
|
+
options: UtilPreferConfigObjectRuleOptions[];
|
|
36
|
+
report: (descriptor: {
|
|
37
|
+
node: AstNode;
|
|
38
|
+
messageId: string;
|
|
39
|
+
data?: Record<string, string>;
|
|
40
|
+
}) => void;
|
|
41
|
+
sourceCode: AstNode;
|
|
42
|
+
}): Record<string, (node: AstNode) => void>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* ESLint rule recommending a single config object when a function takes more than two positional
|
|
46
|
+
* parameters (default `maxParams: 2`, i.e. fires at 3+ args). Intended to be configured at the
|
|
47
|
+
* `warn` severity. Pair with `prefer-config-object-hard` for a stricter cap.
|
|
48
|
+
*
|
|
49
|
+
* @see `dbx__note__typescript-programming` → Prefer Single Config Object
|
|
50
|
+
*/
|
|
51
|
+
export declare const UTIL_PREFER_CONFIG_OBJECT_RULE: UtilPreferConfigObjectRuleDefinition;
|
|
52
|
+
/**
|
|
53
|
+
* Hard-stop variant of `prefer-config-object`. Fires when a function takes more than four positional
|
|
54
|
+
* parameters (default `maxParams: 4`, i.e. fires at 5+ args). Intended to be configured at the
|
|
55
|
+
* `error` severity so genuinely unwieldy signatures break the build even when the softer warn-level
|
|
56
|
+
* rule is disabled or downgraded.
|
|
57
|
+
*
|
|
58
|
+
* @see `dbx__note__typescript-programming` → Prefer Single Config Object
|
|
59
|
+
*/
|
|
60
|
+
export declare const UTIL_PREFER_CONFIG_OBJECT_HARD_RULE: UtilPreferConfigObjectRuleDefinition;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options accepted by the prefer-maybe-type rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilPreferMaybeTypeRuleOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Type names that should be left untouched even when present in an explicit null/undefined union.
|
|
11
|
+
* Useful when a name like `Maybe`-flavored alias is already in the union and a rewrite would create
|
|
12
|
+
* `Maybe<Maybe<T>>`-style nesting.
|
|
13
|
+
*/
|
|
14
|
+
readonly allowedTypeNames?: readonly string[];
|
|
15
|
+
/**
|
|
16
|
+
* When true, the rule still reports `T | null` unions but skips the auto-fix entirely and emits a
|
|
17
|
+
* message instructing the developer to import `Maybe` via a relative path. Used inside the
|
|
18
|
+
* `@dereekb/util` package itself, where the default auto-fix would insert
|
|
19
|
+
* `import type { Maybe } from '@dereekb/util';` — a circular self-import. Defaults to `false`.
|
|
20
|
+
*/
|
|
21
|
+
readonly noAutoImport?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* ESLint rule definition for prefer-maybe-type.
|
|
25
|
+
*/
|
|
26
|
+
export interface UtilPreferMaybeTypeRuleDefinition {
|
|
27
|
+
readonly meta: {
|
|
28
|
+
readonly type: 'suggestion';
|
|
29
|
+
readonly fixable: 'code';
|
|
30
|
+
readonly docs: {
|
|
31
|
+
readonly description: string;
|
|
32
|
+
readonly recommended: boolean;
|
|
33
|
+
};
|
|
34
|
+
readonly messages: {
|
|
35
|
+
readonly preferMaybe: string;
|
|
36
|
+
readonly preferMaybeNoAutoImport: string;
|
|
37
|
+
};
|
|
38
|
+
readonly schema: readonly object[];
|
|
39
|
+
};
|
|
40
|
+
create(context: {
|
|
41
|
+
options: UtilPreferMaybeTypeRuleOptions[];
|
|
42
|
+
report: (descriptor: {
|
|
43
|
+
node: AstNode;
|
|
44
|
+
messageId: string;
|
|
45
|
+
data?: Record<string, string>;
|
|
46
|
+
fix?: (fixer: AstNode) => AstNode | AstNode[];
|
|
47
|
+
}) => void;
|
|
48
|
+
sourceCode: AstNode;
|
|
49
|
+
}): Record<string, (node: AstNode) => void>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* ESLint rule that flags explicit `T | null` and `T | null | undefined` unions (including the
|
|
53
|
+
* combination of an optional modifier with `| null`, e.g. `foo?: T | null`) and recommends using
|
|
54
|
+
* `Maybe<T>` from `@dereekb/util` instead. The rule targets only unions that explicitly include
|
|
55
|
+
* `null` — `T | undefined` alone is left untouched because `x?: T` and `T | undefined` are the
|
|
56
|
+
* common, intentional shapes for "value may be absent" and have no canonical `Maybe<T>` equivalent
|
|
57
|
+
* to push toward when `null` isn't involved.
|
|
58
|
+
*
|
|
59
|
+
* Auto-fix rewrites the union as `Maybe<...>` and (once per file) inserts
|
|
60
|
+
* `import type { Maybe } from '@dereekb/util';` near the top of the file. The workspace's
|
|
61
|
+
* `import/no-duplicates` rule (configured with `prefer-inline: true`) consolidates the new
|
|
62
|
+
* import with any existing `@dereekb/util` import on subsequent fix passes.
|
|
63
|
+
*
|
|
64
|
+
* When the `noAutoImport` option is `true`, the rule still reports the union but skips the auto-fix
|
|
65
|
+
* and emits a message instructing the developer to import `Maybe` via a relative path. This is the
|
|
66
|
+
* configuration used inside the `@dereekb/util` package itself, where the default auto-fix would
|
|
67
|
+
* insert a circular self-import.
|
|
68
|
+
*
|
|
69
|
+
* @see `dbx__note__typescript-programming` → Maybe<T> Usage
|
|
70
|
+
*/
|
|
71
|
+
export declare const UTIL_PREFER_MAYBE_TYPE_RULE: UtilPreferMaybeTypeRuleDefinition;
|
|
72
|
+
export {};
|
|
@@ -46,5 +46,5 @@ export interface UtilPreferNoSideEffectsInJsdocRuleDefinition {
|
|
|
46
46
|
* (and treats line comments between overloads — but not directly above the impl —
|
|
47
47
|
* as ordinary orphans to migrate).
|
|
48
48
|
*/
|
|
49
|
-
export declare const
|
|
49
|
+
export declare const UTIL_PREFER_NO_SIDE_EFFECTS_IN_JSDOC_RULE: UtilPreferNoSideEffectsInJsdocRuleDefinition;
|
|
50
50
|
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* ESLint rule definition for prefer-suggested-string.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilPreferSuggestedStringRuleDefinition {
|
|
9
|
+
readonly meta: {
|
|
10
|
+
readonly type: 'suggestion';
|
|
11
|
+
readonly docs: {
|
|
12
|
+
readonly description: string;
|
|
13
|
+
readonly recommended: boolean;
|
|
14
|
+
};
|
|
15
|
+
readonly messages: {
|
|
16
|
+
readonly preferSuggestedString: 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
|
+
sourceCode: {
|
|
27
|
+
getText: (node: AstNode) => string;
|
|
28
|
+
};
|
|
29
|
+
}): Record<string, (node: AstNode) => void>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* ESLint rule that warns on union types of the shape `'a' | 'b' | string` — a literal-string
|
|
33
|
+
* union members alongside a bare `string` member.
|
|
34
|
+
*
|
|
35
|
+
* The TypeScript compiler collapses such a union to `string`, erasing IDE autocomplete for the
|
|
36
|
+
* literal members. Two outcomes are sane:
|
|
37
|
+
*
|
|
38
|
+
* 1. If autocomplete-preserving behavior is actually wanted, switch to `SuggestedString<T>` from
|
|
39
|
+
* `@dereekb/util` (the named alias for the `'a' | 'b' | (string & {})` workaround).
|
|
40
|
+
* 2. If any string is fine and literals were just documentation, drop the literal members and
|
|
41
|
+
* keep plain `string`.
|
|
42
|
+
*
|
|
43
|
+
* The rule is non-fixable: the right action depends on intent (#1 vs #2), and #1 also requires
|
|
44
|
+
* adding an `import { type SuggestedString }` statement whose insertion point varies by file. The
|
|
45
|
+
* warning message names both options so the developer can make the call.
|
|
46
|
+
*
|
|
47
|
+
* Only fires when the union contains BOTH a `TSStringKeyword` AND at least one literal-string
|
|
48
|
+
* contributor. Unions like `string | number`, `'a' | 'b'`, or `string` alone are silent.
|
|
49
|
+
*/
|
|
50
|
+
export declare const UTIL_PREFER_SUGGESTED_STRING_RULE: UtilPreferSuggestedStringRuleDefinition;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options accepted by the require-constant-naming rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireConstantNamingRuleOptions {
|
|
9
|
+
/**
|
|
10
|
+
* JSDoc tag that exempts a matching const from the rule.
|
|
11
|
+
* Defaults to `@dbxAllowConstantName`.
|
|
12
|
+
*/
|
|
13
|
+
readonly exemptJsdocTag?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* ESLint rule definition for require-constant-naming.
|
|
17
|
+
*/
|
|
18
|
+
export interface UtilRequireConstantNamingRuleDefinition {
|
|
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 functionConstantShouldBeCamelCase: string;
|
|
28
|
+
readonly valueConstantShouldBeUpperSnakeCase: string;
|
|
29
|
+
};
|
|
30
|
+
readonly schema: readonly object[];
|
|
31
|
+
};
|
|
32
|
+
create(context: {
|
|
33
|
+
options: UtilRequireConstantNamingRuleOptions[];
|
|
34
|
+
report: (descriptor: {
|
|
35
|
+
node: AstNode;
|
|
36
|
+
messageId: string;
|
|
37
|
+
data?: Record<string, string>;
|
|
38
|
+
}) => void;
|
|
39
|
+
sourceCode: AstNode;
|
|
40
|
+
}): Record<string, (node: AstNode) => void>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* ESLint rule that enforces the dbx-components Constant Naming convention on exported top-level
|
|
44
|
+
* `const` declarations:
|
|
45
|
+
*
|
|
46
|
+
* - Function-typed constants (arrow/function expression initializers, or `: TSFunctionType`
|
|
47
|
+
* annotations) may be camelCase (the usual callable casing) or UPPER_SNAKE_CASE (when the binding
|
|
48
|
+
* is treated as a constant-shaped function reference, e.g. a default factory or registered hook).
|
|
49
|
+
* - Plain-value constants (string/number/boolean/array/object/`new`/template-literal initializers)
|
|
50
|
+
* must be UPPER_SNAKE_CASE. PascalCase is also accepted for class- and enum-like singletons.
|
|
51
|
+
*
|
|
52
|
+
* The rule deliberately skips ambiguous initializers (CallExpressions, identifier aliases, member
|
|
53
|
+
* accesses) because we can't tell without type information whether the binding will end up callable.
|
|
54
|
+
* Use the exempt JSDoc tag (default `@dbxAllowConstantName`) to silence the rule on a specific
|
|
55
|
+
* declaration when the heuristics get it wrong.
|
|
56
|
+
*
|
|
57
|
+
* Not auto-fixable: renaming an exported binding has cross-file impact that an autofix can't safely
|
|
58
|
+
* propagate.
|
|
59
|
+
*
|
|
60
|
+
* @see `dbx__note__typescript-programming` → Constant Naming.
|
|
61
|
+
*/
|
|
62
|
+
export declare const UTIL_REQUIRE_CONSTANT_NAMING_RULE: UtilRequireConstantNamingRuleDefinition;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-action-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxActionCompanionTagsRuleOptions {
|
|
9
|
+
readonly allowedRoles?: readonly string[];
|
|
10
|
+
readonly allowedStates?: readonly string[];
|
|
11
|
+
readonly knownCompanions?: readonly string[];
|
|
12
|
+
readonly requireBareMarker?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ESLint rule definition for require-dbx-action-companion-tags.
|
|
16
|
+
*/
|
|
17
|
+
export interface UtilRequireDbxActionCompanionTagsRuleDefinition {
|
|
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: UtilRequireDbxActionCompanionTagsRuleOptions[];
|
|
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 `@dbxAction` companion tags. Mirrors the scanner
|
|
40
|
+
* schema at `packages/dbx-components-mcp/src/scan/actions-extract.ts`. Class
|
|
41
|
+
* declarations carry the `@dbxAction` marker; enum declarations carry the
|
|
42
|
+
* `@dbxActionStateEnum` marker, and `@dbxActionStateTransitionsFrom/To` are
|
|
43
|
+
* valid on enum-member JSDocs.
|
|
44
|
+
*/
|
|
45
|
+
export declare const UTIL_REQUIRE_DBX_ACTION_COMPANION_TAGS_RULE: UtilRequireDbxActionCompanionTagsRuleDefinition;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-auth-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxAuthCompanionTagsRuleOptions {
|
|
9
|
+
readonly knownCompanions?: readonly string[];
|
|
10
|
+
readonly requireBareMarker?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* ESLint rule definition for require-dbx-auth-companion-tags.
|
|
14
|
+
*/
|
|
15
|
+
export interface UtilRequireDbxAuthCompanionTagsRuleDefinition {
|
|
16
|
+
readonly meta: {
|
|
17
|
+
readonly type: 'suggestion';
|
|
18
|
+
readonly fixable: 'code';
|
|
19
|
+
readonly docs: {
|
|
20
|
+
readonly description: string;
|
|
21
|
+
readonly recommended: boolean;
|
|
22
|
+
};
|
|
23
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
24
|
+
readonly schema: readonly object[];
|
|
25
|
+
};
|
|
26
|
+
create(context: {
|
|
27
|
+
options: UtilRequireDbxAuthCompanionTagsRuleOptions[];
|
|
28
|
+
report: (descriptor: {
|
|
29
|
+
loc?: AstNode;
|
|
30
|
+
messageId: string;
|
|
31
|
+
data?: Record<string, string>;
|
|
32
|
+
}) => void;
|
|
33
|
+
sourceCode: AstNode;
|
|
34
|
+
}): Record<string, (node: AstNode) => void>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* ESLint rule enforcing the three `@dbxAuth*` marker families. Mirrors the
|
|
38
|
+
* scanner schema at `packages/dbx-components-mcp/src/scan/auth-extract.ts`.
|
|
39
|
+
*
|
|
40
|
+
* - `@dbxAuthClaimsApp <slug>` on an interface / type alias.
|
|
41
|
+
* - `@dbxAuthClaim` (bare) on a `PropertySignature` inside an interface.
|
|
42
|
+
* - `@dbxAuthClaimsService <slug>` on an exported `VariableDeclaration`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const UTIL_REQUIRE_DBX_AUTH_COMPANION_TAGS_RULE: UtilRequireDbxAuthCompanionTagsRuleDefinition;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-docs-ui-example-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxDocsUiExampleCompanionTagsRuleOptions {
|
|
9
|
+
readonly allowedCategories?: readonly string[];
|
|
10
|
+
readonly knownCompanions?: readonly string[];
|
|
11
|
+
readonly requireBareMarker?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ESLint rule definition for require-dbx-docs-ui-example-companion-tags.
|
|
15
|
+
*/
|
|
16
|
+
export interface UtilRequireDbxDocsUiExampleCompanionTagsRuleDefinition {
|
|
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: UtilRequireDbxDocsUiExampleCompanionTagsRuleOptions[];
|
|
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 `@dbxDocsUiExample` companion tags. Mirrors the
|
|
39
|
+
* scanner schema at `packages/dbx-components-mcp/src/scan/dbx-docs-ui-examples-extract.ts`.
|
|
40
|
+
*/
|
|
41
|
+
export declare const UTIL_REQUIRE_DBX_DOCS_UI_EXAMPLE_COMPANION_TAGS_RULE: UtilRequireDbxDocsUiExampleCompanionTagsRuleDefinition;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-filter-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxFilterCompanionTagsRuleOptions {
|
|
9
|
+
readonly knownCompanions?: readonly string[];
|
|
10
|
+
readonly requireBareMarker?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* ESLint rule definition for require-dbx-filter-companion-tags.
|
|
14
|
+
*/
|
|
15
|
+
export interface UtilRequireDbxFilterCompanionTagsRuleDefinition {
|
|
16
|
+
readonly meta: {
|
|
17
|
+
readonly type: 'suggestion';
|
|
18
|
+
readonly fixable: 'code';
|
|
19
|
+
readonly docs: {
|
|
20
|
+
readonly description: string;
|
|
21
|
+
readonly recommended: boolean;
|
|
22
|
+
};
|
|
23
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
24
|
+
readonly schema: readonly object[];
|
|
25
|
+
};
|
|
26
|
+
create(context: {
|
|
27
|
+
options: UtilRequireDbxFilterCompanionTagsRuleOptions[];
|
|
28
|
+
report: (descriptor: {
|
|
29
|
+
loc?: AstNode;
|
|
30
|
+
messageId: string;
|
|
31
|
+
data?: Record<string, string>;
|
|
32
|
+
}) => void;
|
|
33
|
+
sourceCode: AstNode;
|
|
34
|
+
}): Record<string, (node: AstNode) => void>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* ESLint rule enforcing `@dbxFilter` companion tags. Mirrors the scanner
|
|
38
|
+
* schema at `packages/dbx-components-mcp/src/scan/filters-extract.ts`.
|
|
39
|
+
* Applies to classes (filter directives) and exported interfaces (filter
|
|
40
|
+
* patterns); the scanner reads both as filter entries.
|
|
41
|
+
*/
|
|
42
|
+
export declare const UTIL_REQUIRE_DBX_FILTER_COMPANION_TAGS_RULE: UtilRequireDbxFilterCompanionTagsRuleDefinition;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-form-field-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxFormFieldCompanionTagsRuleOptions {
|
|
9
|
+
readonly allowedTiers?: readonly string[];
|
|
10
|
+
readonly allowedWrapperPatterns?: readonly string[];
|
|
11
|
+
readonly allowedSuffixes?: readonly string[];
|
|
12
|
+
readonly allowedArrayOutputs?: readonly string[];
|
|
13
|
+
readonly knownCompanions?: readonly string[];
|
|
14
|
+
readonly requireBareMarker?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* ESLint rule definition for require-dbx-form-field-companion-tags.
|
|
18
|
+
*/
|
|
19
|
+
export interface UtilRequireDbxFormFieldCompanionTagsRuleDefinition {
|
|
20
|
+
readonly meta: {
|
|
21
|
+
readonly type: 'suggestion';
|
|
22
|
+
readonly fixable: 'code';
|
|
23
|
+
readonly docs: {
|
|
24
|
+
readonly description: string;
|
|
25
|
+
readonly recommended: boolean;
|
|
26
|
+
};
|
|
27
|
+
readonly messages: Readonly<Record<string, string>>;
|
|
28
|
+
readonly schema: readonly object[];
|
|
29
|
+
};
|
|
30
|
+
create(context: {
|
|
31
|
+
options: UtilRequireDbxFormFieldCompanionTagsRuleOptions[];
|
|
32
|
+
report: (descriptor: {
|
|
33
|
+
loc?: AstNode;
|
|
34
|
+
messageId: string;
|
|
35
|
+
data?: Record<string, string>;
|
|
36
|
+
}) => void;
|
|
37
|
+
sourceCode: AstNode;
|
|
38
|
+
}): Record<string, (node: AstNode) => void>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* ESLint rule enforcing `@dbxFormField` companion tags. Mirrors the scanner
|
|
42
|
+
* schema at `packages/dbx-components-mcp/src/scan/forge-fields-extract.ts`,
|
|
43
|
+
* including the tier-conditional required-tag matrix.
|
|
44
|
+
*/
|
|
45
|
+
export declare const UTIL_REQUIRE_DBX_FORM_FIELD_COMPANION_TAGS_RULE: UtilRequireDbxFormFieldCompanionTagsRuleDefinition;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
interface AstNode {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Options for the require-dbx-model-companion-tags rule.
|
|
7
|
+
*/
|
|
8
|
+
export interface UtilRequireDbxModelCompanionTagsRuleOptions {
|
|
9
|
+
readonly allowedEncodings?: readonly string[];
|
|
10
|
+
readonly knownCompanions?: readonly string[];
|
|
11
|
+
readonly requireBareMarker?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* ESLint rule definition for require-dbx-model-companion-tags.
|
|
15
|
+
*/
|
|
16
|
+
export interface UtilRequireDbxModelCompanionTagsRuleDefinition {
|
|
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: UtilRequireDbxModelCompanionTagsRuleOptions[];
|
|
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 `@dbxModel` / `@dbxModelSubObject` / `@dbxModelOrganizationalGroupRoot`
|
|
39
|
+
* companion tags. Mirrors the scanner schema at
|
|
40
|
+
* `packages/dbx-components-mcp/src/scan/extract-models/find-interfaces.ts`.
|
|
41
|
+
*
|
|
42
|
+
* Does NOT enforce a Slug / Category / Tags shape because the scanner does
|
|
43
|
+
* not consume those for this family.
|
|
44
|
+
*/
|
|
45
|
+
export declare const UTIL_REQUIRE_DBX_MODEL_COMPANION_TAGS_RULE: UtilRequireDbxModelCompanionTagsRuleDefinition;
|
|
46
|
+
export {};
|