@remylagerweij/vue-doctor 2.0.2 → 2.0.3

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.
@@ -1,13 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import fs from "node:fs";
3
- //#region src/plugin/define-audit-rule.ts
3
+ // src/plugin/define-audit-rule.ts
4
4
  const defineAuditRule = ({ meta }) => ({ ruleMeta: {
5
5
  ...meta,
6
6
  engine: "audit"
7
7
  } });
8
8
  const isAuditRule = (rule) => rule.ruleMeta.engine === "audit";
9
- //#endregion
10
- //#region src/plugin/define-fs-rule.ts
9
+ // src/plugin/define-fs-rule.ts
11
10
  const defineFsRule = ({ meta, check }) => ({
12
11
  ruleMeta: {
13
12
  ...meta,
@@ -17,8 +16,7 @@ const defineFsRule = ({ meta, check }) => ({
17
16
  });
18
17
  /** Any registered rule module: oxlint rules carry `create`, fs rules `check`. */
19
18
  const isFsRule = (rule) => rule.ruleMeta.engine === "fs";
20
- //#endregion
21
- //#region src/plugin/constants.ts
19
+ // src/plugin/constants.ts
22
20
  const LAYOUT_PROPERTIES = /* @__PURE__ */ new Set([
23
21
  "width",
24
22
  "height",
@@ -102,8 +100,7 @@ const CHAINABLE_ITERATION_METHODS = /* @__PURE__ */ new Set([
102
100
  "flatMap"
103
101
  ]);
104
102
  const STORAGE_OBJECTS$1 = /* @__PURE__ */ new Set(["localStorage", "sessionStorage"]);
105
- //#endregion
106
- //#region src/plugin/visitor-keys.ts
103
+ // src/plugin/visitor-keys.ts
107
104
  const NONE = [];
108
105
  const WRAPPER_TYPES = [
109
106
  "ExpressionStatement",
@@ -227,8 +224,7 @@ const VISITOR_KEYS = {
227
224
  MetaProperty: ["meta", "property"],
228
225
  ImportExpression: ["source"]
229
226
  };
230
- //#endregion
231
- //#region src/plugin/helpers.ts
227
+ // src/plugin/helpers.ts
232
228
  const SETTER_CALL_PATTERN = /^set[A-Z]/;
233
229
  const getFilename = (context) => {
234
230
  const filename = context.filename ?? (typeof context.getFilename === "function" ? context.getFilename() : void 0);
@@ -346,8 +342,7 @@ const findEnclosingFunction = (node, options = {}) => {
346
342
  }
347
343
  return null;
348
344
  };
349
- //#endregion
350
- //#region src/plugin/define-rule.ts
345
+ // src/plugin/define-rule.ts
351
346
  const defineRule = ({ meta, create }) => ({
352
347
  meta: {
353
348
  type: meta.category === "Security" || meta.defaultSeverity === "error" ? "problem" : "suggestion",
@@ -360,8 +355,7 @@ const defineRule = ({ meta, create }) => ({
360
355
  engine: "oxlint"
361
356
  }
362
357
  });
363
- //#endregion
364
- //#region src/plugin/rules/architecture/no-giant-component.ts
358
+ // src/plugin/rules/architecture/no-giant-component.ts
365
359
  var no_giant_component_default = defineRule({
366
360
  meta: {
367
361
  id: "no-giant-component",
@@ -388,8 +382,7 @@ var no_giant_component_default = defineRule({
388
382
  }
389
383
  } })
390
384
  });
391
- //#endregion
392
- //#region src/plugin/rules/architecture/no-nested-component-definition.ts
385
+ // src/plugin/rules/architecture/no-nested-component-definition.ts
393
386
  var no_nested_component_definition_default = defineRule({
394
387
  meta: {
395
388
  id: "no-nested-component-definition",
@@ -430,8 +423,7 @@ var no_nested_component_definition_default = defineRule({
430
423
  };
431
424
  }
432
425
  });
433
- //#endregion
434
- //#region src/plugin/rules/bundle-size/no-barrel-import.ts
426
+ // src/plugin/rules/bundle-size/no-barrel-import.ts
435
427
  var no_barrel_import_default = defineRule({
436
428
  meta: {
437
429
  id: "no-barrel-import",
@@ -454,8 +446,7 @@ var no_barrel_import_default = defineRule({
454
446
  });
455
447
  } })
456
448
  });
457
- //#endregion
458
- //#region src/plugin/rules/bundle-size/no-full-lodash-import.ts
449
+ // src/plugin/rules/bundle-size/no-full-lodash-import.ts
459
450
  var no_full_lodash_import_default = defineRule({
460
451
  meta: {
461
452
  id: "no-full-lodash-import",
@@ -475,8 +466,7 @@ var no_full_lodash_import_default = defineRule({
475
466
  });
476
467
  } })
477
468
  });
478
- //#endregion
479
- //#region src/plugin/rules/bundle-size/no-moment.ts
469
+ // src/plugin/rules/bundle-size/no-moment.ts
480
470
  var no_moment_default = defineRule({
481
471
  meta: {
482
472
  id: "no-moment",
@@ -496,8 +486,7 @@ var no_moment_default = defineRule({
496
486
  });
497
487
  } })
498
488
  });
499
- //#endregion
500
- //#region src/plugin/rules/bundle-size/no-undeferred-third-party.ts
489
+ // src/plugin/rules/bundle-size/no-undeferred-third-party.ts
501
490
  var no_undeferred_third_party_default = defineRule({
502
491
  meta: {
503
492
  id: "no-undeferred-third-party",
@@ -525,8 +514,7 @@ var no_undeferred_third_party_default = defineRule({
525
514
  }
526
515
  } })
527
516
  });
528
- //#endregion
529
- //#region src/plugin/rules/bundle-size/prefer-dynamic-import.ts
517
+ // src/plugin/rules/bundle-size/prefer-dynamic-import.ts
530
518
  var prefer_dynamic_import_default = defineRule({
531
519
  meta: {
532
520
  id: "prefer-dynamic-import",
@@ -548,8 +536,7 @@ var prefer_dynamic_import_default = defineRule({
548
536
  });
549
537
  } })
550
538
  });
551
- //#endregion
552
- //#region src/plugin/rules/correctness/no-array-index-as-key.ts
539
+ // src/plugin/rules/correctness/no-array-index-as-key.ts
553
540
  const referencesName = (node, name) => {
554
541
  if (!node) return false;
555
542
  let didFindReference = false;
@@ -597,8 +584,7 @@ var no_array_index_as_key_default = defineRule({
597
584
  });
598
585
  } })
599
586
  });
600
- //#endregion
601
- //#region src/plugin/rules/correctness/no-async-setup-without-suspense.ts
587
+ // src/plugin/rules/correctness/no-async-setup-without-suspense.ts
602
588
  var no_async_setup_without_suspense_default = defineRule({
603
589
  meta: {
604
590
  id: "no-async-setup-without-suspense",
@@ -621,8 +607,7 @@ var no_async_setup_without_suspense_default = defineRule({
621
607
  });
622
608
  } })
623
609
  });
624
- //#endregion
625
- //#region src/plugin/rules/correctness/no-direct-dom-manipulation.ts
610
+ // src/plugin/rules/correctness/no-direct-dom-manipulation.ts
626
611
  const DOM_METHODS = /* @__PURE__ */ new Set([
627
612
  "getElementById",
628
613
  "getElementsByClassName",
@@ -653,8 +638,7 @@ var no_direct_dom_manipulation_default = defineRule({
653
638
  });
654
639
  } })
655
640
  });
