@sarj/eslint-plugin 9.17.1 → 11.0.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 +12 -8
- package/dist/index.cjs +116 -97
- package/dist/index.d.cts +64 -72
- package/dist/index.d.ts +64 -72
- package/dist/index.js +116 -97
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,11 +26,16 @@ import sarj from "@sarj/eslint-plugin";
|
|
|
26
26
|
export default [sarj.configs.recommended];
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
66 rules. Each source under `src/rules/` states one concise claim and links to
|
|
30
30
|
its paired tests. The definition and named test cases are the complete rule
|
|
31
31
|
specification, and `meta.docs.url` points directly to those executable examples.
|
|
32
32
|
|
|
33
|
-
Presets: `recommended`
|
|
33
|
+
Presets: `recommended` is a curated subset and `strict` contains every
|
|
34
|
+
general-profile rule. Every active custom rule in both presets is an error;
|
|
35
|
+
rules that cannot meet that bar are narrowed or retired instead of being left
|
|
36
|
+
as permanent warning noise. Application-only rules are exported through
|
|
37
|
+
`applicationOnlyRules` and are also errors when the application profile enables
|
|
38
|
+
them. `style-guide` remains the formatting/naming subset.
|
|
34
39
|
|
|
35
40
|
## New in 9.8.0 — application library policy adapters
|
|
36
41
|
|
|
@@ -130,15 +135,14 @@ platform too.
|
|
|
130
135
|
|---|---|---|
|
|
131
136
|
| `no-hand-rolled-spinner` | Intrinsic elements styled as Tailwind border-ring loading spinners outside the design system. | error / error |
|
|
132
137
|
| `prefer-input-group-search` | Search icons and shared Input controls composed without the shared InputGroup primitive. | error / error |
|
|
133
|
-
| `prefer-shadcn-primitives` | Deterministically visible raw JSX controls used instead of shared shadcn primitives. Unknown and hidden input types are excluded. | application profile:
|
|
138
|
+
| `prefer-shadcn-primitives` | Deterministically visible raw JSX controls used instead of shared shadcn primitives. Unknown and hidden input types are excluded. | application profile: error |
|
|
134
139
|
| `require-static-next-matcher` | Dynamic values in exported Next.js middleware and proxy matcher configuration. | error / error |
|
|
135
|
-
| `no-hand-rolled-sleep` | `new Promise((r) => setTimeout(r, ms))` in any spelling, and an uncleared `Promise.race`/`Promise.any` timeout arm. Options: `checkClientModules` (default `false`), `allowIn`. |
|
|
140
|
+
| `no-hand-rolled-sleep` | `new Promise((r) => setTimeout(r, ms))` in any spelling, and an uncleared `Promise.race`/`Promise.any` timeout arm. Options: `checkClientModules` (default `false`), `allowIn`. | error / error |
|
|
136
141
|
|
|
137
142
|
`prefer-shadcn-primitives` is application-only because generic plugin consumers
|
|
138
|
-
may use another design system or intentionally expose native controls.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
findings are removed, and keep it disabled inside `components/ui` and
|
|
143
|
+
may use another design system or intentionally expose native controls. The
|
|
144
|
+
application profile enforces its measured, deterministic cases as errors while
|
|
145
|
+
keeping it disabled inside `components/ui` and
|
|
142
146
|
`components/design-system`, where shared primitives must wrap native elements.
|
|
143
147
|
|
|
144
148
|
## New in 2.14.0 — `no-tautological-expect`
|
package/dist/index.cjs
CHANGED
|
@@ -928,6 +928,8 @@ var CODE_TAIL_RE = /[;{}()]\s*$|=>\s*$|,\s*$/;
|
|
|
928
928
|
var ASSIGN_RE = /^[A-Za-z_$][\w.$[\]]*\s*(?:=(?![=>])|\+=|-=|\*=)\s*\S.*[;)}\]]\s*$/;
|
|
929
929
|
var CALL_RE = /^[A-Za-z_$][\w.$]*\([^)]*\)\s*;?\s*$/;
|
|
930
930
|
var ASSERTION_CODE_RE = /^(?:await\s+)?(?:expect(?:TypeOf)?|assert(?:\.\w+)?)\s*\(/;
|
|
931
|
+
var HTTP_CONTRACT_RE = /\b(?:GET|HEAD|OPTIONS|PATCH|POST|PUT|DELETE)\s+(?:https?:\/\/|\/|\{[A-Za-z_$])/;
|
|
932
|
+
var PROSE_ASSIGNMENT_RE = /^[A-Za-z_$][\w.$[\]]*\s*=\s*[A-Za-z][A-Za-z '-]{2,}\s+\((?:how|what|when|where|which|who|why)\b[^)]*\)[.!]?$/i;
|
|
931
933
|
var PSEUDOCODE_RE = /%\w+%|\[opt\]|(?:^|\s)<[A-Za-z]\w*>|…|\.\.\./;
|
|
932
934
|
function isBanner(text) {
|
|
933
935
|
const t = text.trim();
|
|
@@ -946,6 +948,7 @@ function isRegionMarker(text) {
|
|
|
946
948
|
function looksLikeCode(text, allowCall = true) {
|
|
947
949
|
const t = text.trim();
|
|
948
950
|
if (!t) return false;
|
|
951
|
+
if (PROSE_ASSIGNMENT_RE.test(t)) return false;
|
|
949
952
|
if (CODE_KEYWORD_RE.test(t) && CODE_TAIL_RE.test(t)) return true;
|
|
950
953
|
if (ASSIGN_RE.test(t)) return true;
|
|
951
954
|
if (ASSERTION_CODE_RE.test(t)) return true;
|
|
@@ -1084,6 +1087,21 @@ function runCitesAReference(comments, index) {
|
|
|
1084
1087
|
function areAdjacentLineComments(a, b) {
|
|
1085
1088
|
return a !== void 0 && b !== void 0 && a.type === "Line" && b.type === "Line" && b.loc.start.line === a.loc.end.line + 1;
|
|
1086
1089
|
}
|
|
1090
|
+
function lineRunStart(comments, index) {
|
|
1091
|
+
let start = index;
|
|
1092
|
+
while (start > 0 && areAdjacentLineComments(comments[start - 1], comments[start])) {
|
|
1093
|
+
start -= 1;
|
|
1094
|
+
}
|
|
1095
|
+
return start;
|
|
1096
|
+
}
|
|
1097
|
+
function runDocumentsHttpContract(comments, index) {
|
|
1098
|
+
const start = lineRunStart(comments, index);
|
|
1099
|
+
for (let i = start; i < comments.length; i++) {
|
|
1100
|
+
if (i > start && !areAdjacentLineComments(comments[i - 1], comments[i])) break;
|
|
1101
|
+
if (HTTP_CONTRACT_RE.test(stripCommentMarker(comments[i]?.value ?? ""))) return true;
|
|
1102
|
+
}
|
|
1103
|
+
return false;
|
|
1104
|
+
}
|
|
1087
1105
|
function isInsideCommentRun(comments, index) {
|
|
1088
1106
|
const comment = comments[index];
|
|
1089
1107
|
return areAdjacentLineComments(comments[index - 1], comment) || areAdjacentLineComments(comment, comments[index + 1]);
|
|
@@ -1119,7 +1137,7 @@ var no_comment_cruft_default = createRule({
|
|
|
1119
1137
|
schema: [],
|
|
1120
1138
|
messages: {
|
|
1121
1139
|
commentedOutCode: "Commented-out code \u2014 delete it; git history remembers.",
|
|
1122
|
-
sectionBanner: "Section-banner / region comment \u2014
|
|
1140
|
+
sectionBanner: "Section-banner / region comment \u2014 remove the decoration or replace it with a named code boundary.",
|
|
1123
1141
|
fileHeaderPreamble: "File-header comment preamble \u2014 use a brief doc comment for the why, not a block of `//` lines.",
|
|
1124
1142
|
commentWall: "Statement comment wall ({{count}} narrated steps) \u2014 delete the walkthrough and name the operations in code; keep only constraints or rationale.",
|
|
1125
1143
|
redundantNarration: "Comment narrates the code \u2014 delete it or say *why*, not *what*. Code is self-documenting.",
|
|
@@ -1142,6 +1160,17 @@ var no_comment_cruft_default = createRule({
|
|
|
1142
1160
|
function isJsDoc(comment) {
|
|
1143
1161
|
return comment.type === "Block" && /^\*/.test(comment.value);
|
|
1144
1162
|
}
|
|
1163
|
+
function isJsxOnlyComment(comment) {
|
|
1164
|
+
for (let node = sourceCode.getNodeByRangeIndex(
|
|
1165
|
+
comment.range[0]
|
|
1166
|
+
); node != null; node = node.parent) {
|
|
1167
|
+
if (node.type === import_utils7.AST_NODE_TYPES.JSXExpressionContainer) {
|
|
1168
|
+
return node.expression.type === import_utils7.AST_NODE_TYPES.JSXEmptyExpression;
|
|
1169
|
+
}
|
|
1170
|
+
if (node.type === import_utils7.AST_NODE_TYPES.Program) return false;
|
|
1171
|
+
}
|
|
1172
|
+
return false;
|
|
1173
|
+
}
|
|
1145
1174
|
function findCommentWalls(comments) {
|
|
1146
1175
|
const attached = /* @__PURE__ */ new Map();
|
|
1147
1176
|
for (const comment of comments) {
|
|
@@ -1223,6 +1252,8 @@ var no_comment_cruft_default = createRule({
|
|
|
1223
1252
|
const enumerated = comments.filter(
|
|
1224
1253
|
(c) => c.type === "Line" && ENUMERATION_RE.test(stripCommentMarker(c.value))
|
|
1225
1254
|
);
|
|
1255
|
+
const reportedBannerRuns = /* @__PURE__ */ new Set();
|
|
1256
|
+
const reportedCodeRuns = /* @__PURE__ */ new Set();
|
|
1226
1257
|
for (let i = 0; i < comments.length; i++) {
|
|
1227
1258
|
const comment = comments[i];
|
|
1228
1259
|
if (comment === void 0) continue;
|
|
@@ -1242,9 +1273,14 @@ var no_comment_cruft_default = createRule({
|
|
|
1242
1273
|
}
|
|
1243
1274
|
continue;
|
|
1244
1275
|
}
|
|
1245
|
-
if (!isStandalone(comment)) continue;
|
|
1246
1276
|
if (LICENSE_RE.test(comment.value)) continue;
|
|
1247
1277
|
const texts = comment.value.split("\n").map(stripCommentMarker).filter((l) => l.length > 0 && !isDirective(l));
|
|
1278
|
+
if (!isStandalone(comment)) {
|
|
1279
|
+
if (isJsxOnlyComment(comment) && texts.some(isBanner)) {
|
|
1280
|
+
context.report({ node: comment, messageId: "sectionBanner" });
|
|
1281
|
+
}
|
|
1282
|
+
continue;
|
|
1283
|
+
}
|
|
1248
1284
|
const firstText = texts[0];
|
|
1249
1285
|
if (firstText !== void 0 && /^(?:todo|fixme)\b/i.test(firstText)) {
|
|
1250
1286
|
if (!runCitesAReference(comments, i)) {
|
|
@@ -1259,16 +1295,23 @@ var no_comment_cruft_default = createRule({
|
|
|
1259
1295
|
context.report({ node: comment, messageId: "placeholderImplementation" });
|
|
1260
1296
|
continue;
|
|
1261
1297
|
}
|
|
1298
|
+
const runStart = lineRunStart(comments, i);
|
|
1262
1299
|
if (texts.some(isBanner)) {
|
|
1263
|
-
|
|
1300
|
+
if (!reportedBannerRuns.has(runStart)) {
|
|
1301
|
+
context.report({ node: comment, messageId: "sectionBanner" });
|
|
1302
|
+
reportedBannerRuns.add(runStart);
|
|
1303
|
+
}
|
|
1264
1304
|
continue;
|
|
1265
1305
|
}
|
|
1266
1306
|
const prev = comments[i - 1];
|
|
1267
1307
|
const precedingProse = prev !== void 0 && prev.type === "Line" && prev.loc.end.line === comment.loc.start.line - 1 && isProse(stripCommentMarker(prev.value));
|
|
1268
1308
|
const container = sourceCode.getNodeByRangeIndex(comment.range[0]);
|
|
1269
1309
|
const inTypeMembers = container !== null && TYPE_MEMBER_CONTAINERS.has(container.type);
|
|
1270
|
-
if (hasCommentedOutCode(texts, precedingProse, !inTypeMembers) && !hasIllustrationLeadInAbove(comments, i)) {
|
|
1271
|
-
|
|
1310
|
+
if (hasCommentedOutCode(texts, precedingProse, !inTypeMembers) && !hasIllustrationLeadInAbove(comments, i) && !runDocumentsHttpContract(comments, i)) {
|
|
1311
|
+
if (!reportedCodeRuns.has(runStart)) {
|
|
1312
|
+
context.report({ node: comment, messageId: "commentedOutCode" });
|
|
1313
|
+
reportedCodeRuns.add(runStart);
|
|
1314
|
+
}
|
|
1272
1315
|
continue;
|
|
1273
1316
|
}
|
|
1274
1317
|
if (comment.type === "Line" && texts.length === 1) {
|
|
@@ -9759,31 +9802,6 @@ var prefer_server_actions_default = createRule({
|
|
|
9759
9802
|
}
|
|
9760
9803
|
});
|
|
9761
9804
|
|
|
9762
|
-
// src/rules/prefer-single-sentence-comment.ts
|
|
9763
|
-
var prefer_single_sentence_comment_default = createRule({
|
|
9764
|
-
name: "prefer-single-sentence-comment",
|
|
9765
|
-
meta: {
|
|
9766
|
-
type: "suggestion",
|
|
9767
|
-
docs: { description: "Prefer one sentence and self-documenting code over a two-sentence comment." },
|
|
9768
|
-
schema: [],
|
|
9769
|
-
messages: {
|
|
9770
|
-
preferOneSentence: "Two-sentence comment \u2014 prefer one sentence and self-documenting code."
|
|
9771
|
-
}
|
|
9772
|
-
},
|
|
9773
|
-
defaultOptions: [],
|
|
9774
|
-
create(context) {
|
|
9775
|
-
return {
|
|
9776
|
-
Program() {
|
|
9777
|
-
for (const group of proseGroups(context.filename, context.sourceCode)) {
|
|
9778
|
-
if (!group.hasTypedTags && sentenceUnits(group.text) === 2) {
|
|
9779
|
-
context.report({ node: group.comment, messageId: "preferOneSentence" });
|
|
9780
|
-
}
|
|
9781
|
-
}
|
|
9782
|
-
}
|
|
9783
|
-
};
|
|
9784
|
-
}
|
|
9785
|
-
});
|
|
9786
|
-
|
|
9787
9805
|
// src/rules/prefer-string-literal-union.ts
|
|
9788
9806
|
var import_utils62 = require("@typescript-eslint/utils");
|
|
9789
9807
|
var ts2 = __toESM(require("typescript"), 1);
|
|
@@ -12271,6 +12289,10 @@ var retiredRules = {
|
|
|
12271
12289
|
removedIn: "3.0.0",
|
|
12272
12290
|
reason: "Delete the retired entry; application-profile consumers can separately adopt `@sarj/prefer-shadcn-primitives`."
|
|
12273
12291
|
},
|
|
12292
|
+
"prefer-single-sentence-comment": {
|
|
12293
|
+
removedIn: "10.0.0",
|
|
12294
|
+
reason: "Delete the config entry and suppressions; use the narrower no-comment-cruft, no-restated-comment, and no-long-comment rules."
|
|
12295
|
+
},
|
|
12274
12296
|
"primary-export-file-name": {
|
|
12275
12297
|
removedIn: "4.0.0",
|
|
12276
12298
|
reason: "Delete the config entry and suppressions; there is no replacement."
|
|
@@ -12345,7 +12367,6 @@ var rules = {
|
|
|
12345
12367
|
"prefer-schema-for-api-payload": prefer_schema_for_api_payload_default,
|
|
12346
12368
|
"prefer-semantic-colors": prefer_semantic_colors_default,
|
|
12347
12369
|
"prefer-server-actions": prefer_server_actions_default,
|
|
12348
|
-
"prefer-single-sentence-comment": prefer_single_sentence_comment_default,
|
|
12349
12370
|
"prefer-string-literal-union": prefer_string_literal_union_default,
|
|
12350
12371
|
"prefer-whole-object-assertion": prefer_whole_object_assertion_default,
|
|
12351
12372
|
"prefer-zod-enum": prefer_zod_enum_default,
|
|
@@ -12361,7 +12382,7 @@ var rules = {
|
|
|
12361
12382
|
};
|
|
12362
12383
|
var meta = {
|
|
12363
12384
|
name: "@sarj/eslint-plugin",
|
|
12364
|
-
version: "
|
|
12385
|
+
version: "11.0.0"
|
|
12365
12386
|
};
|
|
12366
12387
|
var applicationOnlyRules = [
|
|
12367
12388
|
"no-restricted-library-load",
|
|
@@ -12369,69 +12390,68 @@ var applicationOnlyRules = [
|
|
|
12369
12390
|
"prefer-shadcn-primitives"
|
|
12370
12391
|
];
|
|
12371
12392
|
var recommendedRules = {
|
|
12372
|
-
"@sarj/duplicate-test-body": "
|
|
12373
|
-
"@sarj/enforce-file-structure": "
|
|
12374
|
-
"@sarj/no-async-callback-in-wait-for": "
|
|
12375
|
-
"@sarj/no-client-side-data-fetching": "
|
|
12376
|
-
"@sarj/no-comment-cruft": "
|
|
12377
|
-
"@sarj/no-conditional-in-test": "
|
|
12378
|
-
"@sarj/no-cors-wildcard-with-credentials": "
|
|
12379
|
-
"@sarj/no-dynamic-sql": "
|
|
12380
|
-
"@sarj/no-fat-try-blocks": "
|
|
12381
|
-
"@sarj/no-hand-rolled-sleep": "
|
|
12393
|
+
"@sarj/duplicate-test-body": "error",
|
|
12394
|
+
"@sarj/enforce-file-structure": "error",
|
|
12395
|
+
"@sarj/no-async-callback-in-wait-for": "error",
|
|
12396
|
+
"@sarj/no-client-side-data-fetching": "error",
|
|
12397
|
+
"@sarj/no-comment-cruft": "error",
|
|
12398
|
+
"@sarj/no-conditional-in-test": "error",
|
|
12399
|
+
"@sarj/no-cors-wildcard-with-credentials": "error",
|
|
12400
|
+
"@sarj/no-dynamic-sql": "error",
|
|
12401
|
+
"@sarj/no-fat-try-blocks": "error",
|
|
12402
|
+
"@sarj/no-hand-rolled-sleep": "error",
|
|
12382
12403
|
"@sarj/no-hand-rolled-spinner": "error",
|
|
12383
|
-
"@sarj/no-insecure-random-id": "
|
|
12384
|
-
"@sarj/no-json-stringify-error": "
|
|
12385
|
-
"@sarj/no-log-only-catch": "
|
|
12386
|
-
"@sarj/no-long-comment": "
|
|
12387
|
-
"@sarj/no-generic-single-export-module": "
|
|
12388
|
-
"@sarj/no-offset-pagination": "
|
|
12389
|
-
"@sarj/no-positional-tuple-return": "
|
|
12390
|
-
"@sarj/no-repeated-string-literal": "
|
|
12391
|
-
"@sarj/no-restated-comment": "
|
|
12392
|
-
"@sarj/no-restated-jsdoc": "
|
|
12393
|
-
"@sarj/no-secret-in-log": "
|
|
12394
|
-
"@sarj/no-select-star": "
|
|
12395
|
-
"@sarj/no-sentinel-return-on-catch": "
|
|
12396
|
-
"@sarj/no-silent-promise-catch": "
|
|
12397
|
-
"@sarj/no-sleep-in-test-body": "
|
|
12398
|
-
"@sarj/no-string-concat-in-loop": "
|
|
12399
|
-
"@sarj/no-tautological-expect": "
|
|
12400
|
-
"@sarj/no-typed-doc-sections": "
|
|
12401
|
-
"@sarj/no-trailing-value-narration": "
|
|
12402
|
-
"@sarj/no-declaration-comment-wall": "
|
|
12403
|
-
"@sarj/no-union-in-comment": "
|
|
12404
|
-
"@sarj/no-type-member-comment-wall": "
|
|
12405
|
-
"@sarj/no-unnecessary-use-client": "
|
|
12406
|
-
"@sarj/no-unsafe-mock-casting": "
|
|
12407
|
-
"@sarj/no-zod-native-enum": "
|
|
12408
|
-
"@sarj/test-loops-over-literal-cases": "
|
|
12404
|
+
"@sarj/no-insecure-random-id": "error",
|
|
12405
|
+
"@sarj/no-json-stringify-error": "error",
|
|
12406
|
+
"@sarj/no-log-only-catch": "error",
|
|
12407
|
+
"@sarj/no-long-comment": "error",
|
|
12408
|
+
"@sarj/no-generic-single-export-module": "error",
|
|
12409
|
+
"@sarj/no-offset-pagination": "error",
|
|
12410
|
+
"@sarj/no-positional-tuple-return": "error",
|
|
12411
|
+
"@sarj/no-repeated-string-literal": "error",
|
|
12412
|
+
"@sarj/no-restated-comment": "error",
|
|
12413
|
+
"@sarj/no-restated-jsdoc": "error",
|
|
12414
|
+
"@sarj/no-secret-in-log": "error",
|
|
12415
|
+
"@sarj/no-select-star": "error",
|
|
12416
|
+
"@sarj/no-sentinel-return-on-catch": "error",
|
|
12417
|
+
"@sarj/no-silent-promise-catch": "error",
|
|
12418
|
+
"@sarj/no-sleep-in-test-body": "error",
|
|
12419
|
+
"@sarj/no-string-concat-in-loop": "error",
|
|
12420
|
+
"@sarj/no-tautological-expect": "error",
|
|
12421
|
+
"@sarj/no-typed-doc-sections": "error",
|
|
12422
|
+
"@sarj/no-trailing-value-narration": "error",
|
|
12423
|
+
"@sarj/no-declaration-comment-wall": "error",
|
|
12424
|
+
"@sarj/no-union-in-comment": "error",
|
|
12425
|
+
"@sarj/no-type-member-comment-wall": "error",
|
|
12426
|
+
"@sarj/no-unnecessary-use-client": "error",
|
|
12427
|
+
"@sarj/no-unsafe-mock-casting": "error",
|
|
12428
|
+
"@sarj/no-zod-native-enum": "error",
|
|
12429
|
+
"@sarj/test-loops-over-literal-cases": "error",
|
|
12409
12430
|
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
12410
|
-
"@sarj/prefer-discriminated-union": "
|
|
12431
|
+
"@sarj/prefer-discriminated-union": "error",
|
|
12411
12432
|
"@sarj/prefer-input-group-search": "error",
|
|
12412
|
-
"@sarj/prefer-immutable-module-constant": "
|
|
12413
|
-
"@sarj/prefer-module-level-constant": "
|
|
12414
|
-
"@sarj/prefer-module-level-schema": "
|
|
12415
|
-
"@sarj/prefer-non-nullable-collection": "
|
|
12416
|
-
"@sarj/prefer-schema-for-api-payload": "
|
|
12417
|
-
"@sarj/prefer-semantic-colors": ["
|
|
12418
|
-
"@sarj/prefer-server-actions": "
|
|
12419
|
-
"@sarj/prefer-
|
|
12420
|
-
"@sarj/prefer-
|
|
12421
|
-
"@sarj/prefer-
|
|
12422
|
-
"@sarj/prefer-zod-
|
|
12423
|
-
"@sarj/
|
|
12424
|
-
"@sarj/require-
|
|
12425
|
-
"@sarj/require-
|
|
12426
|
-
"@sarj/require-interface-for-injected-service": "warn",
|
|
12433
|
+
"@sarj/prefer-immutable-module-constant": "error",
|
|
12434
|
+
"@sarj/prefer-module-level-constant": "error",
|
|
12435
|
+
"@sarj/prefer-module-level-schema": "error",
|
|
12436
|
+
"@sarj/prefer-non-nullable-collection": "error",
|
|
12437
|
+
"@sarj/prefer-schema-for-api-payload": "error",
|
|
12438
|
+
"@sarj/prefer-semantic-colors": ["error", { requireSemanticTokens: true }],
|
|
12439
|
+
"@sarj/prefer-server-actions": "error",
|
|
12440
|
+
"@sarj/prefer-string-literal-union": "error",
|
|
12441
|
+
"@sarj/prefer-whole-object-assertion": "error",
|
|
12442
|
+
"@sarj/prefer-zod-enum": "error",
|
|
12443
|
+
"@sarj/prefer-zod-infer": "error",
|
|
12444
|
+
"@sarj/require-assert-never": "error",
|
|
12445
|
+
"@sarj/require-fetch-timeout": "error",
|
|
12446
|
+
"@sarj/require-interface-for-injected-service": "error",
|
|
12427
12447
|
"@sarj/require-static-next-matcher": "error",
|
|
12428
12448
|
"@sarj/require-zod-form-validation": "error",
|
|
12429
|
-
"@sarj/store-insert-requires-on-conflict": "
|
|
12430
|
-
"@sarj/stepdown": "
|
|
12431
|
-
"@sarj/zod-naming-convention": "
|
|
12449
|
+
"@sarj/store-insert-requires-on-conflict": "error",
|
|
12450
|
+
"@sarj/stepdown": "error",
|
|
12451
|
+
"@sarj/zod-naming-convention": "error"
|
|
12432
12452
|
};
|
|
12433
12453
|
var strictRules = {
|
|
12434
|
-
"@sarj/duplicate-test-body": "
|
|
12454
|
+
"@sarj/duplicate-test-body": "error",
|
|
12435
12455
|
"@sarj/enforce-file-structure": "error",
|
|
12436
12456
|
"@sarj/no-async-callback-in-wait-for": "error",
|
|
12437
12457
|
"@sarj/no-client-side-data-fetching": "error",
|
|
@@ -12447,7 +12467,7 @@ var strictRules = {
|
|
|
12447
12467
|
"@sarj/no-json-stringify-error": "error",
|
|
12448
12468
|
"@sarj/no-log-only-catch": "error",
|
|
12449
12469
|
"@sarj/no-long-comment": "error",
|
|
12450
|
-
"@sarj/no-generic-single-export-module": "
|
|
12470
|
+
"@sarj/no-generic-single-export-module": "error",
|
|
12451
12471
|
"@sarj/no-offset-pagination": "error",
|
|
12452
12472
|
"@sarj/no-positional-tuple-return": "error",
|
|
12453
12473
|
"@sarj/no-raw-env": "error",
|
|
@@ -12471,29 +12491,28 @@ var strictRules = {
|
|
|
12471
12491
|
"@sarj/no-unnecessary-use-client": "error",
|
|
12472
12492
|
"@sarj/no-unsafe-mock-casting": "error",
|
|
12473
12493
|
"@sarj/no-zod-native-enum": "error",
|
|
12474
|
-
"@sarj/test-loops-over-literal-cases": "
|
|
12494
|
+
"@sarj/test-loops-over-literal-cases": "error",
|
|
12475
12495
|
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
12476
|
-
"@sarj/prefer-discriminated-union": "
|
|
12496
|
+
"@sarj/prefer-discriminated-union": "error",
|
|
12477
12497
|
"@sarj/prefer-input-group-search": "error",
|
|
12478
|
-
"@sarj/prefer-immutable-module-constant": "
|
|
12498
|
+
"@sarj/prefer-immutable-module-constant": "error",
|
|
12479
12499
|
"@sarj/prefer-module-level-constant": "error",
|
|
12480
12500
|
"@sarj/prefer-module-level-schema": "error",
|
|
12481
|
-
"@sarj/prefer-non-nullable-collection": "
|
|
12501
|
+
"@sarj/prefer-non-nullable-collection": "error",
|
|
12482
12502
|
"@sarj/prefer-schema-for-api-payload": "error",
|
|
12483
12503
|
"@sarj/prefer-semantic-colors": ["error", { requireSemanticTokens: true }],
|
|
12484
12504
|
"@sarj/prefer-server-actions": "error",
|
|
12485
|
-
"@sarj/prefer-single-sentence-comment": "warn",
|
|
12486
12505
|
"@sarj/prefer-string-literal-union": "error",
|
|
12487
12506
|
"@sarj/prefer-whole-object-assertion": "error",
|
|
12488
12507
|
"@sarj/prefer-zod-enum": "error",
|
|
12489
12508
|
"@sarj/prefer-zod-infer": "error",
|
|
12490
|
-
"@sarj/require-assert-never": "
|
|
12509
|
+
"@sarj/require-assert-never": "error",
|
|
12491
12510
|
"@sarj/require-fetch-timeout": "error",
|
|
12492
|
-
"@sarj/require-interface-for-injected-service": "
|
|
12511
|
+
"@sarj/require-interface-for-injected-service": "error",
|
|
12493
12512
|
"@sarj/require-static-next-matcher": "error",
|
|
12494
12513
|
"@sarj/require-zod-form-validation": "error",
|
|
12495
12514
|
"@sarj/store-insert-requires-on-conflict": "error",
|
|
12496
|
-
"@sarj/stepdown": "
|
|
12515
|
+
"@sarj/stepdown": "error",
|
|
12497
12516
|
"@sarj/zod-naming-convention": "error"
|
|
12498
12517
|
};
|
|
12499
12518
|
var plugin = {
|
package/dist/index.d.cts
CHANGED
|
@@ -267,9 +267,6 @@ declare const rules: {
|
|
|
267
267
|
readonly "prefer-server-actions": _typescript_eslint_utils_ts_eslint.RuleModule<"preferServerAction", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
268
268
|
name: string;
|
|
269
269
|
};
|
|
270
|
-
readonly "prefer-single-sentence-comment": _typescript_eslint_utils_ts_eslint.RuleModule<"preferOneSentence", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
271
|
-
name: string;
|
|
272
|
-
};
|
|
273
270
|
readonly "prefer-string-literal-union": _typescript_eslint_utils_ts_eslint.RuleModule<"bareChoiceField" | "comparisonCluster", readonly [{
|
|
274
271
|
ignoreFields?: readonly string[];
|
|
275
272
|
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -319,71 +316,70 @@ declare const rules: {
|
|
|
319
316
|
/** Rules registered for application-profile configs but intentionally absent from general presets. */
|
|
320
317
|
declare const applicationOnlyRules: readonly ["no-restricted-library-load", "prefer-native-random-uuid", "prefer-shadcn-primitives"];
|
|
321
318
|
declare const recommendedRules: {
|
|
322
|
-
readonly "@sarj/duplicate-test-body": "
|
|
323
|
-
readonly "@sarj/enforce-file-structure": "
|
|
324
|
-
readonly "@sarj/no-async-callback-in-wait-for": "
|
|
325
|
-
readonly "@sarj/no-client-side-data-fetching": "
|
|
326
|
-
readonly "@sarj/no-comment-cruft": "
|
|
327
|
-
readonly "@sarj/no-conditional-in-test": "
|
|
328
|
-
readonly "@sarj/no-cors-wildcard-with-credentials": "
|
|
329
|
-
readonly "@sarj/no-dynamic-sql": "
|
|
330
|
-
readonly "@sarj/no-fat-try-blocks": "
|
|
331
|
-
readonly "@sarj/no-hand-rolled-sleep": "
|
|
319
|
+
readonly "@sarj/duplicate-test-body": "error";
|
|
320
|
+
readonly "@sarj/enforce-file-structure": "error";
|
|
321
|
+
readonly "@sarj/no-async-callback-in-wait-for": "error";
|
|
322
|
+
readonly "@sarj/no-client-side-data-fetching": "error";
|
|
323
|
+
readonly "@sarj/no-comment-cruft": "error";
|
|
324
|
+
readonly "@sarj/no-conditional-in-test": "error";
|
|
325
|
+
readonly "@sarj/no-cors-wildcard-with-credentials": "error";
|
|
326
|
+
readonly "@sarj/no-dynamic-sql": "error";
|
|
327
|
+
readonly "@sarj/no-fat-try-blocks": "error";
|
|
328
|
+
readonly "@sarj/no-hand-rolled-sleep": "error";
|
|
332
329
|
readonly "@sarj/no-hand-rolled-spinner": "error";
|
|
333
|
-
readonly "@sarj/no-insecure-random-id": "
|
|
334
|
-
readonly "@sarj/no-json-stringify-error": "
|
|
335
|
-
readonly "@sarj/no-log-only-catch": "
|
|
336
|
-
readonly "@sarj/no-long-comment": "
|
|
337
|
-
readonly "@sarj/no-generic-single-export-module": "
|
|
338
|
-
readonly "@sarj/no-offset-pagination": "
|
|
339
|
-
readonly "@sarj/no-positional-tuple-return": "
|
|
340
|
-
readonly "@sarj/no-repeated-string-literal": "
|
|
341
|
-
readonly "@sarj/no-restated-comment": "
|
|
342
|
-
readonly "@sarj/no-restated-jsdoc": "
|
|
343
|
-
readonly "@sarj/no-secret-in-log": "
|
|
344
|
-
readonly "@sarj/no-select-star": "
|
|
345
|
-
readonly "@sarj/no-sentinel-return-on-catch": "
|
|
346
|
-
readonly "@sarj/no-silent-promise-catch": "
|
|
347
|
-
readonly "@sarj/no-sleep-in-test-body": "
|
|
348
|
-
readonly "@sarj/no-string-concat-in-loop": "
|
|
349
|
-
readonly "@sarj/no-tautological-expect": "
|
|
350
|
-
readonly "@sarj/no-typed-doc-sections": "
|
|
351
|
-
readonly "@sarj/no-trailing-value-narration": "
|
|
352
|
-
readonly "@sarj/no-declaration-comment-wall": "
|
|
353
|
-
readonly "@sarj/no-union-in-comment": "
|
|
354
|
-
readonly "@sarj/no-type-member-comment-wall": "
|
|
355
|
-
readonly "@sarj/no-unnecessary-use-client": "
|
|
356
|
-
readonly "@sarj/no-unsafe-mock-casting": "
|
|
357
|
-
readonly "@sarj/no-zod-native-enum": "
|
|
358
|
-
readonly "@sarj/test-loops-over-literal-cases": "
|
|
330
|
+
readonly "@sarj/no-insecure-random-id": "error";
|
|
331
|
+
readonly "@sarj/no-json-stringify-error": "error";
|
|
332
|
+
readonly "@sarj/no-log-only-catch": "error";
|
|
333
|
+
readonly "@sarj/no-long-comment": "error";
|
|
334
|
+
readonly "@sarj/no-generic-single-export-module": "error";
|
|
335
|
+
readonly "@sarj/no-offset-pagination": "error";
|
|
336
|
+
readonly "@sarj/no-positional-tuple-return": "error";
|
|
337
|
+
readonly "@sarj/no-repeated-string-literal": "error";
|
|
338
|
+
readonly "@sarj/no-restated-comment": "error";
|
|
339
|
+
readonly "@sarj/no-restated-jsdoc": "error";
|
|
340
|
+
readonly "@sarj/no-secret-in-log": "error";
|
|
341
|
+
readonly "@sarj/no-select-star": "error";
|
|
342
|
+
readonly "@sarj/no-sentinel-return-on-catch": "error";
|
|
343
|
+
readonly "@sarj/no-silent-promise-catch": "error";
|
|
344
|
+
readonly "@sarj/no-sleep-in-test-body": "error";
|
|
345
|
+
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
346
|
+
readonly "@sarj/no-tautological-expect": "error";
|
|
347
|
+
readonly "@sarj/no-typed-doc-sections": "error";
|
|
348
|
+
readonly "@sarj/no-trailing-value-narration": "error";
|
|
349
|
+
readonly "@sarj/no-declaration-comment-wall": "error";
|
|
350
|
+
readonly "@sarj/no-union-in-comment": "error";
|
|
351
|
+
readonly "@sarj/no-type-member-comment-wall": "error";
|
|
352
|
+
readonly "@sarj/no-unnecessary-use-client": "error";
|
|
353
|
+
readonly "@sarj/no-unsafe-mock-casting": "error";
|
|
354
|
+
readonly "@sarj/no-zod-native-enum": "error";
|
|
355
|
+
readonly "@sarj/test-loops-over-literal-cases": "error";
|
|
359
356
|
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
360
|
-
readonly "@sarj/prefer-discriminated-union": "
|
|
357
|
+
readonly "@sarj/prefer-discriminated-union": "error";
|
|
361
358
|
readonly "@sarj/prefer-input-group-search": "error";
|
|
362
|
-
readonly "@sarj/prefer-immutable-module-constant": "
|
|
363
|
-
readonly "@sarj/prefer-module-level-constant": "
|
|
364
|
-
readonly "@sarj/prefer-module-level-schema": "
|
|
365
|
-
readonly "@sarj/prefer-non-nullable-collection": "
|
|
366
|
-
readonly "@sarj/prefer-schema-for-api-payload": "
|
|
367
|
-
readonly "@sarj/prefer-semantic-colors": readonly ["
|
|
359
|
+
readonly "@sarj/prefer-immutable-module-constant": "error";
|
|
360
|
+
readonly "@sarj/prefer-module-level-constant": "error";
|
|
361
|
+
readonly "@sarj/prefer-module-level-schema": "error";
|
|
362
|
+
readonly "@sarj/prefer-non-nullable-collection": "error";
|
|
363
|
+
readonly "@sarj/prefer-schema-for-api-payload": "error";
|
|
364
|
+
readonly "@sarj/prefer-semantic-colors": readonly ["error", {
|
|
368
365
|
readonly requireSemanticTokens: true;
|
|
369
366
|
}];
|
|
370
|
-
readonly "@sarj/prefer-server-actions": "
|
|
371
|
-
readonly "@sarj/prefer-
|
|
372
|
-
readonly "@sarj/prefer-
|
|
373
|
-
readonly "@sarj/prefer-
|
|
374
|
-
readonly "@sarj/prefer-zod-
|
|
375
|
-
readonly "@sarj/
|
|
376
|
-
readonly "@sarj/require-
|
|
377
|
-
readonly "@sarj/require-
|
|
378
|
-
readonly "@sarj/require-interface-for-injected-service": "warn";
|
|
367
|
+
readonly "@sarj/prefer-server-actions": "error";
|
|
368
|
+
readonly "@sarj/prefer-string-literal-union": "error";
|
|
369
|
+
readonly "@sarj/prefer-whole-object-assertion": "error";
|
|
370
|
+
readonly "@sarj/prefer-zod-enum": "error";
|
|
371
|
+
readonly "@sarj/prefer-zod-infer": "error";
|
|
372
|
+
readonly "@sarj/require-assert-never": "error";
|
|
373
|
+
readonly "@sarj/require-fetch-timeout": "error";
|
|
374
|
+
readonly "@sarj/require-interface-for-injected-service": "error";
|
|
379
375
|
readonly "@sarj/require-static-next-matcher": "error";
|
|
380
376
|
readonly "@sarj/require-zod-form-validation": "error";
|
|
381
|
-
readonly "@sarj/store-insert-requires-on-conflict": "
|
|
382
|
-
readonly "@sarj/stepdown": "
|
|
383
|
-
readonly "@sarj/zod-naming-convention": "
|
|
377
|
+
readonly "@sarj/store-insert-requires-on-conflict": "error";
|
|
378
|
+
readonly "@sarj/stepdown": "error";
|
|
379
|
+
readonly "@sarj/zod-naming-convention": "error";
|
|
384
380
|
};
|
|
385
381
|
declare const strictRules: {
|
|
386
|
-
readonly "@sarj/duplicate-test-body": "
|
|
382
|
+
readonly "@sarj/duplicate-test-body": "error";
|
|
387
383
|
readonly "@sarj/enforce-file-structure": "error";
|
|
388
384
|
readonly "@sarj/no-async-callback-in-wait-for": "error";
|
|
389
385
|
readonly "@sarj/no-client-side-data-fetching": "error";
|
|
@@ -399,7 +395,7 @@ declare const strictRules: {
|
|
|
399
395
|
readonly "@sarj/no-json-stringify-error": "error";
|
|
400
396
|
readonly "@sarj/no-log-only-catch": "error";
|
|
401
397
|
readonly "@sarj/no-long-comment": "error";
|
|
402
|
-
readonly "@sarj/no-generic-single-export-module": "
|
|
398
|
+
readonly "@sarj/no-generic-single-export-module": "error";
|
|
403
399
|
readonly "@sarj/no-offset-pagination": "error";
|
|
404
400
|
readonly "@sarj/no-positional-tuple-return": "error";
|
|
405
401
|
readonly "@sarj/no-raw-env": "error";
|
|
@@ -423,31 +419,30 @@ declare const strictRules: {
|
|
|
423
419
|
readonly "@sarj/no-unnecessary-use-client": "error";
|
|
424
420
|
readonly "@sarj/no-unsafe-mock-casting": "error";
|
|
425
421
|
readonly "@sarj/no-zod-native-enum": "error";
|
|
426
|
-
readonly "@sarj/test-loops-over-literal-cases": "
|
|
422
|
+
readonly "@sarj/test-loops-over-literal-cases": "error";
|
|
427
423
|
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
428
|
-
readonly "@sarj/prefer-discriminated-union": "
|
|
424
|
+
readonly "@sarj/prefer-discriminated-union": "error";
|
|
429
425
|
readonly "@sarj/prefer-input-group-search": "error";
|
|
430
|
-
readonly "@sarj/prefer-immutable-module-constant": "
|
|
426
|
+
readonly "@sarj/prefer-immutable-module-constant": "error";
|
|
431
427
|
readonly "@sarj/prefer-module-level-constant": "error";
|
|
432
428
|
readonly "@sarj/prefer-module-level-schema": "error";
|
|
433
|
-
readonly "@sarj/prefer-non-nullable-collection": "
|
|
429
|
+
readonly "@sarj/prefer-non-nullable-collection": "error";
|
|
434
430
|
readonly "@sarj/prefer-schema-for-api-payload": "error";
|
|
435
431
|
readonly "@sarj/prefer-semantic-colors": readonly ["error", {
|
|
436
432
|
readonly requireSemanticTokens: true;
|
|
437
433
|
}];
|
|
438
434
|
readonly "@sarj/prefer-server-actions": "error";
|
|
439
|
-
readonly "@sarj/prefer-single-sentence-comment": "warn";
|
|
440
435
|
readonly "@sarj/prefer-string-literal-union": "error";
|
|
441
436
|
readonly "@sarj/prefer-whole-object-assertion": "error";
|
|
442
437
|
readonly "@sarj/prefer-zod-enum": "error";
|
|
443
438
|
readonly "@sarj/prefer-zod-infer": "error";
|
|
444
|
-
readonly "@sarj/require-assert-never": "
|
|
439
|
+
readonly "@sarj/require-assert-never": "error";
|
|
445
440
|
readonly "@sarj/require-fetch-timeout": "error";
|
|
446
|
-
readonly "@sarj/require-interface-for-injected-service": "
|
|
441
|
+
readonly "@sarj/require-interface-for-injected-service": "error";
|
|
447
442
|
readonly "@sarj/require-static-next-matcher": "error";
|
|
448
443
|
readonly "@sarj/require-zod-form-validation": "error";
|
|
449
444
|
readonly "@sarj/store-insert-requires-on-conflict": "error";
|
|
450
|
-
readonly "@sarj/stepdown": "
|
|
445
|
+
readonly "@sarj/stepdown": "error";
|
|
451
446
|
readonly "@sarj/zod-naming-convention": "error";
|
|
452
447
|
};
|
|
453
448
|
type FlatPreset = {
|
|
@@ -458,7 +453,7 @@ type FlatPreset = {
|
|
|
458
453
|
declare const plugin: {
|
|
459
454
|
readonly meta: {
|
|
460
455
|
readonly name: "@sarj/eslint-plugin";
|
|
461
|
-
readonly version: "
|
|
456
|
+
readonly version: "11.0.0";
|
|
462
457
|
};
|
|
463
458
|
readonly rules: {
|
|
464
459
|
readonly "duplicate-test-body": _typescript_eslint_utils_ts_eslint.RuleModule<"duplicateTestBody", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -640,9 +635,6 @@ declare const plugin: {
|
|
|
640
635
|
readonly "prefer-server-actions": _typescript_eslint_utils_ts_eslint.RuleModule<"preferServerAction", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
641
636
|
name: string;
|
|
642
637
|
};
|
|
643
|
-
readonly "prefer-single-sentence-comment": _typescript_eslint_utils_ts_eslint.RuleModule<"preferOneSentence", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
644
|
-
name: string;
|
|
645
|
-
};
|
|
646
638
|
readonly "prefer-string-literal-union": _typescript_eslint_utils_ts_eslint.RuleModule<"bareChoiceField" | "comparisonCluster", readonly [{
|
|
647
639
|
ignoreFields?: readonly string[];
|
|
648
640
|
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -267,9 +267,6 @@ declare const rules: {
|
|
|
267
267
|
readonly "prefer-server-actions": _typescript_eslint_utils_ts_eslint.RuleModule<"preferServerAction", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
268
268
|
name: string;
|
|
269
269
|
};
|
|
270
|
-
readonly "prefer-single-sentence-comment": _typescript_eslint_utils_ts_eslint.RuleModule<"preferOneSentence", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
271
|
-
name: string;
|
|
272
|
-
};
|
|
273
270
|
readonly "prefer-string-literal-union": _typescript_eslint_utils_ts_eslint.RuleModule<"bareChoiceField" | "comparisonCluster", readonly [{
|
|
274
271
|
ignoreFields?: readonly string[];
|
|
275
272
|
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -319,71 +316,70 @@ declare const rules: {
|
|
|
319
316
|
/** Rules registered for application-profile configs but intentionally absent from general presets. */
|
|
320
317
|
declare const applicationOnlyRules: readonly ["no-restricted-library-load", "prefer-native-random-uuid", "prefer-shadcn-primitives"];
|
|
321
318
|
declare const recommendedRules: {
|
|
322
|
-
readonly "@sarj/duplicate-test-body": "
|
|
323
|
-
readonly "@sarj/enforce-file-structure": "
|
|
324
|
-
readonly "@sarj/no-async-callback-in-wait-for": "
|
|
325
|
-
readonly "@sarj/no-client-side-data-fetching": "
|
|
326
|
-
readonly "@sarj/no-comment-cruft": "
|
|
327
|
-
readonly "@sarj/no-conditional-in-test": "
|
|
328
|
-
readonly "@sarj/no-cors-wildcard-with-credentials": "
|
|
329
|
-
readonly "@sarj/no-dynamic-sql": "
|
|
330
|
-
readonly "@sarj/no-fat-try-blocks": "
|
|
331
|
-
readonly "@sarj/no-hand-rolled-sleep": "
|
|
319
|
+
readonly "@sarj/duplicate-test-body": "error";
|
|
320
|
+
readonly "@sarj/enforce-file-structure": "error";
|
|
321
|
+
readonly "@sarj/no-async-callback-in-wait-for": "error";
|
|
322
|
+
readonly "@sarj/no-client-side-data-fetching": "error";
|
|
323
|
+
readonly "@sarj/no-comment-cruft": "error";
|
|
324
|
+
readonly "@sarj/no-conditional-in-test": "error";
|
|
325
|
+
readonly "@sarj/no-cors-wildcard-with-credentials": "error";
|
|
326
|
+
readonly "@sarj/no-dynamic-sql": "error";
|
|
327
|
+
readonly "@sarj/no-fat-try-blocks": "error";
|
|
328
|
+
readonly "@sarj/no-hand-rolled-sleep": "error";
|
|
332
329
|
readonly "@sarj/no-hand-rolled-spinner": "error";
|
|
333
|
-
readonly "@sarj/no-insecure-random-id": "
|
|
334
|
-
readonly "@sarj/no-json-stringify-error": "
|
|
335
|
-
readonly "@sarj/no-log-only-catch": "
|
|
336
|
-
readonly "@sarj/no-long-comment": "
|
|
337
|
-
readonly "@sarj/no-generic-single-export-module": "
|
|
338
|
-
readonly "@sarj/no-offset-pagination": "
|
|
339
|
-
readonly "@sarj/no-positional-tuple-return": "
|
|
340
|
-
readonly "@sarj/no-repeated-string-literal": "
|
|
341
|
-
readonly "@sarj/no-restated-comment": "
|
|
342
|
-
readonly "@sarj/no-restated-jsdoc": "
|
|
343
|
-
readonly "@sarj/no-secret-in-log": "
|
|
344
|
-
readonly "@sarj/no-select-star": "
|
|
345
|
-
readonly "@sarj/no-sentinel-return-on-catch": "
|
|
346
|
-
readonly "@sarj/no-silent-promise-catch": "
|
|
347
|
-
readonly "@sarj/no-sleep-in-test-body": "
|
|
348
|
-
readonly "@sarj/no-string-concat-in-loop": "
|
|
349
|
-
readonly "@sarj/no-tautological-expect": "
|
|
350
|
-
readonly "@sarj/no-typed-doc-sections": "
|
|
351
|
-
readonly "@sarj/no-trailing-value-narration": "
|
|
352
|
-
readonly "@sarj/no-declaration-comment-wall": "
|
|
353
|
-
readonly "@sarj/no-union-in-comment": "
|
|
354
|
-
readonly "@sarj/no-type-member-comment-wall": "
|
|
355
|
-
readonly "@sarj/no-unnecessary-use-client": "
|
|
356
|
-
readonly "@sarj/no-unsafe-mock-casting": "
|
|
357
|
-
readonly "@sarj/no-zod-native-enum": "
|
|
358
|
-
readonly "@sarj/test-loops-over-literal-cases": "
|
|
330
|
+
readonly "@sarj/no-insecure-random-id": "error";
|
|
331
|
+
readonly "@sarj/no-json-stringify-error": "error";
|
|
332
|
+
readonly "@sarj/no-log-only-catch": "error";
|
|
333
|
+
readonly "@sarj/no-long-comment": "error";
|
|
334
|
+
readonly "@sarj/no-generic-single-export-module": "error";
|
|
335
|
+
readonly "@sarj/no-offset-pagination": "error";
|
|
336
|
+
readonly "@sarj/no-positional-tuple-return": "error";
|
|
337
|
+
readonly "@sarj/no-repeated-string-literal": "error";
|
|
338
|
+
readonly "@sarj/no-restated-comment": "error";
|
|
339
|
+
readonly "@sarj/no-restated-jsdoc": "error";
|
|
340
|
+
readonly "@sarj/no-secret-in-log": "error";
|
|
341
|
+
readonly "@sarj/no-select-star": "error";
|
|
342
|
+
readonly "@sarj/no-sentinel-return-on-catch": "error";
|
|
343
|
+
readonly "@sarj/no-silent-promise-catch": "error";
|
|
344
|
+
readonly "@sarj/no-sleep-in-test-body": "error";
|
|
345
|
+
readonly "@sarj/no-string-concat-in-loop": "error";
|
|
346
|
+
readonly "@sarj/no-tautological-expect": "error";
|
|
347
|
+
readonly "@sarj/no-typed-doc-sections": "error";
|
|
348
|
+
readonly "@sarj/no-trailing-value-narration": "error";
|
|
349
|
+
readonly "@sarj/no-declaration-comment-wall": "error";
|
|
350
|
+
readonly "@sarj/no-union-in-comment": "error";
|
|
351
|
+
readonly "@sarj/no-type-member-comment-wall": "error";
|
|
352
|
+
readonly "@sarj/no-unnecessary-use-client": "error";
|
|
353
|
+
readonly "@sarj/no-unsafe-mock-casting": "error";
|
|
354
|
+
readonly "@sarj/no-zod-native-enum": "error";
|
|
355
|
+
readonly "@sarj/test-loops-over-literal-cases": "error";
|
|
359
356
|
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
360
|
-
readonly "@sarj/prefer-discriminated-union": "
|
|
357
|
+
readonly "@sarj/prefer-discriminated-union": "error";
|
|
361
358
|
readonly "@sarj/prefer-input-group-search": "error";
|
|
362
|
-
readonly "@sarj/prefer-immutable-module-constant": "
|
|
363
|
-
readonly "@sarj/prefer-module-level-constant": "
|
|
364
|
-
readonly "@sarj/prefer-module-level-schema": "
|
|
365
|
-
readonly "@sarj/prefer-non-nullable-collection": "
|
|
366
|
-
readonly "@sarj/prefer-schema-for-api-payload": "
|
|
367
|
-
readonly "@sarj/prefer-semantic-colors": readonly ["
|
|
359
|
+
readonly "@sarj/prefer-immutable-module-constant": "error";
|
|
360
|
+
readonly "@sarj/prefer-module-level-constant": "error";
|
|
361
|
+
readonly "@sarj/prefer-module-level-schema": "error";
|
|
362
|
+
readonly "@sarj/prefer-non-nullable-collection": "error";
|
|
363
|
+
readonly "@sarj/prefer-schema-for-api-payload": "error";
|
|
364
|
+
readonly "@sarj/prefer-semantic-colors": readonly ["error", {
|
|
368
365
|
readonly requireSemanticTokens: true;
|
|
369
366
|
}];
|
|
370
|
-
readonly "@sarj/prefer-server-actions": "
|
|
371
|
-
readonly "@sarj/prefer-
|
|
372
|
-
readonly "@sarj/prefer-
|
|
373
|
-
readonly "@sarj/prefer-
|
|
374
|
-
readonly "@sarj/prefer-zod-
|
|
375
|
-
readonly "@sarj/
|
|
376
|
-
readonly "@sarj/require-
|
|
377
|
-
readonly "@sarj/require-
|
|
378
|
-
readonly "@sarj/require-interface-for-injected-service": "warn";
|
|
367
|
+
readonly "@sarj/prefer-server-actions": "error";
|
|
368
|
+
readonly "@sarj/prefer-string-literal-union": "error";
|
|
369
|
+
readonly "@sarj/prefer-whole-object-assertion": "error";
|
|
370
|
+
readonly "@sarj/prefer-zod-enum": "error";
|
|
371
|
+
readonly "@sarj/prefer-zod-infer": "error";
|
|
372
|
+
readonly "@sarj/require-assert-never": "error";
|
|
373
|
+
readonly "@sarj/require-fetch-timeout": "error";
|
|
374
|
+
readonly "@sarj/require-interface-for-injected-service": "error";
|
|
379
375
|
readonly "@sarj/require-static-next-matcher": "error";
|
|
380
376
|
readonly "@sarj/require-zod-form-validation": "error";
|
|
381
|
-
readonly "@sarj/store-insert-requires-on-conflict": "
|
|
382
|
-
readonly "@sarj/stepdown": "
|
|
383
|
-
readonly "@sarj/zod-naming-convention": "
|
|
377
|
+
readonly "@sarj/store-insert-requires-on-conflict": "error";
|
|
378
|
+
readonly "@sarj/stepdown": "error";
|
|
379
|
+
readonly "@sarj/zod-naming-convention": "error";
|
|
384
380
|
};
|
|
385
381
|
declare const strictRules: {
|
|
386
|
-
readonly "@sarj/duplicate-test-body": "
|
|
382
|
+
readonly "@sarj/duplicate-test-body": "error";
|
|
387
383
|
readonly "@sarj/enforce-file-structure": "error";
|
|
388
384
|
readonly "@sarj/no-async-callback-in-wait-for": "error";
|
|
389
385
|
readonly "@sarj/no-client-side-data-fetching": "error";
|
|
@@ -399,7 +395,7 @@ declare const strictRules: {
|
|
|
399
395
|
readonly "@sarj/no-json-stringify-error": "error";
|
|
400
396
|
readonly "@sarj/no-log-only-catch": "error";
|
|
401
397
|
readonly "@sarj/no-long-comment": "error";
|
|
402
|
-
readonly "@sarj/no-generic-single-export-module": "
|
|
398
|
+
readonly "@sarj/no-generic-single-export-module": "error";
|
|
403
399
|
readonly "@sarj/no-offset-pagination": "error";
|
|
404
400
|
readonly "@sarj/no-positional-tuple-return": "error";
|
|
405
401
|
readonly "@sarj/no-raw-env": "error";
|
|
@@ -423,31 +419,30 @@ declare const strictRules: {
|
|
|
423
419
|
readonly "@sarj/no-unnecessary-use-client": "error";
|
|
424
420
|
readonly "@sarj/no-unsafe-mock-casting": "error";
|
|
425
421
|
readonly "@sarj/no-zod-native-enum": "error";
|
|
426
|
-
readonly "@sarj/test-loops-over-literal-cases": "
|
|
422
|
+
readonly "@sarj/test-loops-over-literal-cases": "error";
|
|
427
423
|
readonly "@sarj/prefer-constant-time-secret-compare": "error";
|
|
428
|
-
readonly "@sarj/prefer-discriminated-union": "
|
|
424
|
+
readonly "@sarj/prefer-discriminated-union": "error";
|
|
429
425
|
readonly "@sarj/prefer-input-group-search": "error";
|
|
430
|
-
readonly "@sarj/prefer-immutable-module-constant": "
|
|
426
|
+
readonly "@sarj/prefer-immutable-module-constant": "error";
|
|
431
427
|
readonly "@sarj/prefer-module-level-constant": "error";
|
|
432
428
|
readonly "@sarj/prefer-module-level-schema": "error";
|
|
433
|
-
readonly "@sarj/prefer-non-nullable-collection": "
|
|
429
|
+
readonly "@sarj/prefer-non-nullable-collection": "error";
|
|
434
430
|
readonly "@sarj/prefer-schema-for-api-payload": "error";
|
|
435
431
|
readonly "@sarj/prefer-semantic-colors": readonly ["error", {
|
|
436
432
|
readonly requireSemanticTokens: true;
|
|
437
433
|
}];
|
|
438
434
|
readonly "@sarj/prefer-server-actions": "error";
|
|
439
|
-
readonly "@sarj/prefer-single-sentence-comment": "warn";
|
|
440
435
|
readonly "@sarj/prefer-string-literal-union": "error";
|
|
441
436
|
readonly "@sarj/prefer-whole-object-assertion": "error";
|
|
442
437
|
readonly "@sarj/prefer-zod-enum": "error";
|
|
443
438
|
readonly "@sarj/prefer-zod-infer": "error";
|
|
444
|
-
readonly "@sarj/require-assert-never": "
|
|
439
|
+
readonly "@sarj/require-assert-never": "error";
|
|
445
440
|
readonly "@sarj/require-fetch-timeout": "error";
|
|
446
|
-
readonly "@sarj/require-interface-for-injected-service": "
|
|
441
|
+
readonly "@sarj/require-interface-for-injected-service": "error";
|
|
447
442
|
readonly "@sarj/require-static-next-matcher": "error";
|
|
448
443
|
readonly "@sarj/require-zod-form-validation": "error";
|
|
449
444
|
readonly "@sarj/store-insert-requires-on-conflict": "error";
|
|
450
|
-
readonly "@sarj/stepdown": "
|
|
445
|
+
readonly "@sarj/stepdown": "error";
|
|
451
446
|
readonly "@sarj/zod-naming-convention": "error";
|
|
452
447
|
};
|
|
453
448
|
type FlatPreset = {
|
|
@@ -458,7 +453,7 @@ type FlatPreset = {
|
|
|
458
453
|
declare const plugin: {
|
|
459
454
|
readonly meta: {
|
|
460
455
|
readonly name: "@sarj/eslint-plugin";
|
|
461
|
-
readonly version: "
|
|
456
|
+
readonly version: "11.0.0";
|
|
462
457
|
};
|
|
463
458
|
readonly rules: {
|
|
464
459
|
readonly "duplicate-test-body": _typescript_eslint_utils_ts_eslint.RuleModule<"duplicateTestBody", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
@@ -640,9 +635,6 @@ declare const plugin: {
|
|
|
640
635
|
readonly "prefer-server-actions": _typescript_eslint_utils_ts_eslint.RuleModule<"preferServerAction", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
641
636
|
name: string;
|
|
642
637
|
};
|
|
643
|
-
readonly "prefer-single-sentence-comment": _typescript_eslint_utils_ts_eslint.RuleModule<"preferOneSentence", readonly [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
|
644
|
-
name: string;
|
|
645
|
-
};
|
|
646
638
|
readonly "prefer-string-literal-union": _typescript_eslint_utils_ts_eslint.RuleModule<"bareChoiceField" | "comparisonCluster", readonly [{
|
|
647
639
|
ignoreFields?: readonly string[];
|
|
648
640
|
}?], unknown, _typescript_eslint_utils_ts_eslint.RuleListener> & {
|
package/dist/index.js
CHANGED
|
@@ -886,6 +886,8 @@ var CODE_TAIL_RE = /[;{}()]\s*$|=>\s*$|,\s*$/;
|
|
|
886
886
|
var ASSIGN_RE = /^[A-Za-z_$][\w.$[\]]*\s*(?:=(?![=>])|\+=|-=|\*=)\s*\S.*[;)}\]]\s*$/;
|
|
887
887
|
var CALL_RE = /^[A-Za-z_$][\w.$]*\([^)]*\)\s*;?\s*$/;
|
|
888
888
|
var ASSERTION_CODE_RE = /^(?:await\s+)?(?:expect(?:TypeOf)?|assert(?:\.\w+)?)\s*\(/;
|
|
889
|
+
var HTTP_CONTRACT_RE = /\b(?:GET|HEAD|OPTIONS|PATCH|POST|PUT|DELETE)\s+(?:https?:\/\/|\/|\{[A-Za-z_$])/;
|
|
890
|
+
var PROSE_ASSIGNMENT_RE = /^[A-Za-z_$][\w.$[\]]*\s*=\s*[A-Za-z][A-Za-z '-]{2,}\s+\((?:how|what|when|where|which|who|why)\b[^)]*\)[.!]?$/i;
|
|
889
891
|
var PSEUDOCODE_RE = /%\w+%|\[opt\]|(?:^|\s)<[A-Za-z]\w*>|…|\.\.\./;
|
|
890
892
|
function isBanner(text) {
|
|
891
893
|
const t = text.trim();
|
|
@@ -904,6 +906,7 @@ function isRegionMarker(text) {
|
|
|
904
906
|
function looksLikeCode(text, allowCall = true) {
|
|
905
907
|
const t = text.trim();
|
|
906
908
|
if (!t) return false;
|
|
909
|
+
if (PROSE_ASSIGNMENT_RE.test(t)) return false;
|
|
907
910
|
if (CODE_KEYWORD_RE.test(t) && CODE_TAIL_RE.test(t)) return true;
|
|
908
911
|
if (ASSIGN_RE.test(t)) return true;
|
|
909
912
|
if (ASSERTION_CODE_RE.test(t)) return true;
|
|
@@ -1042,6 +1045,21 @@ function runCitesAReference(comments, index) {
|
|
|
1042
1045
|
function areAdjacentLineComments(a, b) {
|
|
1043
1046
|
return a !== void 0 && b !== void 0 && a.type === "Line" && b.type === "Line" && b.loc.start.line === a.loc.end.line + 1;
|
|
1044
1047
|
}
|
|
1048
|
+
function lineRunStart(comments, index) {
|
|
1049
|
+
let start = index;
|
|
1050
|
+
while (start > 0 && areAdjacentLineComments(comments[start - 1], comments[start])) {
|
|
1051
|
+
start -= 1;
|
|
1052
|
+
}
|
|
1053
|
+
return start;
|
|
1054
|
+
}
|
|
1055
|
+
function runDocumentsHttpContract(comments, index) {
|
|
1056
|
+
const start = lineRunStart(comments, index);
|
|
1057
|
+
for (let i = start; i < comments.length; i++) {
|
|
1058
|
+
if (i > start && !areAdjacentLineComments(comments[i - 1], comments[i])) break;
|
|
1059
|
+
if (HTTP_CONTRACT_RE.test(stripCommentMarker(comments[i]?.value ?? ""))) return true;
|
|
1060
|
+
}
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
1045
1063
|
function isInsideCommentRun(comments, index) {
|
|
1046
1064
|
const comment = comments[index];
|
|
1047
1065
|
return areAdjacentLineComments(comments[index - 1], comment) || areAdjacentLineComments(comment, comments[index + 1]);
|
|
@@ -1077,7 +1095,7 @@ var no_comment_cruft_default = createRule({
|
|
|
1077
1095
|
schema: [],
|
|
1078
1096
|
messages: {
|
|
1079
1097
|
commentedOutCode: "Commented-out code \u2014 delete it; git history remembers.",
|
|
1080
|
-
sectionBanner: "Section-banner / region comment \u2014
|
|
1098
|
+
sectionBanner: "Section-banner / region comment \u2014 remove the decoration or replace it with a named code boundary.",
|
|
1081
1099
|
fileHeaderPreamble: "File-header comment preamble \u2014 use a brief doc comment for the why, not a block of `//` lines.",
|
|
1082
1100
|
commentWall: "Statement comment wall ({{count}} narrated steps) \u2014 delete the walkthrough and name the operations in code; keep only constraints or rationale.",
|
|
1083
1101
|
redundantNarration: "Comment narrates the code \u2014 delete it or say *why*, not *what*. Code is self-documenting.",
|
|
@@ -1100,6 +1118,17 @@ var no_comment_cruft_default = createRule({
|
|
|
1100
1118
|
function isJsDoc(comment) {
|
|
1101
1119
|
return comment.type === "Block" && /^\*/.test(comment.value);
|
|
1102
1120
|
}
|
|
1121
|
+
function isJsxOnlyComment(comment) {
|
|
1122
|
+
for (let node = sourceCode.getNodeByRangeIndex(
|
|
1123
|
+
comment.range[0]
|
|
1124
|
+
); node != null; node = node.parent) {
|
|
1125
|
+
if (node.type === AST_NODE_TYPES6.JSXExpressionContainer) {
|
|
1126
|
+
return node.expression.type === AST_NODE_TYPES6.JSXEmptyExpression;
|
|
1127
|
+
}
|
|
1128
|
+
if (node.type === AST_NODE_TYPES6.Program) return false;
|
|
1129
|
+
}
|
|
1130
|
+
return false;
|
|
1131
|
+
}
|
|
1103
1132
|
function findCommentWalls(comments) {
|
|
1104
1133
|
const attached = /* @__PURE__ */ new Map();
|
|
1105
1134
|
for (const comment of comments) {
|
|
@@ -1181,6 +1210,8 @@ var no_comment_cruft_default = createRule({
|
|
|
1181
1210
|
const enumerated = comments.filter(
|
|
1182
1211
|
(c) => c.type === "Line" && ENUMERATION_RE.test(stripCommentMarker(c.value))
|
|
1183
1212
|
);
|
|
1213
|
+
const reportedBannerRuns = /* @__PURE__ */ new Set();
|
|
1214
|
+
const reportedCodeRuns = /* @__PURE__ */ new Set();
|
|
1184
1215
|
for (let i = 0; i < comments.length; i++) {
|
|
1185
1216
|
const comment = comments[i];
|
|
1186
1217
|
if (comment === void 0) continue;
|
|
@@ -1200,9 +1231,14 @@ var no_comment_cruft_default = createRule({
|
|
|
1200
1231
|
}
|
|
1201
1232
|
continue;
|
|
1202
1233
|
}
|
|
1203
|
-
if (!isStandalone(comment)) continue;
|
|
1204
1234
|
if (LICENSE_RE.test(comment.value)) continue;
|
|
1205
1235
|
const texts = comment.value.split("\n").map(stripCommentMarker).filter((l) => l.length > 0 && !isDirective(l));
|
|
1236
|
+
if (!isStandalone(comment)) {
|
|
1237
|
+
if (isJsxOnlyComment(comment) && texts.some(isBanner)) {
|
|
1238
|
+
context.report({ node: comment, messageId: "sectionBanner" });
|
|
1239
|
+
}
|
|
1240
|
+
continue;
|
|
1241
|
+
}
|
|
1206
1242
|
const firstText = texts[0];
|
|
1207
1243
|
if (firstText !== void 0 && /^(?:todo|fixme)\b/i.test(firstText)) {
|
|
1208
1244
|
if (!runCitesAReference(comments, i)) {
|
|
@@ -1217,16 +1253,23 @@ var no_comment_cruft_default = createRule({
|
|
|
1217
1253
|
context.report({ node: comment, messageId: "placeholderImplementation" });
|
|
1218
1254
|
continue;
|
|
1219
1255
|
}
|
|
1256
|
+
const runStart = lineRunStart(comments, i);
|
|
1220
1257
|
if (texts.some(isBanner)) {
|
|
1221
|
-
|
|
1258
|
+
if (!reportedBannerRuns.has(runStart)) {
|
|
1259
|
+
context.report({ node: comment, messageId: "sectionBanner" });
|
|
1260
|
+
reportedBannerRuns.add(runStart);
|
|
1261
|
+
}
|
|
1222
1262
|
continue;
|
|
1223
1263
|
}
|
|
1224
1264
|
const prev = comments[i - 1];
|
|
1225
1265
|
const precedingProse = prev !== void 0 && prev.type === "Line" && prev.loc.end.line === comment.loc.start.line - 1 && isProse(stripCommentMarker(prev.value));
|
|
1226
1266
|
const container = sourceCode.getNodeByRangeIndex(comment.range[0]);
|
|
1227
1267
|
const inTypeMembers = container !== null && TYPE_MEMBER_CONTAINERS.has(container.type);
|
|
1228
|
-
if (hasCommentedOutCode(texts, precedingProse, !inTypeMembers) && !hasIllustrationLeadInAbove(comments, i)) {
|
|
1229
|
-
|
|
1268
|
+
if (hasCommentedOutCode(texts, precedingProse, !inTypeMembers) && !hasIllustrationLeadInAbove(comments, i) && !runDocumentsHttpContract(comments, i)) {
|
|
1269
|
+
if (!reportedCodeRuns.has(runStart)) {
|
|
1270
|
+
context.report({ node: comment, messageId: "commentedOutCode" });
|
|
1271
|
+
reportedCodeRuns.add(runStart);
|
|
1272
|
+
}
|
|
1230
1273
|
continue;
|
|
1231
1274
|
}
|
|
1232
1275
|
if (comment.type === "Line" && texts.length === 1) {
|
|
@@ -9720,31 +9763,6 @@ var prefer_server_actions_default = createRule({
|
|
|
9720
9763
|
}
|
|
9721
9764
|
});
|
|
9722
9765
|
|
|
9723
|
-
// src/rules/prefer-single-sentence-comment.ts
|
|
9724
|
-
var prefer_single_sentence_comment_default = createRule({
|
|
9725
|
-
name: "prefer-single-sentence-comment",
|
|
9726
|
-
meta: {
|
|
9727
|
-
type: "suggestion",
|
|
9728
|
-
docs: { description: "Prefer one sentence and self-documenting code over a two-sentence comment." },
|
|
9729
|
-
schema: [],
|
|
9730
|
-
messages: {
|
|
9731
|
-
preferOneSentence: "Two-sentence comment \u2014 prefer one sentence and self-documenting code."
|
|
9732
|
-
}
|
|
9733
|
-
},
|
|
9734
|
-
defaultOptions: [],
|
|
9735
|
-
create(context) {
|
|
9736
|
-
return {
|
|
9737
|
-
Program() {
|
|
9738
|
-
for (const group of proseGroups(context.filename, context.sourceCode)) {
|
|
9739
|
-
if (!group.hasTypedTags && sentenceUnits(group.text) === 2) {
|
|
9740
|
-
context.report({ node: group.comment, messageId: "preferOneSentence" });
|
|
9741
|
-
}
|
|
9742
|
-
}
|
|
9743
|
-
}
|
|
9744
|
-
};
|
|
9745
|
-
}
|
|
9746
|
-
});
|
|
9747
|
-
|
|
9748
9766
|
// src/rules/prefer-string-literal-union.ts
|
|
9749
9767
|
import {
|
|
9750
9768
|
ESLintUtils as ESLintUtils3,
|
|
@@ -12235,6 +12253,10 @@ var retiredRules = {
|
|
|
12235
12253
|
removedIn: "3.0.0",
|
|
12236
12254
|
reason: "Delete the retired entry; application-profile consumers can separately adopt `@sarj/prefer-shadcn-primitives`."
|
|
12237
12255
|
},
|
|
12256
|
+
"prefer-single-sentence-comment": {
|
|
12257
|
+
removedIn: "10.0.0",
|
|
12258
|
+
reason: "Delete the config entry and suppressions; use the narrower no-comment-cruft, no-restated-comment, and no-long-comment rules."
|
|
12259
|
+
},
|
|
12238
12260
|
"primary-export-file-name": {
|
|
12239
12261
|
removedIn: "4.0.0",
|
|
12240
12262
|
reason: "Delete the config entry and suppressions; there is no replacement."
|
|
@@ -12309,7 +12331,6 @@ var rules = {
|
|
|
12309
12331
|
"prefer-schema-for-api-payload": prefer_schema_for_api_payload_default,
|
|
12310
12332
|
"prefer-semantic-colors": prefer_semantic_colors_default,
|
|
12311
12333
|
"prefer-server-actions": prefer_server_actions_default,
|
|
12312
|
-
"prefer-single-sentence-comment": prefer_single_sentence_comment_default,
|
|
12313
12334
|
"prefer-string-literal-union": prefer_string_literal_union_default,
|
|
12314
12335
|
"prefer-whole-object-assertion": prefer_whole_object_assertion_default,
|
|
12315
12336
|
"prefer-zod-enum": prefer_zod_enum_default,
|
|
@@ -12325,7 +12346,7 @@ var rules = {
|
|
|
12325
12346
|
};
|
|
12326
12347
|
var meta = {
|
|
12327
12348
|
name: "@sarj/eslint-plugin",
|
|
12328
|
-
version: "
|
|
12349
|
+
version: "11.0.0"
|
|
12329
12350
|
};
|
|
12330
12351
|
var applicationOnlyRules = [
|
|
12331
12352
|
"no-restricted-library-load",
|
|
@@ -12333,69 +12354,68 @@ var applicationOnlyRules = [
|
|
|
12333
12354
|
"prefer-shadcn-primitives"
|
|
12334
12355
|
];
|
|
12335
12356
|
var recommendedRules = {
|
|
12336
|
-
"@sarj/duplicate-test-body": "
|
|
12337
|
-
"@sarj/enforce-file-structure": "
|
|
12338
|
-
"@sarj/no-async-callback-in-wait-for": "
|
|
12339
|
-
"@sarj/no-client-side-data-fetching": "
|
|
12340
|
-
"@sarj/no-comment-cruft": "
|
|
12341
|
-
"@sarj/no-conditional-in-test": "
|
|
12342
|
-
"@sarj/no-cors-wildcard-with-credentials": "
|
|
12343
|
-
"@sarj/no-dynamic-sql": "
|
|
12344
|
-
"@sarj/no-fat-try-blocks": "
|
|
12345
|
-
"@sarj/no-hand-rolled-sleep": "
|
|
12357
|
+
"@sarj/duplicate-test-body": "error",
|
|
12358
|
+
"@sarj/enforce-file-structure": "error",
|
|
12359
|
+
"@sarj/no-async-callback-in-wait-for": "error",
|
|
12360
|
+
"@sarj/no-client-side-data-fetching": "error",
|
|
12361
|
+
"@sarj/no-comment-cruft": "error",
|
|
12362
|
+
"@sarj/no-conditional-in-test": "error",
|
|
12363
|
+
"@sarj/no-cors-wildcard-with-credentials": "error",
|
|
12364
|
+
"@sarj/no-dynamic-sql": "error",
|
|
12365
|
+
"@sarj/no-fat-try-blocks": "error",
|
|
12366
|
+
"@sarj/no-hand-rolled-sleep": "error",
|
|
12346
12367
|
"@sarj/no-hand-rolled-spinner": "error",
|
|
12347
|
-
"@sarj/no-insecure-random-id": "
|
|
12348
|
-
"@sarj/no-json-stringify-error": "
|
|
12349
|
-
"@sarj/no-log-only-catch": "
|
|
12350
|
-
"@sarj/no-long-comment": "
|
|
12351
|
-
"@sarj/no-generic-single-export-module": "
|
|
12352
|
-
"@sarj/no-offset-pagination": "
|
|
12353
|
-
"@sarj/no-positional-tuple-return": "
|
|
12354
|
-
"@sarj/no-repeated-string-literal": "
|
|
12355
|
-
"@sarj/no-restated-comment": "
|
|
12356
|
-
"@sarj/no-restated-jsdoc": "
|
|
12357
|
-
"@sarj/no-secret-in-log": "
|
|
12358
|
-
"@sarj/no-select-star": "
|
|
12359
|
-
"@sarj/no-sentinel-return-on-catch": "
|
|
12360
|
-
"@sarj/no-silent-promise-catch": "
|
|
12361
|
-
"@sarj/no-sleep-in-test-body": "
|
|
12362
|
-
"@sarj/no-string-concat-in-loop": "
|
|
12363
|
-
"@sarj/no-tautological-expect": "
|
|
12364
|
-
"@sarj/no-typed-doc-sections": "
|
|
12365
|
-
"@sarj/no-trailing-value-narration": "
|
|
12366
|
-
"@sarj/no-declaration-comment-wall": "
|
|
12367
|
-
"@sarj/no-union-in-comment": "
|
|
12368
|
-
"@sarj/no-type-member-comment-wall": "
|
|
12369
|
-
"@sarj/no-unnecessary-use-client": "
|
|
12370
|
-
"@sarj/no-unsafe-mock-casting": "
|
|
12371
|
-
"@sarj/no-zod-native-enum": "
|
|
12372
|
-
"@sarj/test-loops-over-literal-cases": "
|
|
12368
|
+
"@sarj/no-insecure-random-id": "error",
|
|
12369
|
+
"@sarj/no-json-stringify-error": "error",
|
|
12370
|
+
"@sarj/no-log-only-catch": "error",
|
|
12371
|
+
"@sarj/no-long-comment": "error",
|
|
12372
|
+
"@sarj/no-generic-single-export-module": "error",
|
|
12373
|
+
"@sarj/no-offset-pagination": "error",
|
|
12374
|
+
"@sarj/no-positional-tuple-return": "error",
|
|
12375
|
+
"@sarj/no-repeated-string-literal": "error",
|
|
12376
|
+
"@sarj/no-restated-comment": "error",
|
|
12377
|
+
"@sarj/no-restated-jsdoc": "error",
|
|
12378
|
+
"@sarj/no-secret-in-log": "error",
|
|
12379
|
+
"@sarj/no-select-star": "error",
|
|
12380
|
+
"@sarj/no-sentinel-return-on-catch": "error",
|
|
12381
|
+
"@sarj/no-silent-promise-catch": "error",
|
|
12382
|
+
"@sarj/no-sleep-in-test-body": "error",
|
|
12383
|
+
"@sarj/no-string-concat-in-loop": "error",
|
|
12384
|
+
"@sarj/no-tautological-expect": "error",
|
|
12385
|
+
"@sarj/no-typed-doc-sections": "error",
|
|
12386
|
+
"@sarj/no-trailing-value-narration": "error",
|
|
12387
|
+
"@sarj/no-declaration-comment-wall": "error",
|
|
12388
|
+
"@sarj/no-union-in-comment": "error",
|
|
12389
|
+
"@sarj/no-type-member-comment-wall": "error",
|
|
12390
|
+
"@sarj/no-unnecessary-use-client": "error",
|
|
12391
|
+
"@sarj/no-unsafe-mock-casting": "error",
|
|
12392
|
+
"@sarj/no-zod-native-enum": "error",
|
|
12393
|
+
"@sarj/test-loops-over-literal-cases": "error",
|
|
12373
12394
|
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
12374
|
-
"@sarj/prefer-discriminated-union": "
|
|
12395
|
+
"@sarj/prefer-discriminated-union": "error",
|
|
12375
12396
|
"@sarj/prefer-input-group-search": "error",
|
|
12376
|
-
"@sarj/prefer-immutable-module-constant": "
|
|
12377
|
-
"@sarj/prefer-module-level-constant": "
|
|
12378
|
-
"@sarj/prefer-module-level-schema": "
|
|
12379
|
-
"@sarj/prefer-non-nullable-collection": "
|
|
12380
|
-
"@sarj/prefer-schema-for-api-payload": "
|
|
12381
|
-
"@sarj/prefer-semantic-colors": ["
|
|
12382
|
-
"@sarj/prefer-server-actions": "
|
|
12383
|
-
"@sarj/prefer-
|
|
12384
|
-
"@sarj/prefer-
|
|
12385
|
-
"@sarj/prefer-
|
|
12386
|
-
"@sarj/prefer-zod-
|
|
12387
|
-
"@sarj/
|
|
12388
|
-
"@sarj/require-
|
|
12389
|
-
"@sarj/require-
|
|
12390
|
-
"@sarj/require-interface-for-injected-service": "warn",
|
|
12397
|
+
"@sarj/prefer-immutable-module-constant": "error",
|
|
12398
|
+
"@sarj/prefer-module-level-constant": "error",
|
|
12399
|
+
"@sarj/prefer-module-level-schema": "error",
|
|
12400
|
+
"@sarj/prefer-non-nullable-collection": "error",
|
|
12401
|
+
"@sarj/prefer-schema-for-api-payload": "error",
|
|
12402
|
+
"@sarj/prefer-semantic-colors": ["error", { requireSemanticTokens: true }],
|
|
12403
|
+
"@sarj/prefer-server-actions": "error",
|
|
12404
|
+
"@sarj/prefer-string-literal-union": "error",
|
|
12405
|
+
"@sarj/prefer-whole-object-assertion": "error",
|
|
12406
|
+
"@sarj/prefer-zod-enum": "error",
|
|
12407
|
+
"@sarj/prefer-zod-infer": "error",
|
|
12408
|
+
"@sarj/require-assert-never": "error",
|
|
12409
|
+
"@sarj/require-fetch-timeout": "error",
|
|
12410
|
+
"@sarj/require-interface-for-injected-service": "error",
|
|
12391
12411
|
"@sarj/require-static-next-matcher": "error",
|
|
12392
12412
|
"@sarj/require-zod-form-validation": "error",
|
|
12393
|
-
"@sarj/store-insert-requires-on-conflict": "
|
|
12394
|
-
"@sarj/stepdown": "
|
|
12395
|
-
"@sarj/zod-naming-convention": "
|
|
12413
|
+
"@sarj/store-insert-requires-on-conflict": "error",
|
|
12414
|
+
"@sarj/stepdown": "error",
|
|
12415
|
+
"@sarj/zod-naming-convention": "error"
|
|
12396
12416
|
};
|
|
12397
12417
|
var strictRules = {
|
|
12398
|
-
"@sarj/duplicate-test-body": "
|
|
12418
|
+
"@sarj/duplicate-test-body": "error",
|
|
12399
12419
|
"@sarj/enforce-file-structure": "error",
|
|
12400
12420
|
"@sarj/no-async-callback-in-wait-for": "error",
|
|
12401
12421
|
"@sarj/no-client-side-data-fetching": "error",
|
|
@@ -12411,7 +12431,7 @@ var strictRules = {
|
|
|
12411
12431
|
"@sarj/no-json-stringify-error": "error",
|
|
12412
12432
|
"@sarj/no-log-only-catch": "error",
|
|
12413
12433
|
"@sarj/no-long-comment": "error",
|
|
12414
|
-
"@sarj/no-generic-single-export-module": "
|
|
12434
|
+
"@sarj/no-generic-single-export-module": "error",
|
|
12415
12435
|
"@sarj/no-offset-pagination": "error",
|
|
12416
12436
|
"@sarj/no-positional-tuple-return": "error",
|
|
12417
12437
|
"@sarj/no-raw-env": "error",
|
|
@@ -12435,29 +12455,28 @@ var strictRules = {
|
|
|
12435
12455
|
"@sarj/no-unnecessary-use-client": "error",
|
|
12436
12456
|
"@sarj/no-unsafe-mock-casting": "error",
|
|
12437
12457
|
"@sarj/no-zod-native-enum": "error",
|
|
12438
|
-
"@sarj/test-loops-over-literal-cases": "
|
|
12458
|
+
"@sarj/test-loops-over-literal-cases": "error",
|
|
12439
12459
|
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
12440
|
-
"@sarj/prefer-discriminated-union": "
|
|
12460
|
+
"@sarj/prefer-discriminated-union": "error",
|
|
12441
12461
|
"@sarj/prefer-input-group-search": "error",
|
|
12442
|
-
"@sarj/prefer-immutable-module-constant": "
|
|
12462
|
+
"@sarj/prefer-immutable-module-constant": "error",
|
|
12443
12463
|
"@sarj/prefer-module-level-constant": "error",
|
|
12444
12464
|
"@sarj/prefer-module-level-schema": "error",
|
|
12445
|
-
"@sarj/prefer-non-nullable-collection": "
|
|
12465
|
+
"@sarj/prefer-non-nullable-collection": "error",
|
|
12446
12466
|
"@sarj/prefer-schema-for-api-payload": "error",
|
|
12447
12467
|
"@sarj/prefer-semantic-colors": ["error", { requireSemanticTokens: true }],
|
|
12448
12468
|
"@sarj/prefer-server-actions": "error",
|
|
12449
|
-
"@sarj/prefer-single-sentence-comment": "warn",
|
|
12450
12469
|
"@sarj/prefer-string-literal-union": "error",
|
|
12451
12470
|
"@sarj/prefer-whole-object-assertion": "error",
|
|
12452
12471
|
"@sarj/prefer-zod-enum": "error",
|
|
12453
12472
|
"@sarj/prefer-zod-infer": "error",
|
|
12454
|
-
"@sarj/require-assert-never": "
|
|
12473
|
+
"@sarj/require-assert-never": "error",
|
|
12455
12474
|
"@sarj/require-fetch-timeout": "error",
|
|
12456
|
-
"@sarj/require-interface-for-injected-service": "
|
|
12475
|
+
"@sarj/require-interface-for-injected-service": "error",
|
|
12457
12476
|
"@sarj/require-static-next-matcher": "error",
|
|
12458
12477
|
"@sarj/require-zod-form-validation": "error",
|
|
12459
12478
|
"@sarj/store-insert-requires-on-conflict": "error",
|
|
12460
|
-
"@sarj/stepdown": "
|
|
12479
|
+
"@sarj/stepdown": "error",
|
|
12461
12480
|
"@sarj/zod-naming-convention": "error"
|
|
12462
12481
|
};
|
|
12463
12482
|
var plugin = {
|