@sister.software/oxlint-config 10.0.0 → 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.
Files changed (77) hide show
  1. package/README.md +96 -0
  2. package/out/browser-globals.d.ts +15 -0
  3. package/out/browser-globals.d.ts.map +1 -0
  4. package/out/browser-globals.js +76 -0
  5. package/out/browser-globals.js.map +1 -0
  6. package/out/console-padding-plugin.d.ts +16 -0
  7. package/out/console-padding-plugin.d.ts.map +1 -0
  8. package/out/console-padding-plugin.js +68 -0
  9. package/out/console-padding-plugin.js.map +1 -0
  10. package/out/constant-doc-plugin.d.ts +9 -3
  11. package/out/constant-doc-plugin.d.ts.map +1 -1
  12. package/out/constant-doc-plugin.js +6 -2
  13. package/out/constant-doc-plugin.js.map +1 -1
  14. package/out/headers-plugin.d.ts +6 -2
  15. package/out/headers-plugin.d.ts.map +1 -1
  16. package/out/headers-plugin.js +3 -1
  17. package/out/headers-plugin.js.map +1 -1
  18. package/out/index.d.ts +111 -27
  19. package/out/index.d.ts.map +1 -1
  20. package/out/index.js +57 -5
  21. package/out/index.js.map +1 -1
  22. package/out/jsdoc-plugin.d.ts +16 -0
  23. package/out/jsdoc-plugin.d.ts.map +1 -0
  24. package/out/jsdoc-plugin.js +68 -0
  25. package/out/jsdoc-plugin.js.map +1 -0
  26. package/out/length-truthiness-plugin.d.ts.map +1 -1
  27. package/out/length-truthiness-plugin.js +15 -5
  28. package/out/length-truthiness-plugin.js.map +1 -1
  29. package/out/multiline-statement-plugin.d.ts +18 -0
  30. package/out/multiline-statement-plugin.d.ts.map +1 -0
  31. package/out/multiline-statement-plugin.js +93 -0
  32. package/out/multiline-statement-plugin.js.map +1 -0
  33. package/out/padding-plugin.d.ts +4 -3
  34. package/out/padding-plugin.d.ts.map +1 -1
  35. package/out/padding-plugin.js +44 -27
  36. package/out/padding-plugin.js.map +1 -1
  37. package/out/padding-utils.d.ts +34 -0
  38. package/out/padding-utils.d.ts.map +1 -0
  39. package/out/padding-utils.js +50 -0
  40. package/out/padding-utils.js.map +1 -0
  41. package/out/plugin-types.d.ts +55 -13
  42. package/out/plugin-types.d.ts.map +1 -1
  43. package/out/plugin.d.ts.map +1 -1
  44. package/out/plugin.js +11 -0
  45. package/out/plugin.js.map +1 -1
  46. package/out/process-globals-plugin.d.ts.map +1 -1
  47. package/out/process-globals-plugin.js +6 -2
  48. package/out/process-globals-plugin.js.map +1 -1
  49. package/out/restrictions.d.ts +9 -3
  50. package/out/restrictions.d.ts.map +1 -1
  51. package/out/restrictions.js +4 -70
  52. package/out/restrictions.js.map +1 -1
  53. package/out/section-marker-plugin.d.ts +25 -0
  54. package/out/section-marker-plugin.d.ts.map +1 -0
  55. package/out/section-marker-plugin.js +234 -0
  56. package/out/section-marker-plugin.js.map +1 -0
  57. package/out/threshold-plugin.d.ts +9 -3
  58. package/out/threshold-plugin.d.ts.map +1 -1
  59. package/out/threshold-plugin.js +9 -3
  60. package/out/threshold-plugin.js.map +1 -1
  61. package/package.json +1 -1
  62. package/src/browser-globals.ts +77 -0
  63. package/src/console-padding-plugin.ts +76 -0
  64. package/src/constant-doc-plugin.ts +15 -5
  65. package/src/headers-plugin.ts +6 -2
  66. package/src/index.ts +166 -29
  67. package/src/jsdoc-plugin.ts +75 -0
  68. package/src/length-truthiness-plugin.ts +15 -5
  69. package/src/multiline-statement-plugin.ts +104 -0
  70. package/src/padding-plugin.ts +44 -29
  71. package/src/padding-utils.ts +70 -0
  72. package/src/plugin-types.ts +55 -13
  73. package/src/plugin.ts +16 -0
  74. package/src/process-globals-plugin.ts +6 -2
  75. package/src/restrictions.ts +16 -77
  76. package/src/section-marker-plugin.ts +306 -0
  77. package/src/threshold-plugin.ts +18 -6