656
- //#endregion
657
- //#region src/plugin/rules/correctness/no-prevent-default.ts
641
+ // src/plugin/rules/correctness/no-prevent-default.ts
658
642
  const LISTENER_REGISTRATION_METHODS = /* @__PURE__ */ new Set([
659
643
  "addEventListener",
660
644
  "removeEventListener",
@@ -696,8 +680,7 @@ var no_prevent_default_default = defineRule({
696
680
  });
697
681
  } })
698
682
  });
699
- //#endregion
700
- //#region src/plugin/rules/correctness/no-this-in-setup.ts
683
+ // src/plugin/rules/correctness/no-this-in-setup.ts
701
684
  var no_this_in_setup_default = defineRule({
702
685
  meta: {
703
686
  id: "no-this-in-setup",
@@ -721,8 +704,7 @@ var no_this_in_setup_default = defineRule({
721
704
  });
722
705
  } })
723
706
  });
724
- //#endregion
725
- //#region src/plugin/rules/correctness/prefer-defineProps-destructure.ts
707
+ // src/plugin/rules/correctness/prefer-defineProps-destructure.ts
726
708
  var prefer_defineProps_destructure_default = defineRule({
727
709
  meta: {
728
710
  id: "prefer-defineProps-destructure",
@@ -742,8 +724,7 @@ var prefer_defineProps_destructure_default = defineRule({
742
724
  });
743
725
  } })
744
726
  });
745
- //#endregion
746
- //#region src/plugin/rules/correctness/require-defineprops-types.ts
727
+ // src/plugin/rules/correctness/require-defineprops-types.ts
747
728
  var require_defineprops_types_default = defineRule({
748
729
  meta: {
749
730
  id: "require-defineprops-types",
@@ -763,8 +744,7 @@ var require_defineprops_types_default = defineRule({
763
744
  });
764
745
  } })
765
746
  });
766
- //#endregion
767
- //#region src/plugin/rules/correctness/require-emits-declaration.ts
747
+ // src/plugin/rules/correctness/require-emits-declaration.ts
768
748
  const EMIT_DECLARING_MACROS = /* @__PURE__ */ new Set(["defineEmits", "defineModel"]);
769
749
  const readEmitsOption = (value) => {
770
750
  if (value?.type === "ArrayExpression") {
@@ -835,8 +815,7 @@ var require_emits_declaration_default = defineRule({
835
815
  };
836
816
  }
837
817
  });
838
- //#endregion
839
- //#region src/plugin/rules/ecosystem/pinia-no-destructure.ts
818
+ // src/plugin/rules/ecosystem/pinia-no-destructure.ts
840
819
  const ACTION_NAME_PATTERN = /^(\$|(set|add|remove|delete|update|fetch|load|save|reset|clear|toggle|init|login|logout|increment|decrement|open|close|show|hide|create|submit|handle)([A-Z0-9_$]|$))/;
841
820
  /** True when the pattern has a rest element, a computed key or a key that does not look like an action. */
842
821
  const hasStateLikeBinding = (pattern) => pattern.properties.some((property) => {
@@ -869,8 +848,7 @@ var pinia_no_destructure_default = defineRule({
869
848
  } };
870
849
  }
871
850
  });
872
- //#endregion
873
- //#region src/plugin/rules/ecosystem/pinia-no-watch-store.ts
851
+ // src/plugin/rules/ecosystem/pinia-no-watch-store.ts
874
852
  const STORE_NAME_PATTERN = /^store$|[a-z0-9_$]Store$/;
875
853
  var pinia_no_watch_store_default = defineRule({
876
854
  meta: {
@@ -900,8 +878,7 @@ var pinia_no_watch_store_default = defineRule({
900
878
  } };
901
879
  }
902
880
  });
903
- //#endregion
904
- //#region src/plugin/rules/ecosystem/router-no-async-guard-without-next.ts
881
+ // src/plugin/rules/ecosystem/router-no-async-guard-without-next.ts
905
882
  const GUARD_METHODS = /* @__PURE__ */ new Set(["beforeEach", "beforeResolve"]);
906
883
  const isRouterObject$1 = (object) => object.type === "Identifier" && object.name === "router" || object.type === "MemberExpression" && object.object.type === "ThisExpression" && object.property.type === "Identifier" && object.property.name === "$router";
907
884
  /** True when `name` is called, or handed to another function (which may call it), inside `body`. */
@@ -947,8 +924,7 @@ var router_no_async_guard_without_next_default = defineRule({
947
924
  } };
948
925
  }
949
926
  });
950
- //#endregion
951
- //#region src/plugin/rules/ecosystem/router-no-string-push.ts
927
+ // src/plugin/rules/ecosystem/router-no-string-push.ts
952
928
  const MESSAGE = "Do not build a route path by string interpolation: params are not encoded and the route cannot be refactored. Pass a route object instead (e.g. `{ name: 'user', params: { id } }`).";
953
929
  const isRouterObject = (object) => {
954
930
  if (object.type === "Identifier") return object.name === "router";
@@ -987,8 +963,7 @@ var router_no_string_push_default = defineRule({
987
963
  } };
988
964
  }
989
965
  });
990
- //#endregion
991
- //#region src/plugin/secret-heuristics.ts
966
+ // src/plugin/secret-heuristics.ts
992
967
  /**
993
968
  * Name and value heuristics for "this looks like a secret" that are shared by the rules about
994
969
  * exposure (public runtime config, public env variables, committed `.env` files). They are
@@ -1178,8 +1153,7 @@ const hasCredentialsInUrl = (value) => {
1178
1153
  const match = /^[a-z][a-z\d+.-]*:\/\/([^/\s:@]+):([^/\s@]+)@/i.exec(value.trim());
1179
1154
  return match !== null && !isPlaceholderValue$1(match[2]);
1180
1155
  };
1181
- //#endregion
1182
- //#region src/plugin/rules/nuxt/no-secret-in-public-runtime-config.ts
1156
+ // src/plugin/rules/nuxt/no-secret-in-public-runtime-config.ts
1183
1157
  const NUXT_CONFIG_PATTERN$1 = /(?:^|\/)nuxt\.config\.[cm]?[jt]s$/;
1184
1158
  const APP_CONFIG_PATTERN = /(?:^|\/)app\.config\.[cm]?[jt]s$/;
1185
1159
  const getKeyName$2 = (property) => {
@@ -1254,8 +1228,7 @@ var no_secret_in_public_runtime_config_default = defineRule({
1254
1228
  };
1255
1229
  }
1256
1230
  });
1257
- //#endregion
1258
- //#region src/plugin/env-file.ts
1231
+ // src/plugin/env-file.ts
1259
1232
  const ENV_LINE_PATTERN = /^(\s*)(?:export\s+)?([A-Za-z_][A-Za-z0-9_.-]*)\s*=\s*(.*)$/;
1260
1233
  const unquote = (rawValue) => {
1261
1234
  const trimmed = rawValue.trim();
@@ -1294,8 +1267,7 @@ const isEnvTemplateFileName = (fileName) => isEnvFileName(fileName) && TEMPLATE_
1294
1267
  * machine-specific values and are git-ignored, so they are never meant to be committed.
1295
1268
  */
1296
1269
  const isLocalEnvFileName = (fileName) => isEnvFileName(fileName) && fileName.endsWith(".local");
1297
- //#endregion
1298
- //#region src/plugin/rules/nuxt/no-sensitive-public-file.ts
1270
+ // src/plugin/rules/nuxt/no-sensitive-public-file.ts
1299
1271
  const KIND_LABELS = {
1300
1272
  env: "an environment file (it usually holds credentials)",
1301
1273
  key: "a private key or certificate bundle",
@@ -1372,8 +1344,7 @@ var no_sensitive_public_file_default = defineFsRule({
1372
1344
  });
1373
1345
  }
1374
1346
  });
