@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,50 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file The blank-line machinery the three padding rules share: how to tell whether two statements are
6
+ * already separated, and how to ask for the separation when they are not.
7
+ *
8
+ * All three anchor their fix to the END of the earlier statement. That is deliberate: when two rules
9
+ * want the same blank line — a console call before a `return`, say — they emit the identical edit, so
10
+ * one is applied and the other is a no-op, instead of each inserting a newline and producing a gap of
11
+ * two.
12
+ */
13
+ /**
14
+ * Build the helpers for one rule invocation.
15
+ *
16
+ * A gap is measured to the earliest comment that leads the later statement, so the blank line lands above a statement's
17
+ * own comments rather than between them and their subject.
18
+ */
19
+ export function createPaddingHelpers(context) {
20
+ const sourceCode = context.sourceCode ?? context.getSourceCode();
21
+ const text = sourceCode.getText();
22
+ const comments = sourceCode.getAllComments();
23
+ function isPadded(from, to) {
24
+ // Two statements with no newline between them cannot be separated by a blank line. This is the
25
+ // `;(expr)` ASI guard: the semicolon terminates the PREVIOUS statement, so the gap here is zero
26
+ // characters wide. Asking for padding there is asking for the impossible.
27
+ if (!text.slice(from.range[1], to.range[0]).includes("\n"))
28
+ return true;
29
+ let start = to.range[0];
30
+ for (const comment of comments) {
31
+ if (comment.range[0] >= from.range[1] && comment.range[1] <= to.range[0]) {
32
+ start = Math.min(start, comment.range[0]);
33
+ }
34
+ }
35
+ return (text.slice(from.range[1], start).match(/\n/g) ?? []).length >= 2;
36
+ }
37
+ function requirePadding(from, to, node, message) {
38
+ if (isPadded(from, to))
39
+ return;
40
+ context.report({
41
+ node,
42
+ message,
43
+ fix(fixer) {
44
+ return fixer.insertTextAfterRange([from.range[1], from.range[1]], "\n");
45
+ },
46
+ });
47
+ }
48
+ return { isPadded, requirePadding };
49
+ }
50
+ //# sourceMappingURL=padding-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"padding-utils.js","sourceRoot":"","sources":["../src/padding-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAoB;IACxD,MAAM,UAAU,GAAe,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,aAAc,EAAE,CAAA;IAC7E,MAAM,IAAI,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AI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;YACxE,CAAC;SACD,CAAC,CAAA;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;AACpC,CAAC"}
@@ -10,39 +10,81 @@ export interface Comment {
10
10
  value: string;
11
11
  range: [number, number];
12
12
  }
13
- /** A loosely-typed AST node — only the fields the bundled rules read. */
13
+ /**
14
+ * A loosely-typed AST node — only the fields the bundled rules read.
15
+ */
14
16
  export interface AstNode {
15
17
  type: string;
16
18
  range: [number, number];
17
19
  parent?: AstNode;
18
- /** A statement-list body (block/program) is an array; a loop body is a single statement. */
20
+ /**
21
+ * A statement-list body (block/program) is an array; a loop body is a single statement.
22
+ */
19
23
  body?: AstNode[] | AstNode;
20
- /** `if`/`else` branches, for the require-braces rule. */
24
+ /**
25
+ * `if`/`else` branches, for the require-braces rule.
26
+ */
21
27
  consequent?: AstNode;
22
28
  alternate?: AstNode | null;
23
- /** Binary/unary operator text, for the threshold rule. */
29
+ /**
30
+ * Binary/unary operator text, for the threshold rule.
31
+ */
24
32
  operator?: string;
25
- /** Binary-expression operands. */
33
+ /**
34
+ * Binary-expression operands.
35
+ */
26
36
  left?: AstNode;
27
37
  right?: AstNode;
28
- /** Unary-expression operand. */
38
+ /**
39
+ * Unary-expression operand.
40
+ */
29
41
  argument?: AstNode;
30
- /** A literal's value, and its verbatim source text (`raw` preserves a `0x` prefix). */
42
+ /**
43
+ * A literal's value, and its verbatim source text (`raw` preserves a `0x` prefix).
44
+ */
31
45
  value?: unknown;
32
46
  raw?: string;
33
- /** `const` / `let` / `var`, for the constant-doc rule. */
47
+ /**
48
+ * `const` / `let` / `var`, for the constant-doc rule.
49
+ */
34
50
  kind?: string;
35
- /** Declarators of a variable declaration. */
51
+ /**
52
+ * Declarators of a variable declaration.
53
+ */
36
54
  declarations?: AstNode[];
37
- /** A declarator's binding identifier and initializer. */
55
+ /**
56
+ * A declarator's binding identifier and initializer.
57
+ */
38
58
  id?: AstNode;
39
59
  init?: AstNode | null;
40
- /** An identifier's name. */
60
+ /**
61
+ * An identifier's name.
62
+ */
41
63
  name?: string;
42
- /** The condition of an `if`/`while`/`for`/ternary, for the length-truthiness rule. */
64
+ /**
65
+ * The condition of an `if`/`while`/`for`/ternary, for the length-truthiness rule.
66
+ */
43
67
  test?: AstNode | null;
44
- /** A member expression's accessed property. */
68
+ /**
69
+ * A member expression's accessed property.
70
+ */
45
71
  property?: AstNode;
72
+ /**
73
+ * An expression statement's expression, for the console-padding rule.
74
+ */
75
+ expression?: AstNode;
76
+ /**
77
+ * An export statement's inner declaration, for the padding rules.
78
+ */
79
+ declaration?: AstNode | null;
80
+ /**
81
+ * A call expression's callee.
82
+ */
83
+ callee?: AstNode;
84
+ /**
85
+ * A member expression's object.
86
+ */
87
+ object?: AstNode;
46
88
  }