@@ -0,0 +1,234 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file Four rules over the comments people use to carve a file into sections. They form one
6
+ * escalation ladder, and each rung is a smaller file than the last:
7
+ *
8
+ * 1. `prefer-mark-comment` — a `----` banner becomes `// MARK: <label>` (autofixed). A banner is
9
+ * three lines of decoration to carry one label.
10
+ * 2. `concise-section-marker` — a marker's label is a label, not a paragraph. Past the limit, the
11
+ * detail belongs in the documented symbol's JSDoc or in the file's own `@file` block.
12
+ * 3. `prefer-region-over-marks` — past one marker, a file has sections, and sections have ENDS.
13
+ * Regions fold, so a reader can collapse what they are not reading.
14
+ * 4. `max-regions` — past ten regions, the sections want to be files.
15
+ *
16
+ * Rules 3 and 4 are advisory: where a section ends, and whether it should move, are judgment calls
17
+ * no fixer can make. Rules 1 and 2 are not — the first has one correct rewrite, the second has a
18
+ * measurable limit.
19
+ */
20
+ /**
21
+ * A run of at least this many dashes reads as decoration rather than as prose.
22
+ */
23
+ const MIN_BANNER_DASHES = 10;
24
+ /**
25
+ * Default ceiling for a marker's label, in characters.
26
+ */
27
+ const DEFAULT_MAX_BODY_LENGTH = 60;
28
+ /**
29
+ * Default region ceiling. The rule fires past it, so the eleventh region is the one that trips it.
30
+ *
31
+ * Deliberately high. A file with four well-named regions is usually fine — data plus the operations on it, where
32
+ * splitting would separate a type from its helpers. This is a runaway detector, not a style nudge: past ten sections a
33
+ * file is doing too many jobs by any reading.
34
+ */
35
+ const DEFAULT_MAX_REGIONS = 10;
36
+ /**
37
+ * A line that is nothing but a comment marker and a rule of dashes.
38
+ */
39
+ const BANNER_SEPARATOR = new RegExp(String.raw `^[ \t]*//[ \t]*-{${MIN_BANNER_DASHES},}[ \t]*$`);
40
+ /**
41
+ * `// MARK: label`, with the leading dash Xcode allows (`// MARK: - label`) folded away.
42
+ */
43
+ const MARK_COMMENT = /^[ \t]*\/\/[ \t]*MARK:[ \t]*-?[ \t]*(.*)$/;
44
+ /**
45
+ * `//#region label` — the space after `//` is optional, which is how most editors emit it.
46
+ */
47
+ const REGION_COMMENT = /^[ \t]*\/\/[ \t]*#region\b[ \t]*(.*)$/;
48
+ /**
49
+ * Strip a line comment's `//` and the space that conventionally follows it.
50
+ */
51
+ function commentBody(line) {
52
+ return line
53
+ .trim()
54
+ .replace(/^\/\/[ \t]?/, "")
55
+ .trim();
56
+ }
57
+ /**
58
+ * Scan for banner blocks: a separator line, one or more comment lines, then another separator. Blocks are matched on
59
+ * raw lines rather than on the comment list because a banner is a visual construct — what makes it one is that the
60
+ * lines are adjacent, which the AST does not model.
61
+ */
62
+ function findBanners(lines) {
63
+ const banners = [];
64
+ let i = 0;
65
+ while (i < lines.length) {
66
+ if (!BANNER_SEPARATOR.test(lines[i])) {
67
+ i++;
68
+ continue;
69
+ }
70
+ let end = i + 1;
71
+ const body = [];
72
+ while (end < lines.length && lines[end].trim().startsWith("//") && !BANNER_SEPARATOR.test(lines[end])) {
73
+ body.push(commentBody(lines[end]));
74
+ end++;
75
+ }
76
+ if (body.length && end < lines.length && BANNER_SEPARATOR.test(lines[end])) {
77
+ banners.push({ startLine: i, endLine: end, body, indent: /^[ \t]*/.exec(lines[i])[0] });
78
+ i = end + 1;
79
+ continue;
80
+ }
81
+ i = end;
82
+ }
83
+ return banners;
84
+ }
85
+ /**
86
+ * Byte offset of the first character of a zero-based line.
87
+ */
88
+ function offsetOfLine(lines, line) {
89
+ let offset = 0;
90
+ for (let i = 0; i < line; i++) {
91
+ offset += lines[i].length + 1;
92
+ }
93
+ return offset;
94
+ }
95
+ /**
96
+ * Every line comment in the file, paired with its label under `pattern`.
97
+ */
98
+ function markersMatching(sourceCode, text, pattern) {
99
+ const found = [];
100
+ for (const comment of sourceCode.getAllComments()) {
101
+ if (comment.type !== "Line")
102
+ continue;
103
+ const match = pattern.exec(text.slice(comment.range[0], comment.range[1]));
104
+ if (match) {
105
+ found.push({ comment, label: match[1].trim() });
106
+ }
107
+ }
108
+ return found;
109
+ }
110
+ /**
111
+ * Shared preamble: the source text and its lines, which every rule here walks.
112
+ */
113
+ function read(context) {
114
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
115
+ const text = sourceCode.getText();
116
+ return { sourceCode, text, lines: text.split("\n") };
117
+ }
118
+ export const preferMarkCommentRule = {
119
+ meta: {
120
+ name: "prefer-mark-comment",
121
+ type: "suggestion",
122
+ fixable: "code",
123
+ schema: [{ type: "object", additionalProperties: true }],
124
+ },
125
+ create(context) {
126
+ const { text, lines } = read(context);
127
+ return {
128
+ Program() {
129
+ for (const banner of findBanners(lines)) {
130
+ const start = offsetOfLine(lines, banner.startLine);
131
+ const end = offsetOfLine(lines, banner.endLine) + lines[banner.endLine].length;
132
+ const node = { type: "Line", range: [start, end] };
133
+ // A banner wrapping real prose is a comment someone wrote, not decoration around a
134
+ // label. Collapsing it would delete the prose, so say what to do and leave it alone.
135
+ if (banner.body.length > 1) {
136
+ context.report({
137
+ node,
138
+ message: "Banner comment: keep the prose in a JSDoc block on what it describes, and leave a `// MARK: <label>` here.",
139
+ });
140
+ continue;
141
+ }
142
+ const label = banner.body[0];
143
+ context.report({
144
+ node,
145
+ message: "Banner comment: use `// MARK: <label>`.",
146
+ fix(fixer) {
147
+ // The marker wants a blank line on each side. Add one only where the source is
148
+ // missing it, so a correctly-spaced banner does not gain stray lines.
149
+ const before = text.slice(0, start).endsWith("\n\n") || start === 0 ? "" : "\n";
150
+ const after = text.slice(end).startsWith("\n\n") ? "" : "\n";
151
+ return fixer.replaceTextRange([start, end], `${before}${banner.indent}// MARK: ${label}${after}`);
152
+ },
153
+ });
154
+ }
155
+ },
156
+ };
157
+ },
158
+ };
159
+ export const conciseSectionMarkerRule = {
160
+ meta: {
161
+ name: "concise-section-marker",
162
+ type: "suggestion",
163
+ schema: [{ type: "object", additionalProperties: true }],
164
+ },
165
+ create(context) {
166
+ const { sourceCode, text } = read(context);
167
+ const options = (context.options[0] ?? {});
168
+ const limit = options.maxBodyLength ?? DEFAULT_MAX_BODY_LENGTH;
169
+ return {
170
+ Program() {
171
+ const markers = [
172
+ ...markersMatching(sourceCode, text, MARK_COMMENT).map((m) => ({ ...m, kind: "MARK" })),
173
+ ...markersMatching(sourceCode, text, REGION_COMMENT).map((m) => ({ ...m, kind: "#region" })),
174
+ ];
175
+ for (const { comment, label, kind } of markers) {
176
+ if (label.length <= limit)
177
+ continue;
178
+ context.report({
179
+ node: { type: "Line", range: comment.range },
180
+ message: `${kind} label is ${label.length} characters (max ${limit}) — shorten it, move the detail into ` +
181
+ "the JSDoc of what it describes, or split the file and put it in a `@file` block.",
182
+ });
183
+ }
184
+ },
185
+ };
186
+ },
187
+ };
188
+ export const preferRegionOverMarksRule = {
189
+ meta: {
190
+ name: "prefer-region-over-marks",
191
+ type: "suggestion",
192
+ schema: [{ type: "object", additionalProperties: true }],
193
+ },
194
+ create(context) {
195
+ const { sourceCode, text } = read(context);
196
+ return {
197
+ Program() {
198
+ const marks = markersMatching(sourceCode, text, MARK_COMMENT);
199
+ if (marks.length < 2)
200
+ return;
201
+ context.report({
202
+ node: { type: "Line", range: marks[0].comment.range },
203
+ message: `${marks.length} MARK comments in one file — give each section an END with ` +
204
+ "`//#region <label>` / `//#endregion`, so a reader can fold what they are not reading.",
205
+ });
206
+ },
207
+ };
208
+ },
209
+ };
210
+ export const maxRegionsRule = {
211
+ meta: {
212
+ name: "max-regions",
213
+ type: "suggestion",
214
+ schema: [{ type: "object", additionalProperties: true }],
215
+ },
216
+ create(context) {
217
+ const { sourceCode, text } = read(context);
218
+ const options = (context.options[0] ?? {});
219
+ const limit = options.max ?? DEFAULT_MAX_REGIONS;
220
+ return {
221
+ Program() {
222
+ const regions = markersMatching(sourceCode, text, REGION_COMMENT);
223
+ if (regions.length <= limit)
224
+ return;
225
+ context.report({
226
+ node: { type: "Line", range: regions[0].comment.range },
227
+ message: `${regions.length} regions in one file (max ${limit}) — a file with this many sections is ` +
228
+ "several files. Split it, and let each one's `@file` block say what it is.",
229
+ });
230
+ },
231
+ };
232
+ },
233
+ };
234
+ //# sourceMappingURL=section-marker-plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-marker-plugin.js","sourceRoot":"","sources":["../src/section-marker-plugin.ts"],"names":[],"mappings":"AAAA;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AAE,OAAO,CAAC,CAAC,CAAE,CAAC,OAAO,CAAC,KAAK,EAAE;oBACxD,OAAO,EACN,GAAG,OAAO,CAAC,MAAM,6BAA6B,KAAK,wCAAwC;wBAC3F,2EAA2E;iBAC5E,CAAC,CAAA;YACH,CAAC;SACD,CAAA;IACF,CAAC;CACD,CAAA"}
@@ -9,11 +9,17 @@
9
9
  * `no-magic-numbers`, which cannot express it.