1375
- //#endregion
1376
- //#region src/plugin/rules/nuxt/nuxt-async-client-component.ts
1347
+ // src/plugin/rules/nuxt/nuxt-async-client-component.ts
1377
1348
  var nuxt_async_client_component_default = defineRule({
1378
1349
  meta: {
1379
1350
  id: "nuxt-async-client-component",
@@ -1399,8 +1370,7 @@ var nuxt_async_client_component_default = defineRule({
1399
1370
  }
1400
1371
  } })
1401
1372
  });
1402
- //#endregion
1403
- //#region src/plugin/rules/nuxt/nuxt-no-a-element.ts
1373
+ // src/plugin/rules/nuxt/nuxt-no-a-element.ts
1404
1374
  var nuxt_no_a_element_default = defineRule({
1405
1375
  meta: {
1406
1376
  id: "nuxt-no-a-element",
@@ -1420,8 +1390,7 @@ var nuxt_no_a_element_default = defineRule({
1420
1390
  });
1421
1391
  } })
1422
1392
  });
1423
- //#endregion
1424
- //#region src/plugin/rules/nuxt/nuxt-no-client-fetch-for-server-data.ts
1393
+ // src/plugin/rules/nuxt/nuxt-no-client-fetch-for-server-data.ts
1425
1394
  var nuxt_no_client_fetch_for_server_data_default = defineRule({
1426
1395
  meta: {
1427
1396
  id: "nuxt-no-client-fetch-for-server-data",
@@ -1453,8 +1422,7 @@ var nuxt_no_client_fetch_for_server_data_default = defineRule({
1453
1422
  }
1454
1423
  } })
1455
1424
  });
1456
- //#endregion
1457
- //#region src/plugin/rules/nuxt/nuxt-no-head-import.ts
1425
+ // src/plugin/rules/nuxt/nuxt-no-head-import.ts
1458
1426
  var nuxt_no_head_import_default = defineRule({
1459
1427
  meta: {
1460
1428
  id: "nuxt-no-head-import",
@@ -1475,8 +1443,7 @@ var nuxt_no_head_import_default = defineRule({
1475
1443
  });
1476
1444
  } })
1477
1445
  });
1478
- //#endregion
1479
- //#region src/plugin/rules/nuxt/nuxt-no-img-element.ts
1446
+ // src/plugin/rules/nuxt/nuxt-no-img-element.ts
1480
1447
  var nuxt_no_img_element_default = defineRule({
1481
1448
  meta: {
1482
1449
  id: "nuxt-no-img-element",
@@ -1496,8 +1463,7 @@ var nuxt_no_img_element_default = defineRule({
1496
1463
  });
1497
1464
  } })
1498
1465
  });
1499
- //#endregion
1500
- //#region src/plugin/rules/nuxt/nuxt-no-process-env-in-client.ts
1466
+ // src/plugin/rules/nuxt/nuxt-no-process-env-in-client.ts
1501
1467
  const NODE_ONLY_FILE_PATTERN = /(?:^|\/)server\/(?:api|routes|middleware|plugins|utils|tasks|db|services)\/|(?:^|\/)[\w.-]+\.config\.[cm]?[jt]s$|\.(?:server|test|spec)\.[cm]?[jt]sx?$/;
1502
1468
  const BUILD_TIME_ENV_NAMES = /* @__PURE__ */ new Set(["NODE_ENV"]);
1503
1469
  const getEnvName = (node) => {
@@ -1527,8 +1493,7 @@ var nuxt_no_process_env_in_client_default = defineRule({
1527
1493
  } };
1528
1494
  }
1529
1495
  });
1530
- //#endregion
1531
- //#region src/plugin/rules/nuxt/nuxt-no-window-in-ssr.ts
1496
+ // src/plugin/rules/nuxt/nuxt-no-window-in-ssr.ts
1532
1497
  const SSR_UNSAFE_GLOBALS = /* @__PURE__ */ new Set([
1533
1498
  "window",
1534
1499
  "document",
@@ -1631,8 +1596,7 @@ var nuxt_no_window_in_ssr_default = defineRule({
1631
1596
  } };
1632
1597
  }
1633
1598
  });
1634
- //#endregion
1635
- //#region src/plugin/rules/nuxt/nuxt-require-seo-meta.ts
1599
+ // src/plugin/rules/nuxt/nuxt-require-seo-meta.ts
1636
1600
  var nuxt_require_seo_meta_default = defineRule({
1637
1601
  meta: {
1638
1602
  id: "nuxt-require-seo-meta",
@@ -1656,8 +1620,7 @@ var nuxt_require_seo_meta_default = defineRule({
1656
1620
  }
1657
1621
  } })
1658
1622
  });
1659
- //#endregion
1660
- //#region src/plugin/rules/nuxt/nuxt-require-server-route-error-handling.ts
1623
+ // src/plugin/rules/nuxt/nuxt-require-server-route-error-handling.ts
1661
1624
  var nuxt_require_server_route_error_handling_default = defineRule({
1662
1625
  meta: {
1663
1626
  id: "nuxt-require-server-route-error-handling",
@@ -1687,8 +1650,7 @@ var nuxt_require_server_route_error_handling_default = defineRule({
1687
1650
  }
1688
1651
  } })
1689
1652
  });
1690
- //#endregion
1691
- //#region src/plugin/url-sinks.ts
1653
+ // src/plugin/url-sinks.ts
1692
1654
  /**
1693
1655
  * URL-sink helpers shared by `no-javascript-url` and `no-user-controlled-url`, whose script side
1694
1656
  * runs in oxlint and whose template side runs in ESLint (see custom-template-rules.ts), so both
@@ -1929,8 +1891,7 @@ const validatedUrlKeys = (node) => {
1929
1891
  };
1930
1892
  /** Key `validatedUrlKeys` records for an expression that is a plain name or member path, else null. */
1931
1893
  const urlExpressionKey = (node) => memberPath(node)?.join(".") ?? null;
1932
- //#endregion
1933
- //#region src/plugin/rules/nuxt/security-headers.ts
1894
+ // src/plugin/rules/nuxt/security-headers.ts
1934
1895
  const NUXT_CONFIG_PATTERN = /(?:^|\/)nuxt\.config\.[cm]?[jt]s$/;
1935
1896
  const getKeyName$1 = (property) => {
1936
1897
  const key = property.key;
@@ -1992,8 +1953,7 @@ var security_headers_default = defineRule({
1992
1953
  } };
1993
1954
  }
1994
1955
  });
1995
- //#endregion
1996
- //#region src/plugin/rules/performance/async-parallel.ts
1956
+ // src/plugin/rules/performance/async-parallel.ts
1997
1957
  const TEST_FILE_PATTERN$1 = /\.(test|spec|cy)\.(ts|js|vue)$/;
1998
1958
  const reportIfIndependent = (statements, context) => {
1999
1959
  const declaredNames = /* @__PURE__ */ new Set();
@@ -2044,8 +2004,7 @@ var async_parallel_default = defineRule({
2044
2004
  } };
2045
2005
  }
2046
2006
  });
2047
- //#endregion
2048
- //#region src/plugin/rules/performance/client-passive-event-listeners.ts
2007
+ // src/plugin/rules/performance/client-passive-event-listeners.ts
2049
2008
  var client_passive_event_listeners_default = defineRule({
2050
2009
  meta: {
2051
2010
  id: "client-passive-event-listeners",
@@ -2071,8 +2030,7 @@ var client_passive_event_listeners_default = defineRule({
2071
2030
  }
2072
2031
  } })
2073
2032
  });
2074
- //#endregion
2075
- //#region src/plugin/rules/performance/js-batch-dom-css.ts
2033
+ // src/plugin/rules/performance/js-batch-dom-css.ts
2076
2034
  var js_batch_dom_css_default = defineRule({
2077
2035
  meta: {
2078
2036
  id: "js-batch-dom-css",
@@ -2096,11 +2054,9 @@ var js_batch_dom_css_default = defineRule({
2096
2054
  } };
2097
2055
  }
2098
2056
  });