47
89
  export interface SourceCode {
48
90
  getText(): string;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-types.d.ts","sourceRoot":"","sources":["../src/plugin-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvB;AAED,yEAAyE;AACzE,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,4FAA4F;IAC5F,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;IAC1B,yDAAyD;IACzD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE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AO,EAAE,OAAO,EAAE,CAAA;IAClB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,aAAa,CAAC,IAAI,UAAU,CAAA;IAC5B,MAAM,CAAC,UAAU,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAA;KAAE,GAAG,IAAI,CAAA;CACzF;AAED,MAAM,WAAW,IAAI;IACpB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;QAAC,MAAM,EAAE,OAAO,EAAE,CAAA;KAAE,CAAA;IACxF,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC,CAAA;CACrE;AAED,MAAM,WAAW,MAAM;IACtB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACtB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAI/C,QAAA,MAAM,oBAAoB,EAAE,MAW3B,CAAA;AAED,eAAe,oBAAoB,CAAA"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAUH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAU/C,QAAA,MAAM,oBAAoB,EAAE,MAkB3B,CAAA;AAED,eAAe,oBAAoB,CAAA"}
package/out/plugin.js CHANGED
@@ -6,22 +6,33 @@
6
6
  * names) exposing all of Sister Software's custom rules under the `sister-software/` namespace.
7
7
  */
8
8
  import { bracesRule } from "./braces-plugin.js";
9
+ import { consolePaddingRule } from "./console-padding-plugin.js";
9
10
  import { requireConstantDocRule } from "./constant-doc-plugin.js";
10
11
  import { headerRule } from "./headers-plugin.js";
12
+ import { multilineJSDocRule } from "./jsdoc-plugin.js";
11
13
  import { preferLengthTruthinessRule } from "./length-truthiness-plugin.js";
14
+ import { multilineStatementPaddingRule } from "./multiline-statement-plugin.js";
12
15
  import { paddingRule } from "./padding-plugin.js";
13
16
  import { noProcessGlobalsRule } from "./process-globals-plugin.js";
17
+ import { conciseSectionMarkerRule, maxRegionsRule, preferMarkCommentRule, preferRegionOverMarksRule, } from "./section-marker-plugin.js";
14
18
  import { noUnnamedThresholdRule } from "./threshold-plugin.js";
