@noctcore/eslint-plugin-contracts 0.1.0 → 0.2.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/dist/index.d.cts CHANGED
@@ -1,5 +1,28 @@
1
1
  import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
2
 
3
+ interface EnvVarSchemaParityOptions {
4
+ /** Path to the env declaration source — a `.env.example` or a zod-env module. Empty = rule is inert. */
5
+ readonly schema?: string;
6
+ }
7
+
8
+ interface RegisteredKeySink {
9
+ /** Dotted callee path whose key argument must be a registered constant (e.g. `localStorage.getItem`). */
10
+ readonly callee: string;
11
+ /** Zero-based index of the key/name argument to police. */
12
+ readonly argIndex: number;
13
+ }
14
+ interface RequireRegisteredKeysOptions {
15
+ /** Sink APIs whose key argument must be an imported constant, not a raw string. Empty = rule is inert. */
16
+ readonly sinks?: readonly RegisteredKeySink[];
17
+ /** Optional module the constants should be imported from, named in the report. */
18
+ readonly registry?: string;
19
+ }
20
+
21
+ interface RestrictThrowToTaxonomyOptions {
22
+ /** Constructor names permitted as throw targets (your error taxonomy). Default `['Error']`. */
23
+ readonly allow?: readonly string[];
24
+ }
25
+
3
26
  interface MoneyMustBeDecimalOptions {
4
27
  /** Name of the domain money type to require (e.g. `Decimal`, `Money`, `BigDecimal`). */
5
28
  readonly decimalType?: string;
@@ -45,6 +68,21 @@ declare const rules: {
45
68
  'money-must-be-decimal': _typescript_eslint_utils_ts_eslint.RuleModule<"moneyMustBeDecimal", [MoneyMustBeDecimalOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
46
69
  name: string;
47
70
  };
71
+ 'require-error-cause': _typescript_eslint_utils_ts_eslint.RuleModule<"missingCause", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
72
+ name: string;
73
+ };
74
+ 'restrict-throw-to-taxonomy': _typescript_eslint_utils_ts_eslint.RuleModule<"disallowedErrorClass" | "nonErrorThrow", [RestrictThrowToTaxonomyOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
75
+ name: string;
76
+ };
77
+ 'require-registered-keys': _typescript_eslint_utils_ts_eslint.RuleModule<"unregisteredKey", [RequireRegisteredKeysOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
78
+ name: string;
79
+ };
80
+ 'env-var-schema-parity': _typescript_eslint_utils_ts_eslint.RuleModule<"undeclaredEnvVar", [EnvVarSchemaParityOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
81
+ name: string;
82
+ };
83
+ 'require-schema-parse-at-boundary': _typescript_eslint_utils_ts_eslint.RuleModule<"castedBoundaryData", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
84
+ name: string;
85
+ };
48
86
  };
49
87
 
50
88
  declare const plugin: {
@@ -68,6 +106,21 @@ declare const plugin: {
68
106
  'money-must-be-decimal': _typescript_eslint_utils_ts_eslint.RuleModule<"moneyMustBeDecimal", [MoneyMustBeDecimalOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
69
107
  name: string;
70
108
  };
109
+ 'require-error-cause': _typescript_eslint_utils_ts_eslint.RuleModule<"missingCause", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
110
+ name: string;
111
+ };
112
+ 'restrict-throw-to-taxonomy': _typescript_eslint_utils_ts_eslint.RuleModule<"disallowedErrorClass" | "nonErrorThrow", [RestrictThrowToTaxonomyOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
113
+ name: string;
114
+ };
115
+ 'require-registered-keys': _typescript_eslint_utils_ts_eslint.RuleModule<"unregisteredKey", [RequireRegisteredKeysOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
116
+ name: string;
117
+ };
118
+ 'env-var-schema-parity': _typescript_eslint_utils_ts_eslint.RuleModule<"undeclaredEnvVar", [EnvVarSchemaParityOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
119
+ name: string;
120
+ };
121
+ 'require-schema-parse-at-boundary': _typescript_eslint_utils_ts_eslint.RuleModule<"castedBoundaryData", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
122
+ name: string;
123
+ };
71
124
  };
72
125
  configs: Record<string, unknown>;