2099
- //#endregion
2100
- //#region src/plugin/rules/performance/helpers.ts
2057
+ // src/plugin/rules/performance/helpers.ts
2101
2058
  const isMemberProperty = (node, name) => node?.type === "MemberExpression" && node.property?.type === "Identifier" && node.property.name === name;
2102
- //#endregion
2103
- //#region src/plugin/rules/performance/js-cache-storage.ts
2059
+ // src/plugin/rules/performance/js-cache-storage.ts
2104
2060
  var js_cache_storage_default = defineRule({
2105
2061
  meta: {
2106
2062
  id: "js-cache-storage",
@@ -2132,8 +2088,7 @@ var js_cache_storage_default = defineRule({
2132
2088
  } };
2133
2089
  }
2134
2090
  });
2135
- //#endregion
2136
- //#region src/plugin/rules/performance/js-combine-iterations.ts
2091
+ // src/plugin/rules/performance/js-combine-iterations.ts
2137
2092
  var js_combine_iterations_default = defineRule({
2138
2093
  meta: {
2139
2094
  id: "js-combine-iterations",
@@ -2160,8 +2115,7 @@ var js_combine_iterations_default = defineRule({
2160
2115
  });
2161
2116
  } })
2162
2117
  });
2163
- //#endregion
2164
- //#region src/plugin/rules/performance/js-early-exit.ts
2118
+ // src/plugin/rules/performance/js-early-exit.ts
2165
2119
  const DEEP_NESTING_THRESHOLD = 3;
2166
2120
  var js_early_exit_default = defineRule({
2167
2121
  meta: {
@@ -2191,8 +2145,7 @@ var js_early_exit_default = defineRule({
2191
2145
  });
2192
2146
  } })
2193
2147
  });
2194
- //#endregion
2195
- //#region src/plugin/rules/performance/js-hoist-regexp.ts
2148
+ // src/plugin/rules/performance/js-hoist-regexp.ts
2196
2149
  var js_hoist_regexp_default = defineRule({
2197
2150
  meta: {
2198
2151
  id: "js-hoist-regexp",
@@ -2212,8 +2165,7 @@ var js_hoist_regexp_default = defineRule({
2212
2165
  });
2213
2166
  } })
2214
2167
  });
2215
- //#endregion
2216
- //#region src/plugin/rules/performance/js-index-maps.ts
2168
+ // src/plugin/rules/performance/js-index-maps.ts
2217
2169
  var js_index_maps_default = defineRule({
2218
2170
  meta: {
2219
2171
  id: "js-index-maps",
@@ -2235,8 +2187,7 @@ var js_index_maps_default = defineRule({
2235
2187
  });
2236
2188
  } })
2237
2189
  });
2238
- //#endregion
2239
- //#region src/plugin/rules/performance/js-min-max-loop.ts
2190
+ // src/plugin/rules/performance/js-min-max-loop.ts
2240
2191
  var js_min_max_loop_default = defineRule({
2241
2192
  meta: {
2242
2193
  id: "js-min-max-loop",
@@ -2264,8 +2215,7 @@ var js_min_max_loop_default = defineRule({
2264
2215
  }
2265
2216
  } })
2266
2217
  });
2267
- //#endregion
2268
- //#region src/plugin/rules/performance/js-set-map-lookups.ts
2218
+ // src/plugin/rules/performance/js-set-map-lookups.ts
2269
2219
  const ARRAY_RETURNING_METHODS = /* @__PURE__ */ new Set([
2270
2220
  "filter",
2271
2221
  "map",
@@ -2375,8 +2325,7 @@ var js_set_map_lookups_default = defineRule({
2375
2325
  };
2376
2326
  }
2377
2327
  });
2378
- //#endregion
2379
- //#region src/plugin/rules/performance/js-tosorted-immutable.ts
2328
+ // src/plugin/rules/performance/js-tosorted-immutable.ts
2380
2329
  var js_tosorted_immutable_default = defineRule({
2381
2330
  meta: {
2382
2331
  id: "js-tosorted-immutable",
@@ -2398,8 +2347,7 @@ var js_tosorted_immutable_default = defineRule({
2398
2347
  });
2399
2348
  } })
2400
2349
  });
2401
- //#endregion
2402
- //#region src/plugin/rules/performance/no-deep-watch.ts
2350
+ // src/plugin/rules/performance/no-deep-watch.ts
2403
2351
  var no_deep_watch_default = defineRule({
2404
2352
  meta: {
2405
2353
  id: "no-deep-watch",
@@ -2422,8 +2370,7 @@ var no_deep_watch_default = defineRule({
2422
2370
  });
2423
2371
  } })
2424
2372
  });
2425
- //#endregion
2426
- //#region src/plugin/rules/performance/no-global-css-variable-animation.ts
2373
+ // src/plugin/rules/performance/no-global-css-variable-animation.ts
2427
2374
  var no_global_css_variable_animation_default = defineRule({
2428
2375
  meta: {
2429
2376
  id: "no-global-css-variable-animation",
@@ -2447,8 +2394,7 @@ var no_global_css_variable_animation_default = defineRule({
2447
2394
  }
2448
2395
  } })
2449
2396
  });
2450
- //#endregion
2451
- //#region src/plugin/rules/performance/no-large-animated-blur.ts
2397
+ // src/plugin/rules/performance/no-large-animated-blur.ts
2452
2398
  var no_large_animated_blur_default = defineRule({
2453
2399
  meta: {
2454
2400
  id: "no-large-animated-blur",
@@ -2474,8 +2420,7 @@ var no_large_animated_blur_default = defineRule({
2474
2420
  }
2475
2421
  } })
2476
2422
  });
2477
- //#endregion
2478
- //#region src/plugin/rules/performance/no-layout-property-animation.ts
2423
+ // src/plugin/rules/performance/no-layout-property-animation.ts
2479
2424
  var no_layout_property_animation_default = defineRule({
2480
2425
  meta: {
2481
2426
  id: "no-layout-property-animation",
@@ -2506,8 +2451,7 @@ var no_layout_property_animation_default = defineRule({
2506
2451
  }
2507
2452
  } })
2508
2453
  });
2509
- //#endregion
2510
- //#region src/plugin/rules/performance/no-permanent-will-change.ts
2454
+ // src/plugin/rules/performance/no-permanent-will-change.ts
2511
2455
  var no_permanent_will_change_default = defineRule({
2512
2456
  meta: {
2513
2457
  id: "no-permanent-will-change",
@@ -2527,8 +2471,7 @@ var no_permanent_will_change_default = defineRule({
2527
2471
  });
2528
2472
  } })
2529
2473
  });
2530
- //#endregion
2531
- //#region src/plugin/rules/performance/no-scale-from-zero.ts
2474
+ // src/plugin/rules/performance/no-scale-from-zero.ts
2532
2475
  var no_scale_from_zero_default = defineRule({
2533
2476
  meta: {
2534
2477
  id: "no-scale-from-zero",
@@ -2552,8 +2495,7 @@ var no_scale_from_zero_default = defineRule({
2552
2495
  }
2553
2496
  } })
2554
2497
  });
2555
- //#endregion
2556
- //#region src/plugin/rules/performance/no-transition-all.ts
2498
+ // src/plugin/rules/performance/no-transition-all.ts
2557
2499
  const WHOLE_WORD_ALL = /\ball\b/;
2558
2500
  var no_transition_all_default = defineRule({
2559
2501
  meta: {
@@ -2584,8 +2526,7 @@ var no_transition_all_default = defineRule({
2584
2526
  }
2585
2527
  })
2586
2528
  });