15
19
  const sisterSoftwarePlugin = {
16
20
  meta: { name: "sister-software" },
17
21
  rules: {
18
22
  "require-file-header": headerRule,
19
23
  "padding-lines": paddingRule,
24
+ "console-padding": consolePaddingRule,
25
+ "multiline-statement-padding": multilineStatementPaddingRule,
20
26
  "require-braces": bracesRule,
21
27
  "no-process-globals": noProcessGlobalsRule,
22
28
  "no-unnamed-threshold": noUnnamedThresholdRule,
23
29
  "require-constant-doc": requireConstantDocRule,
24
30
  "prefer-length-truthiness": preferLengthTruthinessRule,
31
+ "multiline-jsdoc": multilineJSDocRule,
32
+ "prefer-mark-comment": preferMarkCommentRule,
33
+ "concise-section-marker": conciseSectionMarkerRule,
34
+ "prefer-region-over-marks": preferRegionOverMarksRule,
35
+ "max-regions": maxRegionsRule,
25
36
  },
26
37
  };
27
38
  export default sisterSoftwarePlugin;
package/out/plugin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,sBA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qBAAqB,EACrB,yBAAyB,GACzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAE9D,MAAM,oBAAoB,GAAW;IACpC,IAAI,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;IACjC,KAAK,EAAE;QACN,qBAAqB,EAAE,UAAU;QACjC,eAAe,EAAE,WAAW;QAC5B,iBAAiB,EAAE,kBAAkB;QACrC,6BAA6B,EAAE,6BAA6B;QAC5D,gBAAgB,EAAE,UAAU;QAC5B,oBAAoB,EAAE,oBAAoB;QAC1C,sBAAsB,EAAE,sBAAsB;QAC9C,sBAAsB,EAAE,sBAAsB;QAC9C,0BAA0B,EAAE,0BAA0B;QACtD,iBAAiB,EAAE,kBAAkB;QACrC,qBAAqB,EAAE,qBAAqB;QAC5C,wBAAwB,EAAE,wBAAwB;QAClD,0BAA0B,EAAE,yBAAyB;QACrD,aAAa,EAAE,cAAc;KAC7B;CACD,CAAA;AAED,eAAe,oBAAoB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"process-globals-plugin.d.ts","sourceRoot":"","sources":["../src/process-globals-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,mBAAmB,CAAA;AA+BtD,eAAO,MAAM,oBAAoB,EAAE,IAwBlC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
1
+ {"version":3,"file":"process-globals-plugin.d.ts","sourceRoot":"","sources":["../src/process-globals-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,mBAAmB,CAAA;AAmCtD,eAAO,MAAM,oBAAoB,EAAE,IAwBlC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
@@ -7,9 +7,13 @@
7
7
  * few blessed helpers; the helper files disable the rule (`sister-software/no-process-globals`).
8
8
  * oxlint has no `no-restricted-syntax`, so this is a small dedicated rule instead.
9
9
  */
10
- /** `process` members that must be reached through a blessed helper, not accessed directly. */
10
+ /**
11
+ * `process` members that must be reached through a blessed helper, not accessed directly.
12
+ */
11
13
  const RESTRICTED_MEMBERS = new Set(["env", "argv"]);
12
- /** The accessed member name for `process.env` (identifier) or `process["env"]` (string literal). */
14
+ /**
15
+ * The accessed member name for `process.env` (identifier) or `process["env"]` (string literal).
16
+ */
13
17
  function accessedMember(node) {
14
18
  const property = node.property;
15
19
  if (!property)
@@ -1 +1 @@
1
- {"version":3,"file":"process-globals-plugin.js","sourceRoot":"","sources":["../src/process-globals-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,8FAA8F;AAC9F,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;AAanD,oGAAoG;AACpG,SAAS,cAAc,CAAC,IAAgB;IACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;IAE9B,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE1B,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,YAAY;QAAE,OAAO,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAA;IAElF,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,eAAe,CAAC,EAAE,CAAC;QACzF,OAAO,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IAClE,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAS;IACzC,IAAI,EAAE;QACL,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ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AAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;IAClE,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAS;IACzC,IAAI,EAAE;QACL,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;KACxD;IACD,MAAM,CAAC,OAAO;QACb,OAAO;YACN,gBAAgB,CAAC,IAAI;gBACpB,MAAM,MAAM,GAAG,IAAkB,CAAA;gBAEjC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,KAAK,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS;oBAAE,OAAM;gBAEpF,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,CAAA;gBAEnC,IAAI,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC;oBAAE,OAAM;gBAElD,OAAO,CAAC,MAAM,CAAC;oBACd,IAAI;oBACJ,OAAO,EAAE,oBAAoB,IAAI,gIAAgI;iBACjK,CAAC,CAAA;YACH,CAAC;SACD,CAAA;IACF,CAAC;CACD,CAAA;AAED,eAAe,oBAAoB,CAAA"}
@@ -17,7 +17,9 @@ export declare const RuntimePackageNamesRecord: {
17
17
  readonly worker: readonly ["worker"];
18
18
  };
19
19
  export type RuntimePackageNamesRecord = typeof RuntimePackageNamesRecord;
20
- /** Valid runtime names. */
20
+ /**
21
+ * Valid runtime names.
22
+ */
21
23
  export type RuntimeName = keyof RuntimePackageNamesRecord;
22
24
  /**
23
25
  * Given a package name, produces the glob matcher for files belonging to that package.
@@ -27,7 +29,9 @@ export type RuntimeName = keyof RuntimePackageNamesRecord;
27
29
  * @returns A single-element glob array, e.g. `["**\/client.{js,...}"]`.
28
30
  */
29
31
  export declare function createPackageFileMatcher(packageName: string): string[];
30
- /** A restricted-import entry: an exact module name plus the message shown when it is imported. */
32
+ /**
33
+ * A restricted-import entry: an exact module name plus the message shown when it is imported.
34
+ */
31
35
  export interface RestrictedPath {
32
36
  name: string;
33
37
  message: string;
@@ -42,7 +46,9 @@ export declare function ambiguousNodeBuiltinPaths(): RestrictedPath[];
42
46
  * must not assume a Node runtime at all.
43
47
  */
44
48
  export declare function allNodeBuiltinPaths(message: string): RestrictedPath[];
45
- /** A per-file-glob oxlint override: applies `rules` only to files matching `files`. */
49
+ /**
50
+ * A per-file-glob oxlint override: applies `rules` only to files matching `files`.
51
+ */
46
52
  export interface OxlintOverride {
47
53
  files: string[];
48
54
  rules: Record<string, unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"restrictions.d.ts","sourceRoot":"","sources":["../src/restrictions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAA;AAEV,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,2BAA2B;AAC3B,MAAM,MAAM,WAAW,GAAG,MAAM,yBAAyB,CAAA;AAEzD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtE;AAiBD,kGAAkG;AAClG,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,cAAc,EAAE,CAK5D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE,CAErE;AA+ED,uFAAuF;AACvF,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,GAAG,cAAc,EAAE,CAqDjF"}
1
+ {"version":3,"file":"restrictions.d.ts","sourceRoot":"","sources":["../src/restrictions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB;;;;;CAK5B,CAAA;AAEV,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,yBAAyB,CAAA;AAEzD;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAEtE;AAmBD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,cAAc,EAAE,CAK5D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE,CAErE;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AA+BD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,gBAAgB,EAAE,MAAM,GAAG,cAAc,EAAE,CAqDjF"}
@@ -5,6 +5,7 @@
5
5
  * @file Platform-layering import restrictions, ported to oxlint's `no-restricted-imports`.
6
6
  */
7
7
  import { builtinModules } from "node:module";
8
+ import { restrictedBrowserGlobalsRule } from "./browser-globals.js";
8
9
  //#region Runtime data
9
10
  /**
10
11
  * Reserved package-name suffixes mapped to their target runtime.
@@ -28,7 +29,9 @@ export const RuntimePackageNamesRecord = {
28
29
  export function createPackageFileMatcher(packageName) {
29
30
  return [`**/${packageName}.{js,mjs,cjs,ts,d.ts,mts,tsx}`];
30
31
  }
31
- /** Joins a namespace and package name into a specifier, e.g. `@sister.software/client`. */
32
+ /**
33
+ * Joins a namespace and package name into a specifier, e.g. `@sister.software/client`.
34
+ */
32
35
  function namespaced(packageNamespace, packageName) {
33
36
  return [packageNamespace, packageName].filter(Boolean).join("/");
34
37
  }
@@ -53,75 +56,6 @@ export function ambiguousNodeBuiltinPaths() {
53
56
  export function allNodeBuiltinPaths(message) {
54
57
  return [...NODE_BUILTINS_NO_PREFIX, ...NODE_BUILTINS_PREFIXED].map((name) => ({ name, message }));
55
58
  }
56
- //#endregion
57
- //#region Browser globals
58
- /**
59
- * Browser globals whose bare use is ambiguous (they collide with common identifiers). Browser- and node-runtime files
60
- * warn on these, nudging toward an explicit `window.` access.
61
- */
62
- const BROWSER_GLOBALS = [
63
- "addEventListener",
64
- "blur",
65
- "close",
66
- "closed",
67
- "confirm",
68
- "defaultStatus",
69
- "defaultstatus",
70
- "event",
71
- "external",
72
- "find",
73
- "focus",
74
- "frameElement",
75
- "frames",
76
- "history",
77
- "innerHeight",
78
- "innerWidth",
79
- "length",
80
- "location",
81
- "locationbar",
82
- "menubar",
83
- "moveBy",
84
- "moveTo",
85
- "name",
86
- "onblur",
87
- "onerror",
88
- "onfocus",
89
- "onload",
90
- "onresize",
91
- "onunload",
92
- "open",
93
- "opener",
94
- "opera",
95
- "outerHeight",
96
- "outerWidth",
97
- "pageXOffset",
98
- "pageYOffset",
99
- "parent",
100
- "print",
101
- "removeEventListener",
102
- "resizeBy",
103
- "resizeTo",
104
- "screen",
105
- "screenLeft",
106
- "screenTop",
107
- "screenX",
108
- "screenY",
109
- "scroll",
110
- "scrollbars",
111
- "scrollBy",
112
- "scrollTo",
113
- "scrollX",
114
- "scrollY",
115
- "self",
116
- "status",
117
- "statusbar",
118
- "stop",
119
- "toolbar",
120
- "top",
121
- ];
122
- function restrictedBrowserGlobalsRule() {
123
- return ["warn", ...BROWSER_GLOBALS.map((name) => ({ name, message: `Ambiguous: did you mean \`window.${name}\`?` }))];
124
- }
125
59
  /**
126
60
  * Builds the `patterns` entries forbidding a runtime from importing packages of incompatible runtimes, each with a
127
61
  * tailored message.
@@ -1 +1 @@
1
- {"version":3,"file":"restrictions.js","sourceRoot":"","sources":["../src/restrictions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,sBAAsB;AAEtB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC9B,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC;IAC/B,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC9B,MAAM,EAAE,CAAC,QAAQ,CAAC;CACT,CAAA;AAOV;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,WAAmB;IAC3D,OAAO,CAAC,MAAM,WAAW,+BAA+B,CAAC,CAAA;AAC1D,CAAC;AAED,2FAA2F;AAC3F,SAAS,UAAU,CAAC,gBAAwB,EAAE,WAAmB;IAChE,OAAO,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACjE,CAAC;AAED,YAAY;AAEZ,+BAA+B;AAE/B,MAAM,uBAAuB,GAAG,cAAc,CAAC,MAAM,CACpD,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAC9E,CAAA;AAED,MAAM,sBAAsB,GAAG,uBAAuB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,UAAU,EAAE,CAAC,CAAA;AAQhG;;;GAGG;AACH,MAAM,UAAU,yBAAyB;IACxC,OAAO,uBAAuB,CAAC,GAAG,C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E,wBAAwB,CAAC,WAAW,CAAC;YAC5C,KAAK,EAAE;gBACN,uBAAuB,EAAE;oBACxB,MAAM;oBACN;wBACC,KAAK,EAAE,mBAAmB,CACzB,mFAAmF,CACnF;wBACD,QAAQ,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;qBAC3F;iBACD;aACD;SACD,CAAC,CAAA;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AACjB,CAAC;AAED,YAAY"}
@@ -0,0 +1,25 @@
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
+ import type { Rule } from "./plugin-types.js";
21
+ export declare const preferMarkCommentRule: Rule;
22
+ export declare const conciseSectionMarkerRule: Rule;
23
+ export declare const preferRegionOverMarksRule: Rule;
24
+ export declare const maxRegionsRule: Rule;
25
+ //# sourceMappingURL=section-marker-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-marker-plugin.d.ts","sourceRoot":"","sources":["../src/section-marker-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAW,IAAI,EAA2B,MAAM,mBAAmB,CAAA;AAuJ/E,eAAO,MAAM,qBAAqB,EAAE,IA+CnC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,IA+BtC,CAAA;AAED,eAAO,MAAM,yBAAyB,EAAE,IAwBvC,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,IA0B5B,CAAA"}