73
126
  };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,28 @@
1
1
  import * as _typescript_eslint_utils_ts_eslint from '@typescript-eslint/utils/ts-eslint';
2
2
 
3
+ interface EnvVarSchemaParityOptions {
4
+ /** Path to the env declaration source — a `.env.example` or a zod-env module. Empty = rule is inert. */
5
+ readonly schema?: string;
6
+ }
7
+
8
+ interface RegisteredKeySink {
9
+ /** Dotted callee path whose key argument must be a registered constant (e.g. `localStorage.getItem`). */
10
+ readonly callee: string;
11
+ /** Zero-based index of the key/name argument to police. */
12
+ readonly argIndex: number;
13
+ }
14
+ interface RequireRegisteredKeysOptions {
15
+ /** Sink APIs whose key argument must be an imported constant, not a raw string. Empty = rule is inert. */
16
+ readonly sinks?: readonly RegisteredKeySink[];
17
+ /** Optional module the constants should be imported from, named in the report. */
18
+ readonly registry?: string;
19
+ }
20
+
21
+ interface RestrictThrowToTaxonomyOptions {
22
+ /** Constructor names permitted as throw targets (your error taxonomy). Default `['Error']`. */
23
+ readonly allow?: readonly string[];
24
+ }
25
+
3
26
  interface MoneyMustBeDecimalOptions {
4
27
  /** Name of the domain money type to require (e.g. `Decimal`, `Money`, `BigDecimal`). */
5
28
  readonly decimalType?: string;
@@ -45,6 +68,21 @@ declare const rules: {
45
68
  'money-must-be-decimal': _typescript_eslint_utils_ts_eslint.RuleModule<"moneyMustBeDecimal", [MoneyMustBeDecimalOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
46
69
  name: string;
47
70
  };
71
+ 'require-error-cause': _typescript_eslint_utils_ts_eslint.RuleModule<"missingCause", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
72
+ name: string;
73
+ };
74
+ 'restrict-throw-to-taxonomy': _typescript_eslint_utils_ts_eslint.RuleModule<"disallowedErrorClass" | "nonErrorThrow", [RestrictThrowToTaxonomyOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
75
+ name: string;
76
+ };
77
+ 'require-registered-keys': _typescript_eslint_utils_ts_eslint.RuleModule<"unregisteredKey", [RequireRegisteredKeysOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
78
+ name: string;
79
+ };
80
+ 'env-var-schema-parity': _typescript_eslint_utils_ts_eslint.RuleModule<"undeclaredEnvVar", [EnvVarSchemaParityOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
81
+ name: string;
82
+ };
83
+ 'require-schema-parse-at-boundary': _typescript_eslint_utils_ts_eslint.RuleModule<"castedBoundaryData", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
84
+ name: string;
85
+ };
48
86
  };
49
87
 
50
88
  declare const plugin: {
@@ -68,6 +106,21 @@ declare const plugin: {
68
106
  'money-must-be-decimal': _typescript_eslint_utils_ts_eslint.RuleModule<"moneyMustBeDecimal", [MoneyMustBeDecimalOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
69
107
  name: string;
70
108
  };
109
+ 'require-error-cause': _typescript_eslint_utils_ts_eslint.RuleModule<"missingCause", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
110
+ name: string;
111
+ };
112
+ 'restrict-throw-to-taxonomy': _typescript_eslint_utils_ts_eslint.RuleModule<"disallowedErrorClass" | "nonErrorThrow", [RestrictThrowToTaxonomyOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
113
+ name: string;
114
+ };
115
+ 'require-registered-keys': _typescript_eslint_utils_ts_eslint.RuleModule<"unregisteredKey", [RequireRegisteredKeysOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
116
+ name: string;
117
+ };
118
+ 'env-var-schema-parity': _typescript_eslint_utils_ts_eslint.RuleModule<"undeclaredEnvVar", [EnvVarSchemaParityOptions], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
119
+ name: string;
120
+ };
121
+ 'require-schema-parse-at-boundary': _typescript_eslint_utils_ts_eslint.RuleModule<"castedBoundaryData", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
122
+ name: string;
123
+ };
71
124
  };
72
125
  configs: Record<string, unknown>;
73
126
  };