2587
- //#endregion
2588
- //#region src/plugin/rules/reactivity/no-cascading-mutations.ts
2529
+ // src/plugin/rules/reactivity/no-cascading-mutations.ts
2589
2530
  var no_cascading_mutations_default = defineRule({
2590
2531
  meta: {
2591
2532
  id: "no-cascading-mutations",
@@ -2609,8 +2550,7 @@ var no_cascading_mutations_default = defineRule({
2609
2550
  });
2610
2551
  } })
2611
2552
  });
2612
- //#endregion
2613
- //#region src/plugin/rules/reactivity/no-fetch-in-watch.ts
2553
+ // src/plugin/rules/reactivity/no-fetch-in-watch.ts
2614
2554
  var no_fetch_in_watch_default = defineRule({
2615
2555
  meta: {
2616
2556
  id: "no-fetch-in-watch",
@@ -2633,8 +2573,7 @@ var no_fetch_in_watch_default = defineRule({
2633
2573
  });
2634
2574
  } })
2635
2575
  });
2636
- //#endregion
2637
- //#region src/plugin/rules/reactivity/no-missing-await-nextTick.ts
2576
+ // src/plugin/rules/reactivity/no-missing-await-nextTick.ts
2638
2577
  const NEXT_TICK_NAMES = /* @__PURE__ */ new Set(["nextTick", "$nextTick"]);
2639
2578
  const isNextTickCall = (node) => node?.type === "CallExpression" && (node.callee?.type === "Identifier" && node.callee.name === "nextTick" || node.callee?.type === "MemberExpression" && node.callee.property?.type === "Identifier" && NEXT_TICK_NAMES.has(node.callee.property.name));
2640
2579
  var no_missing_await_nextTick_default = defineRule({
@@ -2658,8 +2597,7 @@ var no_missing_await_nextTick_default = defineRule({
2658
2597
  });
2659
2598
  } })
2660
2599
  });
2661
- //#endregion
2662
- //#region src/plugin/rules/reactivity/no-mutation-in-computed.ts
2600
+ // src/plugin/rules/reactivity/no-mutation-in-computed.ts
2663
2601
  const MUTATING_ARRAY_METHODS = /* @__PURE__ */ new Set([
2664
2602
  "push",
2665
2603
  "pop",
@@ -2732,8 +2670,7 @@ var no_mutation_in_computed_default = defineRule({
2732
2670
  });
2733
2671
  } })
2734
2672
  });
2735
- //#endregion
2736
- //#region src/plugin/rules/reactivity/no-reactive-destructure.ts
2673
+ // src/plugin/rules/reactivity/no-reactive-destructure.ts
2737
2674
  var no_reactive_destructure_default = defineRule({
2738
2675
  meta: {
2739
2676
  id: "no-reactive-destructure",
@@ -2758,8 +2695,7 @@ var no_reactive_destructure_default = defineRule({
2758
2695
  }
2759
2696
  } })
2760
2697
  });
2761
- //#endregion
2762
- //#region src/plugin/rules/reactivity/no-reactive-replace.ts
2698
+ // src/plugin/rules/reactivity/no-reactive-replace.ts
2763
2699
  var no_reactive_replace_default = defineRule({
2764
2700
  meta: {
2765
2701
  id: "no-reactive-replace",
@@ -2781,8 +2717,7 @@ var no_reactive_replace_default = defineRule({
2781
2717
  });
2782
2718
  } })
2783
2719
  });
2784
- //#endregion
2785
- //#region src/plugin/rules/reactivity/no-ref-from-prop.ts
2720
+ // src/plugin/rules/reactivity/no-ref-from-prop.ts
2786
2721
  var no_ref_from_prop_default = defineRule({
2787
2722
  meta: {
2788
2723
  id: "no-ref-from-prop",
@@ -2808,8 +2743,7 @@ var no_ref_from_prop_default = defineRule({
2808
2743
  }
2809
2744
  } })
2810
2745
  });
2811
- //#endregion
2812
- //#region src/plugin/rules/reactivity/no-watch-for-computed.ts
2746
+ // src/plugin/rules/reactivity/no-watch-for-computed.ts
2813
2747
  var no_watch_for_computed_default = defineRule({
2814
2748
  meta: {
2815
2749
  id: "no-watch-for-computed",
@@ -2835,8 +2769,7 @@ var no_watch_for_computed_default = defineRule({
2835
2769
  });
2836
2770
  } })
2837
2771
  });
2838
- //#endregion
2839
- //#region src/plugin/rules/reactivity/prefer-computed.ts
2772
+ // src/plugin/rules/reactivity/prefer-computed.ts
2840
2773
  var prefer_computed_default = defineRule({
2841
2774
  meta: {
2842
2775
  id: "prefer-computed",
@@ -2862,8 +2795,7 @@ var prefer_computed_default = defineRule({
2862
2795
  });
2863
2796
  } })
2864
2797
  });
2865
- //#endregion
2866
- //#region src/plugin/request-input.ts
2798
+ // src/plugin/request-input.ts
2867
2799
  /**
2868
2800
  * Request-input taint for server code, shared by the injection, prototype-pollution and LLM
2869
2801
  * prompt-injection rules. A value is "request input" when it comes from an h3/Nitro reader
@@ -3021,8 +2953,7 @@ const createRequestInputTracker = () => {
3021
2953
  }
3022
2954
  };
3023
2955
  };
3024
- //#endregion
3025
- //#region src/plugin/rules/security/llm-prompt-injection.ts
2956
+ // src/plugin/rules/security/llm-prompt-injection.ts
3026
2957
  const LLM_COMPLETION_METHODS = /* @__PURE__ */ new Set([
3027
2958
  "create",
3028
2959
  "generateText",
@@ -3098,8 +3029,7 @@ var llm_prompt_injection_default = defineRule({
3098
3029
  };
3099
3030
  }
3100
3031
  });
3101
- //#endregion
3102
- //#region src/plugin/rules/security/no-committed-env.ts
3032
+ // src/plugin/rules/security/no-committed-env.ts
3103
3033
  /** Names listed in a message before it says "and N more". */
3104
3034
  const MAX_NAMES_IN_MESSAGE$1 = 3;
3105
3035
  const holdsSecret = (entry) => !isPlaceholderValue$1(entry.value) && (looksLikeSecretName(entry.name, { context: "private" }) || matchesSecretValueFormat(entry.value) || hasCredentialsInUrl(entry.value));
@@ -3154,8 +3084,7 @@ var no_committed_env_default = defineFsRule({
3154
3084
  }
3155
3085
  }
3156
3086
  });
3157
- //#endregion
3158
- //#region src/plugin/rules/security/no-dynamic-code.ts
3087
+ // src/plugin/rules/security/no-dynamic-code.ts
3159
3088
  const GLOBAL_OBJECT_NAMES$1 = /* @__PURE__ */ new Set([
3160
3089
  "window",
3161
3090
  "globalThis",
@@ -3280,8 +3209,7 @@ var no_dynamic_code_default = defineRule({
3280
3209
  };
3281
3210
  }
3282
3211
  });
3283
- //#endregion
3284
- //#region src/plugin/rules/security/no-eval.ts
3212
+ // src/plugin/rules/security/no-eval.ts
3285
3213
  const GLOBAL_OBJECT_NAMES = /* @__PURE__ */ new Set([
3286
3214
  "window",
3287
3215
  "globalThis",
@@ -3309,8 +3237,7 @@ var no_eval_default = defineRule({
3309
3237
  });
3310
3238
  } })
3311
3239
  });
