@sarj/eslint-plugin 16.32.0 → 16.32.1

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.
@@ -14,8 +14,8 @@ interface ExampleFile {
14
14
  readonly source: string;
15
15
  }
16
16
  /** A reviewed example. It remains private unless `public: true` is explicit. */
17
- interface RuleExample {
18
- readonly ruleOptions?: readonly unknown[];
17
+ interface RuleExample<Options extends readonly unknown[] = readonly unknown[]> {
18
+ readonly ruleOptions?: Readonly<Options>;
19
19
  readonly installedDependencies?: readonly {
20
20
  readonly module: string;
21
21
  readonly version: string;
@@ -31,7 +31,7 @@ interface RuleExample {
31
31
  readonly fixedFiles?: readonly ExampleFile[];
32
32
  }
33
33
  /** Human-authored fields that cannot be derived from the ESLint rule module. */
34
- interface RuleDocumentation {
34
+ interface RuleDocumentation<Options extends readonly unknown[] = readonly unknown[]> {
35
35
  readonly summary: string;
36
36
  readonly rationale: string;
37
37
  readonly remediation: string;
@@ -44,7 +44,7 @@ interface RuleDocumentation {
44
44
  readonly filePatterns?: readonly string[];
45
45
  readonly references?: readonly string[];
46
46
  readonly since?: string;
47
- readonly examples?: readonly RuleExample[];
47
+ readonly examples?: readonly RuleExample<Options>[];
48
48
  }
49
49
  /** Complete native record exposed to catalog generation without changing ESLint metadata. */
50
50
  interface NativeRuleSpec extends Required<Omit<RuleDocumentation, "since">> {
@@ -14,8 +14,8 @@ interface ExampleFile {
14
14
  readonly source: string;
15
15
  }
16
16
  /** A reviewed example. It remains private unless `public: true` is explicit. */
17
- interface RuleExample {
18
- readonly ruleOptions?: readonly unknown[];
17
+ interface RuleExample<Options extends readonly unknown[] = readonly unknown[]> {
18
+ readonly ruleOptions?: Readonly<Options>;
19
19
  readonly installedDependencies?: readonly {
20
20
  readonly module: string;
21
21
  readonly version: string;
@@ -31,7 +31,7 @@ interface RuleExample {
31
31
  readonly fixedFiles?: readonly ExampleFile[];
32
32
  }
33
33
  /** Human-authored fields that cannot be derived from the ESLint rule module. */
34
- interface RuleDocumentation {
34
+ interface RuleDocumentation<Options extends readonly unknown[] = readonly unknown[]> {
35
35
  readonly summary: string;
36
36
  readonly rationale: string;
37
37
  readonly remediation: string;
@@ -44,7 +44,7 @@ interface RuleDocumentation {
44
44
  readonly filePatterns?: readonly string[];
45
45
  readonly references?: readonly string[];
46
46
  readonly since?: string;
47
- readonly examples?: readonly RuleExample[];
47
+ readonly examples?: readonly RuleExample<Options>[];
48
48
  }
49
49
  /** Complete native record exposed to catalog generation without changing ESLint metadata. */
50
50
  interface NativeRuleSpec extends Required<Omit<RuleDocumentation, "since">> {
package/dist/index.cjs CHANGED
@@ -1580,7 +1580,7 @@ function isSearchParamReceiver(call, services) {
1580
1580
  // package.json
1581
1581
  var package_default = {
1582
1582
  name: "@sarj/eslint-plugin",
1583
- version: "16.32.0",
1583
+ version: "16.32.1",
1584
1584
  packageManager: "npm@12.2.1",
1585
1585
  description: "Custom ESLint rules for hypermodern TypeScript / React / Next.js projects",
1586
1586
  type: "module",
@@ -1791,6 +1791,7 @@ function exactConstruction(node, consumer, implementation) {
1791
1791
 
1792
1792
  // src/rules/require-explicit-contract-implementation.ts
1793
1793
  var ESCAPED_CLASSES = /* @__PURE__ */ new WeakMap();
1794
+ var PROTOTYPE_MUTATIONS = /* @__PURE__ */ new WeakMap();
1794
1795
  var REQUIRE_EXPLICIT_CONTRACT_IMPLEMENTATION_DOCUMENTATION = {
1795
1796
  defaultLevel: "error",
1796
1797
  summary: "Require nominal inheritance when an injected abstract class is rejected by an instanceof guard.",
@@ -1855,6 +1856,8 @@ var REQUIRE_EXPLICIT_CONTRACT_IMPLEMENTATION_DOCUMENTATION = {
1855
1856
  ]
1856
1857
  };
1857
1858
  function hasPrototypeMutation(source) {
1859
+ const cached = PROTOTYPE_MUTATIONS.get(source);
1860
+ if (cached !== void 0) return cached;
1858
1861
  function visit(node) {
1859
1862
  const member3 = memberName(node);
1860
1863
  if (member3 === "setPrototypeOf" || member3 === "__proto__" || member3 === "hasInstance")
@@ -1863,7 +1866,9 @@ function hasPrototypeMutation(source) {
1863
1866
  return true;
1864
1867
  return ts9.forEachChild(node, visit);
1865
1868
  }
1866
- return visit(source) === true;
1869
+ const mutated = visit(source) === true;
1870
+ PROTOTYPE_MUTATIONS.set(source, mutated);
1871
+ return mutated;
1867
1872
  }
1868
1873
  function memberName(node) {
1869
1874
  if (ts9.isPropertyAccessExpression(node)) return node.name.text;
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DocumentedRule } from './_docs-DU-K223M.cjs';
2
- export { p as publicDocumentation } from './_docs-DU-K223M.cjs';
1
+ import { D as DocumentedRule } from './_docs-Bq5OCcWF.cjs';
2
+ export { p as publicDocumentation } from './_docs-Bq5OCcWF.cjs';
3
3
  import '@typescript-eslint/utils';
4
4
 
5
5
  /** @fileoverview _retired-rules — burned rule names and their migration action. */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DocumentedRule } from './_docs-DU-K223M.js';
2
- export { p as publicDocumentation } from './_docs-DU-K223M.js';
1
+ import { D as DocumentedRule } from './_docs-Bq5OCcWF.js';
2
+ export { p as publicDocumentation } from './_docs-Bq5OCcWF.js';
3
3
  import '@typescript-eslint/utils';
4
4
 
5
5
  /** @fileoverview _retired-rules — burned rule names and their migration action. */
package/dist/index.js CHANGED
@@ -1533,7 +1533,7 @@ function isSearchParamReceiver(call, services) {
1533
1533
  // package.json
1534
1534
  var package_default = {
1535
1535
  name: "@sarj/eslint-plugin",
1536
- version: "16.32.0",
1536
+ version: "16.32.1",
1537
1537
  packageManager: "npm@12.2.1",
1538
1538
  description: "Custom ESLint rules for hypermodern TypeScript / React / Next.js projects",
1539
1539
  type: "module",
@@ -1750,6 +1750,7 @@ function exactConstruction(node, consumer, implementation) {
1750
1750
 
1751
1751
  // src/rules/require-explicit-contract-implementation.ts
1752
1752
  var ESCAPED_CLASSES = /* @__PURE__ */ new WeakMap();
1753
+ var PROTOTYPE_MUTATIONS = /* @__PURE__ */ new WeakMap();
1753
1754
  var REQUIRE_EXPLICIT_CONTRACT_IMPLEMENTATION_DOCUMENTATION = {
1754
1755
  defaultLevel: "error",
1755
1756
  summary: "Require nominal inheritance when an injected abstract class is rejected by an instanceof guard.",
@@ -1814,6 +1815,8 @@ var REQUIRE_EXPLICIT_CONTRACT_IMPLEMENTATION_DOCUMENTATION = {
1814
1815
  ]
1815
1816
  };
1816
1817
  function hasPrototypeMutation(source) {
1818
+ const cached = PROTOTYPE_MUTATIONS.get(source);
1819
+ if (cached !== void 0) return cached;
1817
1820
  function visit(node) {
1818
1821
  const member3 = memberName(node);
1819
1822
  if (member3 === "setPrototypeOf" || member3 === "__proto__" || member3 === "hasInstance")
@@ -1822,7 +1825,9 @@ function hasPrototypeMutation(source) {
1822
1825
  return true;
1823
1826
  return ts9.forEachChild(node, visit);
1824
1827
  }
1825
- return visit(source) === true;
1828
+ const mutated = visit(source) === true;
1829
+ PROTOTYPE_MUTATIONS.set(source, mutated);
1830
+ return mutated;
1826
1831
  }
1827
1832
  function memberName(node) {
1828
1833
  if (ts9.isPropertyAccessExpression(node)) return node.name.text;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarj/eslint-plugin",
3
- "version": "16.32.0",
3
+ "version": "16.32.1",
4
4
  "packageManager": "npm@12.2.1",
5
5
  "description": "Custom ESLint rules for hypermodern TypeScript / React / Next.js projects",
6
6
  "type": "module",