10
10
  */
11
11
  import type { Rule } from "./plugin-types.js";
12
- /** Options accepted by {@link noUnnamedThresholdRule}. */
12
+ /**
13
+ * Options accepted by {@link noUnnamedThresholdRule}.
14
+ */
13
15
  export interface ThresholdOptions {
14
- /** Values that may appear unnamed. Replaces the default list rather than extending it. */
16
+ /**
17
+ * Values that may appear unnamed. Replaces the default list rather than extending it.
18
+ */
15
19
  ignore?: number[];
16
- /** Exempt radix-prefixed literals, which already read as codepoints or bit masks. */
20
+ /**
21
+ * Exempt radix-prefixed literals, which already read as codepoints or bit masks.
22
+ */
17
23
  allowHex?: boolean;
18
24
  }
19
25
  export declare const noUnnamedThresholdRule: Rule;
@@ -1 +1 @@
1
- {"version":3,"file":"threshold-plugin.d.ts","sourceRoot":"","sources":["../src/threshold-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAWtD,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAChC,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,sBAAsB,EAAE,IA4DpC,CAAA;AAED,eAAe,sBAAsB,CAAA"}
1
+ {"version":3,"file":"threshold-plugin.d.ts","sourceRoot":"","sources":["../src/threshold-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAiBtD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,sBAAsB,EAAE,IA4DpC,CAAA;AAED,eAAe,sBAAsB,CAAA"}
@@ -8,11 +8,17 @@
8
8
  * table is data rather than a tuning knob. That distinction is why this exists instead of
9
9
  * `no-magic-numbers`, which cannot express it.
10
10
  */
11
- /** Operators whose operands read as thresholds. */
11
+ /**
12
+ * Operators whose operands read as thresholds.
13
+ */
12
14
  const COMPARISON_OPERATORS = new Set(["<", ">", "<=", ">=", "===", "!==", "==", "!="]);
13
- /** Numbers so conventional that naming them costs more clarity than it buys. */
15
+ /**
16
+ * Numbers so conventional that naming them costs more clarity than it buys.
17
+ */
14
18
  const DEFAULT_IGNORE = [-1, 0, 1, 2, 0.5, 10, 100, 1000];
15
- /** Radix-prefixed literals: `0x1f`, `0b1010`, `0o777`. */
19
+ /**
20
+ * Radix-prefixed literals: `0x1f`, `0b1010`, `0o777`.
21
+ */
16
22
  const RADIX_PREFIXED = /^0[xXbBoO]/;
17
23
  export const noUnnamedThresholdRule = {
18
24
  meta: {
@@ -1 +1 @@
1
- {"version":3,"file":"threshold-plugin.js","sourceRoot":"","sources":["../src/threshold-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,mDAAmD;AACnD,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAEtF,gFAAgF;AAChF,MAAM,cAAc,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;AAExD,0DAA0D;AAC1D,M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AAC,KAAK,KAAK,QAAQ;gBAAE,OAAM;YAE7C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;YAEhD,6EAA6E;YAC7E,IAAI,QAAQ,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC;gBAAE,OAAM;YAEhD,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC;gBAAE,OAAM;YAE5C,sFAAsF;YACtF,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;YAE3C,OAAO,CAAC,MAAM,CAAC;gBACd,IAAI,EAAE,OAAO;gBACb,OAAO,EACN,uBAAuB,KAAK,sEAAsE;oBAClG,8CAA8C;aAC/C,CAAC,CAAA;QACH,CAAC;QAED,OAAO;YACN,gBAAgB,CAAC,IAAI;gBACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;oBAAE,OAAM;gBAEtE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBAChB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAClB,CAAC;SACD,CAAA;IACF,CAAC;CACD,CAAA;AAED,eAAe,sBAAsB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sister.software/oxlint-config",
3
- "version": "10.0.0",
3
+ "version": "11.0.0",
4
4
  "description": "Sister Software's oxlint config",
5
5
  "license": "AGPL-3.0",
6
6
  "author": "teffen@sister.software",
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file The browser globals whose bare use is ambiguous, and the rule entry built from them. A list
6
+ * this long is reference data — it belongs beside the code that consumes it, not inside the file
7
+ * that assembles the platform-layering overrides.
8
+ */
9
+
10
+ /**
11
+ * Browser globals whose bare use is ambiguous (they collide with common identifiers). Browser- and node-runtime files
12
+ * warn on these, nudging toward an explicit `window.` access.
13
+ */
14
+ export const BROWSER_GLOBALS = [
15
+ "addEventListener",
16
+ "blur",
17
+ "close",
18
+ "closed",
19
+ "confirm",
20
+ "defaultStatus",
21
+ "defaultstatus",
22
+ "event",
23
+ "external",
24
+ "find",
25
+ "focus",
26
+ "frameElement",
27
+ "frames",
28
+ "history",
29
+ "innerHeight",
30
+ "innerWidth",
31
+ "length",
32
+ "location",
33
+ "locationbar",
34
+ "menubar",
35
+ "moveBy",
36
+ "moveTo",
37
+ "name",
38
+ "onblur",
39
+ "onerror",
40
+ "onfocus",
41
+ "onload",
42
+ "onresize",
43
+ "onunload",
44
+ "open",
45
+ "opener",
46
+ "opera",
47
+ "outerHeight",
48
+ "outerWidth",
49
+ "pageXOffset",
50
+ "pageYOffset",
51
+ "parent",
52
+ "print",
53
+ "removeEventListener",
54
+ "resizeBy",
55
+ "resizeTo",
56
+ "screen",
57
+ "screenLeft",
58
+ "screenTop",
59
+ "screenX",
60
+ "screenY",
61
+ "scroll",
62
+ "scrollbars",
63
+ "scrollBy",
64
+ "scrollTo",
65
+ "scrollX",
66
+ "scrollY",
67
+ "self",
68
+ "status",
69
+ "statusbar",
70
+ "stop",
71
+ "toolbar",
72
+ "top",
73
+ ] as const
74
+
75
+ export function restrictedBrowserGlobalsRule(): unknown {
76
+ return ["warn", ...BROWSER_GLOBALS.map((name) => ({ name, message: `Ambiguous: did you mean \`window.${name}\`?` }))]
77
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file The `sister-software/console-padding` rule: a `console.*` call gets a blank line on each
6
+ * side, so the lines that produce output stand apart from the lines that compute it. Scanning a
7
+ * long procedural script for "what does this print" then works visually.
8
+ *
9
+ * A RUN of console calls is one group — no blank lines inside it, one before the first and one
10
+ * after the last, because consecutive calls are one block of output. Neither edge is required
11
+ * where the block boundary already provides the separation: nothing is needed before a call that
12
+ * opens a block, or after one that closes it.
13
+ */
14
+
15
+ import { createPaddingHelpers } from "./padding-utils.js"
16
+ import type { AstNode, Rule } from "./plugin-types.js"
17
+
18
+ /**
19
+ * The object whose method calls this rule treats as output.
20
+ */
21
+ const CONSOLE_OBJECT = "console"
22
+
23
+ /**
24
+ * Is this statement a bare `console.<method>(…)` call?
25
+ */
26
+ function isConsoleStatement(node: AstNode | undefined): boolean {
27
+ if (node?.type !== "ExpressionStatement") return false
28
+ const call = node.expression
29
+
30
+ if (call?.type !== "CallExpression") return false
31
+ const callee = call.callee
32
+
33
+ return (
34
+ callee?.type === "MemberExpression" && callee.object?.type === "Identifier" && callee.object.name === CONSOLE_OBJECT
35
+ )
36
+ }
37
+
38
+ export const consolePaddingRule: Rule = {
39
+ meta: {
40
+ name: "console-padding",
41
+ type: "layout",
42
+ fixable: "whitespace",
43
+ schema: [{ type: "object", additionalProperties: true }],
44
+ },
45
+ create(context) {
46
+ const sourceCode = context.sourceCode ?? context.getSourceCode!()
47
+ const text = sourceCode.getText()
48
+ const { requirePadding } = createPaddingHelpers(context)
49
+
50
+ return {
51
+ ExpressionStatement(node: AstNode) {
52
+ if (!isConsoleStatement(node)) return
53
+ const parent = node.parent
54
+
55
+ // Only statements in a statement list have neighbours to pad against.
56
+ if (!parent || !Array.isArray(parent.body)) return
57
+ const body = parent.body
58
+ const index = body.indexOf(node)
59
+
60
+ if (index === -1) return
61
+ const previous = body[index - 1]
62
+ const next = body[index + 1]
63
+
64
+ // Nothing before a call that opens the block, and nothing between calls in one run.
65
+ if (previous && !isConsoleStatement(previous)) {
66
+ requirePadding(previous, node, node, "Expected a blank line before this console call.")
67
+ }
68
+
69
+ // Nothing after a call that closes the block — the brace already separates it.
70
+ if (next && !isConsoleStatement(next)) {
71
+ requirePadding(node, next, node, "Expected a blank line after this console call.")
72
+ }
73
+ },
74
+ }
75
+ },
76
+ }
@@ -11,18 +11,28 @@
11
11
 
12
12
  import type { Rule } from "./plugin-types.js"
13
13
 
14
- /** Names in SCREAMING_SNAKE_CASE, the convention for a tuning knob. */
14
+ /**
15
+ * Names in SCREAMING_SNAKE_CASE, the convention for a tuning knob.
16
+ */
15
17
  const SCREAMING_CASE = /^[A-Z][A-Z0-9_]*$/
16
18
 
17
- /** Initializers that make the binding a function rather than a constant value. */
19
+ /**
20
+ * Initializers that make the binding a function rather than a constant value.
21
+ */
18
22
  const FUNCTION_INITIALIZERS = new Set(["ArrowFunctionExpression", "FunctionExpression"])
19
23
 
20
- /** Which module-level constants the rule applies to. */
24
+ /**
25
+ * Which module-level constants the rule applies to.
26
+ */
21
27
  export type ConstantDocScope = "exported" | "screaming" | "exported-or-screaming"
22
28
 
23
- /** Options accepted by {@link requireConstantDocRule}. */
29
+ /**
30
+ * Options accepted by {@link requireConstantDocRule}.
31
+ */
24
32
  export interface ConstantDocOptions {
25
- /** Defaults to `"exported-or-screaming"`. */
33
+ /**
34
+ * Defaults to `"exported-or-screaming"`.
35
+ */
26
36
  scope?: ConstantDocScope
27
37
  /**
28
38
  * Export names a framework requires and gives meaning to, which a JSDoc block cannot improve on — Pastel's
@@ -9,7 +9,9 @@
9
9
 
10
10
  import type { Comment, Plugin, Rule } from "./plugin-types.js"
11
11
 
12
- /** Options accepted by the header rule. */
12
+ /**
13
+ * Options accepted by the header rule.
14
+ */
13
15
  export interface HeaderRuleOptions {
14
16
  copyrightHolder?: string
15
17
  spdxLicenseIdentifier?: string
@@ -96,7 +98,9 @@ export const headerRule: Rule = {
96
98
  },
97
99
  }
98
100
 
99
- /** The Sister Software oxlint header plugin. Registers the `sister-software/require-file-header` rule. */
101
+ /**
102
+ * The Sister Software oxlint header plugin. Registers the `sister-software/require-file-header` rule.
103
+ */
100
104
  const headerPlugin: Plugin = {
101
105
  meta: { name: "sister-software" },
102
106
  rules: { "require-file-header": headerRule },