3312
- //#endregion
3313
- //#region src/plugin/secrets/providers.ts
3240
+ // src/plugin/secrets/providers.ts
3314
3241
  const decodeBase64Url = (segment) => {
3315
3242
  try {
3316
3243
  const base64 = segment.replace(/-/g, "+").replace(/_/g, "/");
@@ -3437,8 +3364,7 @@ const findProviderSecret = (value) => {
3437
3364
  return { pattern };
3438
3365
  }
3439
3366
  };
3440
- //#endregion
3441
- //#region src/plugin/secrets/heuristics.ts
3367
+ // src/plugin/secrets/heuristics.ts
3442
3368
  /**
3443
3369
  * Name-based detection: a secret-looking identifier assigned a literal that looks random. Used for
3444
3370
  * credentials of providers the pattern pack does not know and for plain passwords.
@@ -3613,8 +3539,7 @@ const looksLikeSecretValue = (value, kind) => {
3613
3539
  if (characterClasses(trimmed) < 2 || !/\d/.test(trimmed)) return false;
3614
3540
  return shannonEntropy(trimmed) >= TOKEN_MIN_ENTROPY;
3615
3541
  };
3616
- //#endregion
3617
- //#region src/plugin/secrets/visitors.ts
3542
+ // src/plugin/secrets/visitors.ts
3618
3543
  const SERVER_FILE_PATTERN$1 = /(?:^|\/)server\/|\.server\.[cm]?[jt]sx?$|(?:^|\/)[\w.-]+\.config\.[cm]?[jt]s$/;
3619
3544
  const TEST_FILE_PATTERN = /\.(?:test|spec|stories)\.[cm]?[jt]sx?$|(?:^|\/)__(?:tests|mocks)__\//;
3620
3545
  const classifyFile = (filename) => {
@@ -3717,8 +3642,7 @@ const createSecretVisitors = (context, mode) => {
3717
3642
  }
3718
3643
  };
3719
3644
  };
3720
- //#endregion
3721
- //#region src/plugin/rules/security/no-hardcoded-secret.ts
3645
+ // src/plugin/rules/security/no-hardcoded-secret.ts
3722
3646
  var no_hardcoded_secret_default = defineRule({
3723
3647
  meta: {
3724
3648
  id: "no-hardcoded-secret",
@@ -3736,8 +3660,7 @@ var no_hardcoded_secret_default = defineRule({
3736
3660
  },
3737
3661
  create: (context) => createSecretVisitors(context, "provider")
3738
3662
  });
3739
- //#endregion
3740
- //#region src/plugin/rules/security/no-injection.ts
3663
+ // src/plugin/rules/security/no-injection.ts
3741
3664
  /** Methods that run a SQL string: `db.query(sql)`, `pool.execute(sql)`, `knex.raw(sql)`, `sequelize.query(sql)`. */
3742
3665
  const SQL_METHODS = /* @__PURE__ */ new Set([
3743
3666
  "query",
@@ -3890,8 +3813,7 @@ var no_injection_default = defineRule({
3890
3813
  };
3891
3814
  }
3892
3815
  });
3893
- //#endregion
3894
- //#region src/plugin/rules/security/no-javascript-url.ts
3816
+ // src/plugin/rules/security/no-javascript-url.ts
3895
3817
  /** Methods that test or compare a string: `url.startsWith("javascript:")` is a blocklist, not a URL. */
3896
3818
  const STRING_TEST_METHODS = /* @__PURE__ */ new Set([
3897
3819
  "startsWith",
@@ -3965,8 +3887,7 @@ var no_javascript_url_default = defineRule({
3965
3887
  };
3966
3888
  }
3967
3889
  });
3968
- //#endregion
3969
- //#region src/plugin/secrets/llm-providers.ts
3890
+ // src/plugin/secrets/llm-providers.ts
3970
3891
  /**
3971
3892
  * Where LLM providers are reached from: their SDK packages and API hosts. Used by
3972
3893
  * `security/no-llm-sdk-in-client` to spot code that talks to a provider straight from the browser,
@@ -4066,8 +3987,7 @@ const findLlmApiHost = (url) => {
4066
3987
  if (LLM_API_HOSTS.has(host) || LLM_API_HOST_PATTERNS.some((pattern) => pattern.test(host))) return host;
4067
3988
  return isOpenRouterApi(host, url.trim()) ? host : null;
4068
3989
  };
4069
- //#endregion
4070
- //#region src/plugin/rules/security/no-llm-sdk-in-client.ts
3990
+ // src/plugin/rules/security/no-llm-sdk-in-client.ts
4071
3991
  const REQUEST_FUNCTIONS$1 = /* @__PURE__ */ new Set([
4072
3992
  "fetch",
4073
3993
  "$fetch",
@@ -4229,8 +4149,7 @@ var no_llm_sdk_in_client_default = defineRule({
4229
4149
  };
4230
4150
  }
4231
4151
  });
4232
- //#endregion
4233
- //#region src/plugin/server-input.ts
4152
+ // src/plugin/server-input.ts
4234
4153
  /**
4235
4154
  * Untrusted-input helpers for Nuxt/h3 server handlers (`server/**`), shared by `require-input-validation`,
4236
4155
  * `no-ssrf` and `no-open-redirect`. The taint model is the one `url-sinks.ts` uses for route values,
@@ -4466,8 +4385,7 @@ const withInputTracker = (tracker, ruleVisitors) => {
4466
4385
  }
4467
4386
  return merged;
4468
4387
  };
4469
- //#endregion
4470
- //#region src/plugin/rules/security/no-open-redirect.ts
4388
+ // src/plugin/rules/security/no-open-redirect.ts
4471
4389
  const calleeName$2 = (node) => {
4472
4390
  const callee = peel$1(node.callee);
4473
4391
  if (callee.type === "Identifier") return callee.name;
@@ -4528,8 +4446,7 @@ var no_open_redirect_default = defineRule({
4528
4446
  } });
4529
4447
  }
4530
4448
  });
4531
- //#endregion
4532
- //#region src/plugin/rules/security/no-prototype-pollution.ts
4449
+ // src/plugin/rules/security/no-prototype-pollution.ts
4533
4450
  const DANGEROUS_KEYS = /* @__PURE__ */ new Set([
4534
4451
  "__proto__",
4535
4452
  "constructor",
@@ -4615,8 +4532,7 @@ var no_prototype_pollution_default = defineRule({
4615
4532
  };
4616
4533
  }
4617
4534
  });
4618
- //#endregion
4619
- //#region src/plugin/rules/security/no-secret-in-public-env-file.ts
4535
+ // src/plugin/rules/security/no-secret-in-public-env-file.ts
4620
4536
  var no_secret_in_public_env_file_default = defineFsRule({
4621
4537
  meta: {
4622
4538
  id: "no-secret-in-public-env-file",
@@ -4655,8 +4571,7 @@ var no_secret_in_public_env_file_default = defineFsRule({
4655
4571
  }
4656
4572
  }
4657
4573
  });
4658
- //#endregion
4659
- //#region src/plugin/rules/security/no-secret-in-public-env.ts
4574
+ // src/plugin/rules/security/no-secret-in-public-env.ts
4660
4575
  /** The name read by `obj.NAME` or `obj["NAME"]`. */
4661
4576
  const getPropertyName = (node) => {
4662
4577
  if (!node.computed && node.property?.type === "Identifier") return node.property.name;
@@ -4728,8 +4643,7 @@ var no_secret_in_public_env_default = defineRule({
4728
4643
  };
4729
4644
  }
4730
4645
  });
4731
- //#endregion
4732
- //#region src/plugin/rules/security/no-secret-named-literal.ts
4646
+ // src/plugin/rules/security/no-secret-named-literal.ts
4733
4647
  var no_secret_named_literal_default = defineRule({
4734
4648
  meta: {
4735
4649
  id: "no-secret-named-literal",
@@ -4747,8 +4661,7 @@ var no_secret_named_literal_default = defineRule({
4747
4661
  },
4748
4662
  create: (context) => createSecretVisitors(context, "heuristic")
4749
4663
  });
4750
- //#endregion
4751
- //#region src/plugin/rules/security/no-ssrf.ts
4664
+ // src/plugin/rules/security/no-ssrf.ts
4752
4665
  /** Request functions whose first argument is the URL (`$fetch(url)`, `ofetch(url)`, `fetch(url)`, `axios(url)`, `got(url)`...). */
4753
4666
  const REQUEST_FUNCTIONS = /* @__PURE__ */ new Set([
4754
4667
  "$fetch",
@@ -4832,8 +4745,7 @@ var no_ssrf_default = defineRule({
4832
4745
  } });
4833
4746
  }
4834
4747
  });
4835
- //#endregion
4836
- //#region src/plugin/sensitive-names.ts
4748
+ // src/plugin/sensitive-names.ts
4837
4749
  /**
4838
4750
  * Name heuristics for credentials, shared by `no-token-in-web-storage` and `postmessage-origin-check`.
4839
4751
  * Names are split into words (`accessToken`, `ACCESS_TOKEN` and `access-token` all give `access`,
@@ -4934,8 +4846,7 @@ const collect = (node, names, depth, literals) => {
4934
4846
  };
4935
4847
  /** Names inside an expression. `literals: false` ignores string values (only identifiers, properties and object keys). */
4936
4848
  const collectNames = (node, { literals = true } = {}) => collect(node, [], 0, literals);
4937
- //#endregion
4938
- //#region src/plugin/rules/security/no-token-in-web-storage.ts
4849
+ // src/plugin/rules/security/no-token-in-web-storage.ts
4939
4850
  const STORAGE_OBJECTS = /* @__PURE__ */ new Set(["localStorage", "sessionStorage"]);
4940
4851
  const GLOBAL_OBJECTS$1 = /* @__PURE__ */ new Set([
4941
4852
  "window",
@@ -5068,8 +4979,7 @@ var no_token_in_web_storage_default = defineRule({
5068
4979
  };
5069
4980
  }
5070
4981
  });
5071
- //#endregion
5072
- //#region src/plugin/rules/security/helpers.ts
4982
+ // src/plugin/rules/security/helpers.ts
5073
4983
  /**
5074
4984
  * Shared by the script rule (`no-unsafe-html-sink`, oxlint) and its template counterpart (ESLint),
5075
4985
  * so both engines agree on what counts as "known safe" HTML.
@@ -5172,8 +5082,7 @@ const isTrustedInitializer = (init, trustedNames) => {
5172
5082
  /** Property names that inject HTML when set on an element (`el.innerHTML = x`, `h("div", { innerHTML: x })`). */
5173
5083
  const HTML_INJECTION_PROPERTIES = /* @__PURE__ */ new Set(["innerHTML", "outerHTML"]);
5174
5084
  const UNSAFE_HTML_MESSAGE = "an XSS risk; sanitize it with DOMPurify, or render text with `{{ }}` / `textContent`";
5175
- //#endregion
5176
- //#region src/plugin/rules/security/no-unsafe-html-sink.ts
5085
+ // src/plugin/rules/security/no-unsafe-html-sink.ts
5177
5086
  /** Render-function factories whose props object can carry `innerHTML` (Vue 3 `h`, Vue 2 `createElement`, compiled `_c`). */
5178
5087
  const RENDER_FUNCTIONS = /* @__PURE__ */ new Set([
5179
5088
  "h",
@@ -5294,8 +5203,7 @@ var no_unsafe_html_sink_default = defineRule({
5294
5203
  };
5295
5204
  }
5296
5205
  });
5297
- //#endregion
5298
- //#region src/plugin/rules/security/no-user-controlled-url.ts
5206
+ // src/plugin/rules/security/no-user-controlled-url.ts
5299
5207
  /** Global objects whose `.open(url)` and `.location` navigate. */
5300
5208
  const GLOBAL_OBJECTS = /* @__PURE__ */ new Set([
5301
5209
  "window",
@@ -5373,8 +5281,7 @@ var no_user_controlled_url_default = defineRule({
5373
5281
  };
5374
5282
  }
5375
5283
  });
5376
- //#endregion
5377
- //#region src/plugin/rules/security/postmessage-origin-check.ts
5284
+ // src/plugin/rules/security/postmessage-origin-check.ts
5378
5285
  /** Receivers whose `message` events come from other windows (and carry `event.origin`). Workers and `BroadcastChannel` do not. */
5379
5286
  const WINDOW_OBJECTS = /* @__PURE__ */ new Set([
5380
5287
  "window",
@@ -5512,8 +5419,7 @@ var postmessage_origin_check_default = defineRule({
5512
5419
  };
5513
5420
  }
5514
5421
  });
5515
- //#endregion
5516
- //#region src/plugin/rules/server/auth-missing.ts
5422
+ // src/plugin/rules/server/auth-missing.ts
5517
5423
  const ADMIN_ROUTE_PATTERN = /(?:^|\/)server\/api\/admin\//i;
5518
5424
  const MUTATING_HANDLER_PATTERN$1 = /(?:^|\/)server\/api\/.*\.(?:post|put|patch|delete)\.[cm]?[jt]s$/i;
5519
5425
  const AUTH_CHECK_PATTERN = /auth|session|user|token|login|jwt|guard|permission|role/i;
@@ -5562,8 +5468,7 @@ var auth_missing_default = defineRule({
5562
5468
  };
5563
5469
  }
5564
5470
  });
