@sarj/eslint-plugin 9.7.1 → 9.8.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 +38 -2
- package/dist/index.cjs +691 -504
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -2
- package/dist/index.d.ts +32 -2
- package/dist/index.js +682 -496
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -35,6 +35,18 @@ interface RuleOptions$2 {
|
|
|
35
35
|
readonly methods?: readonly string[];
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @fileoverview no-restricted-library-load — literal runtime module loads must obey the same library policy as static imports.
|
|
40
|
+
*
|
|
41
|
+
* Examples: https://github.com/sarj-ai/standards/blob/main/packages/typescript/tests/rules/no-restricted-library-load.test.ts
|
|
42
|
+
*/
|
|
43
|
+
interface RestrictedLibrary {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly module: string;
|
|
46
|
+
readonly replacement: string;
|
|
47
|
+
readonly note?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
/**
|
|
39
51
|
* @fileoverview no-raw-fetch-outside-clients — a bare `fetch` outside the client layer opts out of retry, timeout and status handling, and cannot be stubbed.
|
|
40
52
|
*
|
|
@@ -138,6 +150,11 @@ declare const rules: {
|
|
|
138
150
|
"no-raw-fetch-outside-clients": _typescript_eslint_utils_ts_eslint.RuleModule<"rawFetch", readonly [RuleOptions$1?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
139
151
|
name: string;
|
|
140
152
|
};
|
|
153
|
+
"no-restricted-library-load": _typescript_eslint_utils_ts_eslint.RuleModule<"restrictedLibraryLoad", readonly [{
|
|
154
|
+
libraries: readonly RestrictedLibrary[];
|
|
155
|
+
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
156
|
+
name: string;
|
|
157
|
+
};
|
|
141
158
|
"no-repeated-string-literal": _typescript_eslint_utils_ts_eslint.RuleModule<"noRepeatedStringLiteral", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
142
159
|
name: string;
|
|
143
160
|
};
|
|
@@ -218,6 +235,9 @@ declare const rules: {
|
|
|
218
235
|
"prefer-non-nullable-collection": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNonNullableCollection", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
219
236
|
name: string;
|
|
220
237
|
};
|
|
238
|
+
"prefer-native-random-uuid": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNative" | "replaceWithNative", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
239
|
+
name: string;
|
|
240
|
+
};
|
|
221
241
|
"prefer-schema-for-api-payload": _typescript_eslint_utils_ts_eslint.RuleModule<"unparsedJsonAccess", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
222
242
|
name: string;
|
|
223
243
|
};
|
|
@@ -272,6 +292,8 @@ declare const rules: {
|
|
|
272
292
|
name: string;
|
|
273
293
|
};
|
|
274
294
|
};
|
|
295
|
+
/** Rules registered for application-profile configs but intentionally absent from general presets. */
|
|
296
|
+
declare const applicationOnlyRules: readonly ["no-restricted-library-load", "prefer-native-random-uuid"];
|
|
275
297
|
declare const recommendedRules: {
|
|
276
298
|
readonly "@sarj/enforce-file-structure": "warn";
|
|
277
299
|
readonly "@sarj/no-async-callback-in-wait-for": "warn";
|
|
@@ -401,7 +423,7 @@ type FlatPreset = {
|
|
|
401
423
|
declare const plugin: {
|
|
402
424
|
meta: {
|
|
403
425
|
readonly name: "@sarj/eslint-plugin";
|
|
404
|
-
readonly version: "9.
|
|
426
|
+
readonly version: "9.8.0";
|
|
405
427
|
};
|
|
406
428
|
rules: {
|
|
407
429
|
"enforce-file-structure": _typescript_eslint_utils_ts_eslint.RuleModule<"importsFirst" | "useServerDirective", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -463,6 +485,11 @@ declare const plugin: {
|
|
|
463
485
|
"no-raw-fetch-outside-clients": _typescript_eslint_utils_ts_eslint.RuleModule<"rawFetch", readonly [RuleOptions$1?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
464
486
|
name: string;
|
|
465
487
|
};
|
|
488
|
+
"no-restricted-library-load": _typescript_eslint_utils_ts_eslint.RuleModule<"restrictedLibraryLoad", readonly [{
|
|
489
|
+
libraries: readonly RestrictedLibrary[];
|
|
490
|
+
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
491
|
+
name: string;
|
|
492
|
+
};
|
|
466
493
|
"no-repeated-string-literal": _typescript_eslint_utils_ts_eslint.RuleModule<"noRepeatedStringLiteral", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
467
494
|
name: string;
|
|
468
495
|
};
|
|
@@ -543,6 +570,9 @@ declare const plugin: {
|
|
|
543
570
|
"prefer-non-nullable-collection": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNonNullableCollection", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
544
571
|
name: string;
|
|
545
572
|
};
|
|
573
|
+
"prefer-native-random-uuid": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNative" | "replaceWithNative", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
574
|
+
name: string;
|
|
575
|
+
};
|
|
546
576
|
"prefer-schema-for-api-payload": _typescript_eslint_utils_ts_eslint.RuleModule<"unparsedJsonAccess", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
547
577
|
name: string;
|
|
548
578
|
};
|
|
@@ -604,4 +634,4 @@ declare const plugin: {
|
|
|
604
634
|
};
|
|
605
635
|
};
|
|
606
636
|
|
|
607
|
-
export { type RetiredRule, plugin as default, recommendedRules, renamedRules, retiredRules, rules, strictRules };
|
|
637
|
+
export { type RetiredRule, applicationOnlyRules, plugin as default, recommendedRules, renamedRules, retiredRules, rules, strictRules };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,18 @@ interface RuleOptions$2 {
|
|
|
35
35
|
readonly methods?: readonly string[];
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/**
|
|
39
|
+
* @fileoverview no-restricted-library-load — literal runtime module loads must obey the same library policy as static imports.
|
|
40
|
+
*
|
|
41
|
+
* Examples: https://github.com/sarj-ai/standards/blob/main/packages/typescript/tests/rules/no-restricted-library-load.test.ts
|
|
42
|
+
*/
|
|
43
|
+
interface RestrictedLibrary {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly module: string;
|
|
46
|
+
readonly replacement: string;
|
|
47
|
+
readonly note?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
/**
|
|
39
51
|
* @fileoverview no-raw-fetch-outside-clients — a bare `fetch` outside the client layer opts out of retry, timeout and status handling, and cannot be stubbed.
|
|
40
52
|
*
|
|
@@ -138,6 +150,11 @@ declare const rules: {
|
|
|
138
150
|
"no-raw-fetch-outside-clients": _typescript_eslint_utils_ts_eslint.RuleModule<"rawFetch", readonly [RuleOptions$1?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
139
151
|
name: string;
|
|
140
152
|
};
|
|
153
|
+
"no-restricted-library-load": _typescript_eslint_utils_ts_eslint.RuleModule<"restrictedLibraryLoad", readonly [{
|
|
154
|
+
libraries: readonly RestrictedLibrary[];
|
|
155
|
+
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
156
|
+
name: string;
|
|
157
|
+
};
|
|
141
158
|
"no-repeated-string-literal": _typescript_eslint_utils_ts_eslint.RuleModule<"noRepeatedStringLiteral", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
142
159
|
name: string;
|
|
143
160
|
};
|
|
@@ -218,6 +235,9 @@ declare const rules: {
|
|
|
218
235
|
"prefer-non-nullable-collection": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNonNullableCollection", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
219
236
|
name: string;
|
|
220
237
|
};
|
|
238
|
+
"prefer-native-random-uuid": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNative" | "replaceWithNative", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
239
|
+
name: string;
|
|
240
|
+
};
|
|
221
241
|
"prefer-schema-for-api-payload": _typescript_eslint_utils_ts_eslint.RuleModule<"unparsedJsonAccess", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
222
242
|
name: string;
|
|
223
243
|
};
|
|
@@ -272,6 +292,8 @@ declare const rules: {
|
|
|
272
292
|
name: string;
|
|
273
293
|
};
|
|
274
294
|
};
|
|
295
|
+
/** Rules registered for application-profile configs but intentionally absent from general presets. */
|
|
296
|
+
declare const applicationOnlyRules: readonly ["no-restricted-library-load", "prefer-native-random-uuid"];
|
|
275
297
|
declare const recommendedRules: {
|
|
276
298
|
readonly "@sarj/enforce-file-structure": "warn";
|
|
277
299
|
readonly "@sarj/no-async-callback-in-wait-for": "warn";
|
|
@@ -401,7 +423,7 @@ type FlatPreset = {
|
|
|
401
423
|
declare const plugin: {
|
|
402
424
|
meta: {
|
|
403
425
|
readonly name: "@sarj/eslint-plugin";
|
|
404
|
-
readonly version: "9.
|
|
426
|
+
readonly version: "9.8.0";
|
|
405
427
|
};
|
|
406
428
|
rules: {
|
|
407
429
|
"enforce-file-structure": _typescript_eslint_utils_ts_eslint.RuleModule<"importsFirst" | "useServerDirective", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -463,6 +485,11 @@ declare const plugin: {
|
|
|
463
485
|
"no-raw-fetch-outside-clients": _typescript_eslint_utils_ts_eslint.RuleModule<"rawFetch", readonly [RuleOptions$1?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
464
486
|
name: string;
|
|
465
487
|
};
|
|
488
|
+
"no-restricted-library-load": _typescript_eslint_utils_ts_eslint.RuleModule<"restrictedLibraryLoad", readonly [{
|
|
489
|
+
libraries: readonly RestrictedLibrary[];
|
|
490
|
+
}], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
491
|
+
name: string;
|
|
492
|
+
};
|
|
466
493
|
"no-repeated-string-literal": _typescript_eslint_utils_ts_eslint.RuleModule<"noRepeatedStringLiteral", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
467
494
|
name: string;
|
|
468
495
|
};
|
|
@@ -543,6 +570,9 @@ declare const plugin: {
|
|
|
543
570
|
"prefer-non-nullable-collection": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNonNullableCollection", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
544
571
|
name: string;
|
|
545
572
|
};
|
|
573
|
+
"prefer-native-random-uuid": _typescript_eslint_utils_ts_eslint.RuleModule<"preferNative" | "replaceWithNative", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
574
|
+
name: string;
|
|
575
|
+
};
|
|
546
576
|
"prefer-schema-for-api-payload": _typescript_eslint_utils_ts_eslint.RuleModule<"unparsedJsonAccess", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
547
577
|
name: string;
|
|
548
578
|
};
|
|
@@ -604,4 +634,4 @@ declare const plugin: {
|
|
|
604
634
|
};
|
|
605
635
|
};
|
|
606
636
|
|
|
607
|
-
export { type RetiredRule, plugin as default, recommendedRules, renamedRules, retiredRules, rules, strictRules };
|
|
637
|
+
export { type RetiredRule, applicationOnlyRules, plugin as default, recommendedRules, renamedRules, retiredRules, rules, strictRules };
|