5565
- //#endregion
5566
- //#region src/plugin/rules/server/csrf-on-mutating-routes.ts
5471
+ // src/plugin/rules/server/csrf-on-mutating-routes.ts
5567
5472
  const MUTATING_HANDLER_PATTERN = /(?:^|\/)server\/api\/.*\.(?:post|put|patch|delete)\.[cm]?[jt]s$/i;
5568
5473
  const CSRF_CHECK_PATTERN = /csrf|origin|referer|verifytoken|protect/i;
5569
5474
  var csrf_on_mutating_routes_default = defineRule({
@@ -5612,8 +5517,7 @@ var csrf_on_mutating_routes_default = defineRule({
5612
5517
  };
5613
5518
  }
5614
5519
  });
5615
- //#endregion
5616
- //#region src/plugin/rules/server/require-input-validation.ts
5520
+ // src/plugin/rules/server/require-input-validation.ts
5617
5521
  /** Names of calls that validate or coerce their argument: `schema.parse(x)`, `v.safeParse(Schema, x)`, `assertValid(x)`, `isEmail(x)`... */
5618
5522
  const VALIDATOR_PATTERN = /valid|parse|assert|schema|sanitiz|verify|check|decode|^is[A-Z0-9_]|^cast$|^coerce$/;
5619
5523
  /** Coercions that reject anything but the expected type (`Number(getRouterParam(...))` then compared with `Number.isNaN`). */
@@ -5767,8 +5671,7 @@ var require_input_validation_default = defineRule({
5767
5671
  };
5768
5672
  }
5769
5673
  });
5770
- //#endregion
5771
- //#region src/plugin/rules/server/secure-cookie-flags.ts
5674
+ // src/plugin/rules/server/secure-cookie-flags.ts
5772
5675
  const SENSITIVE_COOKIE_NAME = /session|token|auth|jwt|sid|login|credential|access/i;
5773
5676
  const isSensitiveCookieName = (node) => {
5774
5677
  if (!node) return false;
@@ -5836,8 +5739,7 @@ var secure_cookie_flags_default = defineRule({
5836
5739
  } };
5837
5740
  }
5838
5741
  });
5839
- //#endregion
5840
- //#region src/plugin/rules/server/server-no-console-in-handler.ts
5742
+ // src/plugin/rules/server/server-no-console-in-handler.ts
5841
5743
  var server_no_console_in_handler_default = defineRule({
5842
5744
  meta: {
5843
5745
  id: "server-no-console-in-handler",
@@ -5865,8 +5767,7 @@ var server_no_console_in_handler_default = defineRule({
5865
5767
  } };
5866
5768
  }
5867
5769
  });
5868
- //#endregion
5869
- //#region src/plugin/supply-chain/lockfile.ts
5770
+ // src/plugin/supply-chain/lockfile.ts
5870
5771
  /** Lockfile file names and the package manager that writes them. */
5871
5772
  const LOCKFILE_MANAGERS = {
5872
5773
  "package-lock.json": "npm",
@@ -6030,8 +5931,7 @@ const classifyDependencySpec = (spec) => {
6030
5931
  if (!(/^(?:git\+[a-z]+:\/\/|git:\/\/|git@|github:|gitlab:|bitbucket:|gist:)/i.test(value) || /^[\w.-]+\/[\w.-]+(?:#.*)?$/.test(value))) return null;
6031
5932
  return isPinnedToCommit(value) ? null : "git";
6032
5933
  };
6033
- //#endregion
6034
- //#region src/plugin/supply-chain/project.ts
5934
+ // src/plugin/supply-chain/project.ts
6035
5935
  /** Furthest ancestor directory searched for a monorepo root that holds the lockfile. */
6036
5936
  const MAX_ANCESTOR_DEPTH = 6;
6037
5937
  const DEPENDENCY_SECTIONS = [
@@ -6132,8 +6032,7 @@ const readLockfiles = (context, location) => {
6132
6032
  }
6133
6033
  return parsed;
6134
6034
  };
6135
- //#endregion
6136
- //#region src/plugin/rules/supply-chain/lockfile-integrity.ts
6035
+ // src/plugin/rules/supply-chain/lockfile-integrity.ts
6137
6036
  /** Packages named in a message before it says "and N more". */
6138
6037
  const MAX_NAMES_IN_MESSAGE = 3;
6139
6038
  const listNames = (names) => {
@@ -6196,8 +6095,7 @@ var lockfile_integrity_default = defineFsRule({
6196
6095
  }
6197
6096
  }
6198
6097
  });
6199
- //#endregion
6200
- //#region src/plugin/rules/supply-chain/no-dependency-install-scripts.ts
6098
+ // src/plugin/rules/supply-chain/no-dependency-install-scripts.ts
6201
6099
  /**
6202
6100
  * Decision: only direct dependencies are reported (the ones the team chose and can review); the
6203
6101
  * information comes from the lockfile (`hasInstallScript` in npm lockfiles v2/v3, `requiresBuild`
@@ -6232,15 +6130,13 @@ var no_dependency_install_scripts_default = defineFsRule({
6232
6130
  });
6233
6131
  }
6234
6132
  });
6235
- //#endregion
6236
- //#region src/plugin/rules/supply-chain/no-remote-dependency-spec.ts
6133
+ // src/plugin/rules/supply-chain/no-remote-dependency-spec.ts
6237
6134
  const DESCRIPTIONS = {
6238
6135
  git: "a git repository without a pinned commit — whatever the branch or tag points at on install day is what you get",
6239
6136
  http: "a plain http:// URL — the download is not encrypted and can be replaced in transit",
6240
6137
  tarball: "a tarball URL — it bypasses the registry and its integrity and provenance checks"
6241
6138
  };
6242
- //#endregion
6243
- //#region src/plugin/rules/index.ts
6139
+ // src/plugin/rules/index.ts
6244
6140
  const ruleModules = [
6245
6141
  no_giant_component_default,
6246
6142
  no_nested_component_definition_default,
@@ -6367,8 +6263,7 @@ const ruleModules = [
6367
6263
  agentGuidance: "Upgrade the named package to the fixed version in the message using the project's package manager (npm/pnpm/yarn/bun update or install name@version), and regenerate the lockfile through the package manager, never by editing it by hand. For a transitive dependency, upgrade the direct dependency that pulls it in, or add an `overrides`/`resolutions` entry only when no newer parent exists. Run the tests afterwards. If no fixed version exists, say so instead of silencing the finding."
6368
6264
  } })
6369
6265
  ];
6370
- //#endregion
6371
- //#region src/plugin/custom-template-rules.ts
6266
+ // src/plugin/custom-template-rules.ts
6372
6267
  /**
6373
6268
  * Template-side implementations of Vue Doctor's own rules, run by the ESLint template analyzer
6374
6269
  * (see utils/run-eslint-vue.ts) next to eslint-plugin-vue. A rule here shares its registry entry,
@@ -6465,8 +6360,7 @@ const CUSTOM_TEMPLATE_RULES = {
6465
6360
  if (boundUrlExpressions(attribute).some((expression) => isUserControlledUrl(expression))) report(`URL attribute bound to a user-controlled value — ${USER_CONTROLLED_URL_MESSAGE}`);
6466
6361
  })
6467
6362
  };
6468
- //#endregion
6469
- //#region src/plugin/template-rules.ts
6363
+ // src/plugin/template-rules.ts
6470
6364
  /**
6471
6365
  * Metadata for the eslint-plugin-vue template rules Vue Doctor runs. They have no `create`: the
6472
6366
  * implementations live in eslint-plugin-vue, and the registry only needs their metadata to build
@@ -6634,8 +6528,7 @@ const TEMPLATE_RULES = [
6634
6528
  agentGuidance: "Add `rel=\"noopener noreferrer\"` to every link with `target=\"_blank\"`."
6635
6529
  })
6636
6530
  ];
6637
- //#endregion
6638
- //#region src/plugin/registry.ts
6531
+ // src/plugin/registry.ts
6639
6532
  /**
6640
6533
  * Plugin name oxlint knows the custom rules by. Oxlint sees the flat rule name (`vue-doctor/<rule>`);
6641
6534
  * everything user-facing uses the canonical ID (`vue-doctor/<category>/<rule>`, see `getCanonicalRuleId`).
@@ -6731,8 +6624,7 @@ const createCustomTemplateRuleConfig = (framework = "vite") => {
6731
6624
  }
6732
6625
  return rules;
6733
6626
  };
6734
- //#endregion
6735
- //#region src/plugin/rule-ids.ts
6627
+ // src/plugin/rule-ids.ts
6736
6628
  /**
6737
6629
  * Rule ID resolution. The canonical IDs are `vue-doctor/<category>/<rule>` (own rules),
6738
6630
  * `vue/<rule>` (eslint-plugin-vue template rules) and `knip/<type>` (dead code). The 1.x spellings
@@ -6848,8 +6740,7 @@ check: (key, source) => {
6848
6740
  }
6849
6741
  } };
6850
6742
  };
6851
- //#endregion
6852
- //#region src/core/baseline.ts
6743
+ // src/core/baseline.ts
6853
6744
  const DEFAULT_BASELINE_FILENAME = ".vue-doctor-baseline.json";
6854
6745
  const BASELINE_VERSION = 1;
6855
6746
  /** Thrown for a missing or malformed baseline file. The CLI maps it to exit code 2. */
@@ -6915,5 +6806,4 @@ const applyBaseline = (diagnostics, baselineFingerprints, baselinePath, isDiffMo
6915
6806
  }
6916
6807
  };
6917
6808
  };
6918
- //#endregion
6919
6809
  export { CUSTOM_TEMPLATE_RULES as S, getCanonicalRuleId as _, readBaseline as a, toDiagnosticRule as b, resolveRuleKey as c, PLUGIN_NAME as d, RULE_REGISTRY as f, createTemplateRuleConfig as g, createOxlintConfig as h, createBaseline as i, ruleIdOf as l, createCustomTemplateRuleConfig as m, DEFAULT_BASELINE_FILENAME as n, writeBaseline as o, categorySlug as p, applyBaseline as r, createRuleIdReporter as s, BaselineError as t, AUDIT_RULES as u, getEnabledFsRules as v, CUSTOM_TEMPLATE_PLUGIN_NAME as x, getRuleMeta as y };