eslint-plugin-react-dom 1.16.0-beta.0 → 1.16.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import { match, P } from 'ts-pattern';
7
7
 
8
8
  // package.json
9
9
  var name = "eslint-plugin-react-dom";
10
- var version = "1.16.0-beta.0";
10
+ var version = "1.16.0-beta.2";
11
11
  var createRule = createRuleForPlugin("dom");
12
12
 
13
13
  // src/rules/no-children-in-void-dom-elements.ts
@@ -382,7 +382,1053 @@ var no_script_url_default = createRule({
382
382
  },
383
383
  defaultOptions: []
384
384
  });
385
- var RULE_NAME10 = "no-unsafe-iframe-sandbox";
385
+
386
+ // src/rules/no-unknown-property.ts
387
+ var RULE_NAME10 = "no-unknown-property";
388
+ var DEFAULTS = {
389
+ ignore: [],
390
+ requireDataLowercase: false
391
+ };
392
+ var DOM_ATTRIBUTE_NAMES = {
393
+ "accept-charset": "acceptCharset",
394
+ class: "className",
395
+ crossorigin: "crossOrigin",
396
+ for: "htmlFor",
397
+ "http-equiv": "httpEquiv",
398
+ nomodule: "noModule"
399
+ };
400
+ var ATTRIBUTE_TAGS_MAP = {
401
+ as: ["link"],
402
+ abbr: ["th", "td"],
403
+ align: [
404
+ "applet",
405
+ "caption",
406
+ "col",
407
+ "colgroup",
408
+ "hr",
409
+ "iframe",
410
+ "img",
411
+ "table",
412
+ "tbody",
413
+ "td",
414
+ "tfoot",
415
+ "th",
416
+ "thead",
417
+ "tr"
418
+ ],
419
+ // deprecated, but known
420
+ allowFullScreen: ["iframe", "video"],
421
+ autoPictureInPicture: ["video"],
422
+ charset: ["meta"],
423
+ checked: ["input"],
424
+ controls: ["audio", "video"],
425
+ controlsList: ["audio", "video"],
426
+ // image is required for SVG support, all other tags are HTML.
427
+ crossOrigin: ["script", "img", "video", "audio", "link", "image"],
428
+ disablePictureInPicture: ["video"],
429
+ disableRemotePlayback: ["audio", "video"],
430
+ displaystyle: ["math"],
431
+ // https://html.spec.whatwg.org/multipage/links.html#downloading-resources
432
+ download: ["a", "area"],
433
+ fill: [
434
+ // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill
435
+ // Fill color
436
+ "altGlyph",
437
+ "circle",
438
+ "ellipse",
439
+ "g",
440
+ "line",
441
+ "marker",
442
+ "mask",
443
+ "path",
444
+ "polygon",
445
+ "polyline",
446
+ "rect",
447
+ "svg",
448
+ "symbol",
449
+ "text",
450
+ "textPath",
451
+ "tref",
452
+ "tspan",
453
+ "use",
454
+ // Animation final state
455
+ "animate",
456
+ "animateColor",
457
+ "animateMotion",
458
+ "animateTransform",
459
+ "set"
460
+ ],
461
+ focusable: ["svg"],
462
+ imageSizes: ["link"],
463
+ imageSrcSet: ["link"],
464
+ loop: ["audio", "video"],
465
+ mozAllowFullScreen: ["iframe", "video"],
466
+ muted: ["audio", "video"],
467
+ noModule: ["script"],
468
+ // Media events allowed only on audio and video tags, see https://github.com/facebook/react/blob/256aefbea1449869620fb26f6ec695536ab453f5/CHANGELOG.md#notable-enhancements
469
+ onAbort: ["audio", "video"],
470
+ onCanPlay: ["audio", "video"],
471
+ onCanPlayThrough: ["audio", "video"],
472
+ onCancel: ["dialog"],
473
+ onClose: ["dialog"],
474
+ onDurationChange: ["audio", "video"],
475
+ onEmptied: ["audio", "video"],
476
+ onEncrypted: ["audio", "video"],
477
+ onEnded: ["audio", "video"],
478
+ onError: ["audio", "video", "img", "link", "source", "script", "picture", "iframe"],
479
+ onLoad: ["script", "img", "link", "picture", "iframe", "object", "source"],
480
+ onLoadStart: ["audio", "video"],
481
+ onLoadedData: ["audio", "video"],
482
+ onLoadedMetadata: ["audio", "video"],
483
+ onPause: ["audio", "video"],
484
+ onPlay: ["audio", "video"],
485
+ onPlaying: ["audio", "video"],
486
+ onProgress: ["audio", "video"],
487
+ onRateChange: ["audio", "video"],
488
+ onResize: ["audio", "video"],
489
+ onSeeked: ["audio", "video"],
490
+ onSeeking: ["audio", "video"],
491
+ onStalled: ["audio", "video"],
492
+ onSuspend: ["audio", "video"],
493
+ onTimeUpdate: ["audio", "video"],
494
+ onVolumeChange: ["audio", "video"],
495
+ onWaiting: ["audio", "video"],
496
+ playsInline: ["video"],
497
+ poster: ["video"],
498
+ preload: ["audio", "video"],
499
+ property: ["meta"],
500
+ returnValue: ["dialog"],
501
+ scrolling: ["iframe"],
502
+ valign: ["tr", "td", "th", "thead", "tbody", "tfoot", "colgroup", "col"],
503
+ // deprecated, but known
504
+ viewBox: ["marker", "pattern", "svg", "symbol", "view"],
505
+ webkitAllowFullScreen: ["iframe", "video"],
506
+ webkitDirectory: ["input"]
507
+ };
508
+ var SVGDOM_ATTRIBUTE_NAMES = {
509
+ "accent-height": "accentHeight",
510
+ "alignment-baseline": "alignmentBaseline",
511
+ "arabic-form": "arabicForm",
512
+ "baseline-shift": "baselineShift",
513
+ "cap-height": "capHeight",
514
+ "clip-path": "clipPath",
515
+ "clip-rule": "clipRule",
516
+ "color-interpolation": "colorInterpolation",
517
+ "color-interpolation-filters": "colorInterpolationFilters",
518
+ "color-profile": "colorProfile",
519
+ "color-rendering": "colorRendering",
520
+ "dominant-baseline": "dominantBaseline",
521
+ "enable-background": "enableBackground",
522
+ "fill-opacity": "fillOpacity",
523
+ "fill-rule": "fillRule",
524
+ "flood-color": "floodColor",
525
+ "flood-opacity": "floodOpacity",
526
+ "font-family": "fontFamily",
527
+ "font-size": "fontSize",
528
+ "font-size-adjust": "fontSizeAdjust",
529
+ "font-stretch": "fontStretch",
530
+ "font-style": "fontStyle",
531
+ "font-variant": "fontVariant",
532
+ "font-weight": "fontWeight",
533
+ "glyph-name": "glyphName",
534
+ "glyph-orientation-horizontal": "glyphOrientationHorizontal",
535
+ "glyph-orientation-vertical": "glyphOrientationVertical",
536
+ "horiz-adv-x": "horizAdvX",
537
+ "horiz-origin-x": "horizOriginX",
538
+ "image-rendering": "imageRendering",
539
+ "letter-spacing": "letterSpacing",
540
+ "lighting-color": "lightingColor",
541
+ "marker-end": "markerEnd",
542
+ "marker-mid": "markerMid",
543
+ "marker-start": "markerStart",
544
+ "overline-position": "overlinePosition",
545
+ "overline-thickness": "overlineThickness",
546
+ "paint-order": "paintOrder",
547
+ "panose-1": "panose1",
548
+ "pointer-events": "pointerEvents",
549
+ "rendering-intent": "renderingIntent",
550
+ "shape-rendering": "shapeRendering",
551
+ "stop-color": "stopColor",
552
+ "stop-opacity": "stopOpacity",
553
+ "strikethrough-position": "strikethroughPosition",
554
+ "strikethrough-thickness": "strikethroughThickness",
555
+ "stroke-dasharray": "strokeDasharray",
556
+ "stroke-dashoffset": "strokeDashoffset",
557
+ "stroke-linecap": "strokeLinecap",
558
+ "stroke-linejoin": "strokeLinejoin",
559
+ "stroke-miterlimit": "strokeMiterlimit",
560
+ "stroke-opacity": "strokeOpacity",
561
+ "stroke-width": "strokeWidth",
562
+ "text-anchor": "textAnchor",
563
+ "text-decoration": "textDecoration",
564
+ "text-rendering": "textRendering",
565
+ "underline-position": "underlinePosition",
566
+ "underline-thickness": "underlineThickness",
567
+ "unicode-bidi": "unicodeBidi",
568
+ "unicode-range": "unicodeRange",
569
+ "units-per-em": "unitsPerEm",
570
+ "v-alphabetic": "vAlphabetic",
571
+ "v-hanging": "vHanging",
572
+ "v-ideographic": "vIdeographic",
573
+ "v-mathematical": "vMathematical",
574
+ "vector-effect": "vectorEffect",
575
+ "vert-adv-y": "vertAdvY",
576
+ "vert-origin-x": "vertOriginX",
577
+ "vert-origin-y": "vertOriginY",
578
+ "word-spacing": "wordSpacing",
579
+ "writing-mode": "writingMode",
580
+ "x-height": "xHeight",
581
+ "xlink:actuate": "xlinkActuate",
582
+ "xlink:arcrole": "xlinkArcrole",
583
+ "xlink:href": "xlinkHref",
584
+ "xlink:role": "xlinkRole",
585
+ "xlink:show": "xlinkShow",
586
+ "xlink:title": "xlinkTitle",
587
+ "xlink:type": "xlinkType",
588
+ "xml:base": "xmlBase",
589
+ "xml:lang": "xmlLang",
590
+ "xml:space": "xmlSpace"
591
+ };
592
+ var DOM_PROPERTY_NAMES_ONE_WORD = [
593
+ // Global attributes - can be used on any HTML/DOM element
594
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
595
+ "dir",
596
+ "draggable",
597
+ "hidden",
598
+ "id",
599
+ "lang",
600
+ "nonce",
601
+ "part",
602
+ "slot",
603
+ "style",
604
+ "title",
605
+ "translate",
606
+ "inert",
607
+ // Element specific attributes
608
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
609
+ // To be considered if these should be added also to ATTRIBUTE_TAGS_MAP
610
+ "accept",
611
+ "action",
612
+ "allow",
613
+ "alt",
614
+ "as",
615
+ "async",
616
+ "buffered",
617
+ "capture",
618
+ "challenge",
619
+ "cite",
620
+ "code",
621
+ "cols",
622
+ "content",
623
+ "coords",
624
+ "csp",
625
+ "data",
626
+ "decoding",
627
+ "default",
628
+ "defer",
629
+ "disabled",
630
+ "form",
631
+ "headers",
632
+ "height",
633
+ "high",
634
+ "href",
635
+ "icon",
636
+ "importance",
637
+ "integrity",
638
+ "kind",
639
+ "label",
640
+ "language",
641
+ "loading",
642
+ "list",
643
+ "loop",
644
+ "low",
645
+ "manifest",
646
+ "max",
647
+ "media",
648
+ "method",
649
+ "min",
650
+ "multiple",
651
+ "muted",
652
+ "name",
653
+ "open",
654
+ "optimum",
655
+ "pattern",
656
+ "ping",
657
+ "placeholder",
658
+ "poster",
659
+ "preload",
660
+ "profile",
661
+ "rel",
662
+ "required",
663
+ "reversed",
664
+ "role",
665
+ "rows",
666
+ "sandbox",
667
+ "scope",
668
+ "seamless",
669
+ "selected",
670
+ "shape",
671
+ "size",
672
+ "sizes",
673
+ "span",
674
+ "src",
675
+ "start",
676
+ "step",
677
+ "summary",
678
+ "target",
679
+ "type",
680
+ "value",
681
+ "width",
682
+ "wmode",
683
+ "wrap",
684
+ // SVG attributes
685
+ // See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
686
+ "accumulate",
687
+ "additive",
688
+ "alphabetic",
689
+ "amplitude",
690
+ "ascent",
691
+ "azimuth",
692
+ "bbox",
693
+ "begin",
694
+ "bias",
695
+ "by",
696
+ "clip",
697
+ "color",
698
+ "cursor",
699
+ "cx",
700
+ "cy",
701
+ "d",
702
+ "decelerate",
703
+ "descent",
704
+ "direction",
705
+ "display",
706
+ "divisor",
707
+ "dur",
708
+ "dx",
709
+ "dy",
710
+ "elevation",
711
+ "end",
712
+ "exponent",
713
+ "fill",
714
+ "filter",
715
+ "format",
716
+ "from",
717
+ "fr",
718
+ "fx",
719
+ "fy",
720
+ "g1",
721
+ "g2",
722
+ "hanging",
723
+ "height",
724
+ "hreflang",
725
+ "ideographic",
726
+ "in",
727
+ "in2",
728
+ "intercept",
729
+ "k",
730
+ "k1",
731
+ "k2",
732
+ "k3",
733
+ "k4",
734
+ "kerning",
735
+ "local",
736
+ "mask",
737
+ "mode",
738
+ "offset",
739
+ "opacity",
740
+ "operator",
741
+ "order",
742
+ "orient",
743
+ "orientation",
744
+ "origin",
745
+ "overflow",
746
+ "path",
747
+ "ping",
748
+ "points",
749
+ "r",
750
+ "radius",
751
+ "rel",
752
+ "restart",
753
+ "result",
754
+ "rotate",
755
+ "rx",
756
+ "ry",
757
+ "scale",
758
+ "seed",
759
+ "slope",
760
+ "spacing",
761
+ "speed",
762
+ "stemh",
763
+ "stemv",
764
+ "string",
765
+ "stroke",
766
+ "to",
767
+ "transform",
768
+ "u1",
769
+ "u2",
770
+ "unicode",
771
+ "values",
772
+ "version",
773
+ "visibility",
774
+ "widths",
775
+ "x",
776
+ "x1",
777
+ "x2",
778
+ "xmlns",
779
+ "y",
780
+ "y1",
781
+ "y2",
782
+ "z",
783
+ // OpenGraph meta tag attributes
784
+ "property",
785
+ // React specific attributes
786
+ "ref",
787
+ "key",
788
+ "children",
789
+ // Non-standard
790
+ "results",
791
+ "security",
792
+ // Video specific
793
+ "controls",
794
+ // popovers
795
+ "popover",
796
+ "popovertarget",
797
+ "popovertargetaction"
798
+ ];
799
+ var DOM_PROPERTY_NAMES_TWO_WORDS = [
800
+ // Global attributes - can be used on any HTML/DOM element
801
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
802
+ "accessKey",
803
+ "autoCapitalize",
804
+ "autoFocus",
805
+ "contentEditable",
806
+ "enterKeyHint",
807
+ "exportParts",
808
+ "inputMode",
809
+ "itemID",
810
+ "itemRef",
811
+ "itemProp",
812
+ "itemScope",
813
+ "itemType",
814
+ "spellCheck",
815
+ "tabIndex",
816
+ // Element specific attributes
817
+ // See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes (includes global attributes too)
818
+ // To be considered if these should be added also to ATTRIBUTE_TAGS_MAP
819
+ "acceptCharset",
820
+ "autoComplete",
821
+ "autoPlay",
822
+ "border",
823
+ "cellPadding",
824
+ "cellSpacing",
825
+ "classID",
826
+ "codeBase",
827
+ "colSpan",
828
+ "contextMenu",
829
+ "dateTime",
830
+ "encType",
831
+ "formAction",
832
+ "formEncType",
833
+ "formMethod",
834
+ "formNoValidate",
835
+ "formTarget",
836
+ "frameBorder",
837
+ "hrefLang",
838
+ "httpEquiv",
839
+ "imageSizes",
840
+ "imageSrcSet",
841
+ "isMap",
842
+ "keyParams",
843
+ "keyType",
844
+ "marginHeight",
845
+ "marginWidth",
846
+ "maxLength",
847
+ "mediaGroup",
848
+ "minLength",
849
+ "noValidate",
850
+ "onAnimationEnd",
851
+ "onAnimationIteration",
852
+ "onAnimationStart",
853
+ "onBlur",
854
+ "onChange",
855
+ "onClick",
856
+ "onContextMenu",
857
+ "onCopy",
858
+ "onCompositionEnd",
859
+ "onCompositionStart",
860
+ "onCompositionUpdate",
861
+ "onCut",
862
+ "onDoubleClick",
863
+ "onDrag",
864
+ "onDragEnd",
865
+ "onDragEnter",
866
+ "onDragExit",
867
+ "onDragLeave",
868
+ "onError",
869
+ "onFocus",
870
+ "onInput",
871
+ "onKeyDown",
872
+ "onKeyPress",
873
+ "onKeyUp",
874
+ "onLoad",
875
+ "onWheel",
876
+ "onDragOver",
877
+ "onDragStart",
878
+ "onDrop",
879
+ "onMouseDown",
880
+ "onMouseEnter",
881
+ "onMouseLeave",
882
+ "onMouseMove",
883
+ "onMouseOut",
884
+ "onMouseOver",
885
+ "onMouseUp",
886
+ "onPaste",
887
+ "onScroll",
888
+ "onSelect",
889
+ "onSubmit",
890
+ "onToggle",
891
+ "onTransitionEnd",
892
+ "radioGroup",
893
+ "readOnly",
894
+ "referrerPolicy",
895
+ "rowSpan",
896
+ "srcDoc",
897
+ "srcLang",
898
+ "srcSet",
899
+ "useMap",
900
+ "fetchPriority",
901
+ // SVG attributes
902
+ // See https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
903
+ "crossOrigin",
904
+ "accentHeight",
905
+ "alignmentBaseline",
906
+ "arabicForm",
907
+ "attributeName",
908
+ "attributeType",
909
+ "baseFrequency",
910
+ "baselineShift",
911
+ "baseProfile",
912
+ "calcMode",
913
+ "capHeight",
914
+ "clipPathUnits",
915
+ "clipPath",
916
+ "clipRule",
917
+ "colorInterpolation",
918
+ "colorInterpolationFilters",
919
+ "colorProfile",
920
+ "colorRendering",
921
+ "contentScriptType",
922
+ "contentStyleType",
923
+ "diffuseConstant",
924
+ "dominantBaseline",
925
+ "edgeMode",
926
+ "enableBackground",
927
+ "fillOpacity",
928
+ "fillRule",
929
+ "filterRes",
930
+ "filterUnits",
931
+ "floodColor",
932
+ "floodOpacity",
933
+ "fontFamily",
934
+ "fontSize",
935
+ "fontSizeAdjust",
936
+ "fontStretch",
937
+ "fontStyle",
938
+ "fontVariant",
939
+ "fontWeight",
940
+ "glyphName",
941
+ "glyphOrientationHorizontal",
942
+ "glyphOrientationVertical",
943
+ "glyphRef",
944
+ "gradientTransform",
945
+ "gradientUnits",
946
+ "horizAdvX",
947
+ "horizOriginX",
948
+ "imageRendering",
949
+ "kernelMatrix",
950
+ "kernelUnitLength",
951
+ "keyPoints",
952
+ "keySplines",
953
+ "keyTimes",
954
+ "lengthAdjust",
955
+ "letterSpacing",
956
+ "lightingColor",
957
+ "limitingConeAngle",
958
+ "markerEnd",
959
+ "markerMid",
960
+ "markerStart",
961
+ "markerHeight",
962
+ "markerUnits",
963
+ "markerWidth",
964
+ "maskContentUnits",
965
+ "maskUnits",
966
+ "mathematical",
967
+ "numOctaves",
968
+ "overlinePosition",
969
+ "overlineThickness",
970
+ "panose1",
971
+ "paintOrder",
972
+ "pathLength",
973
+ "patternContentUnits",
974
+ "patternTransform",
975
+ "patternUnits",
976
+ "pointerEvents",
977
+ "pointsAtX",
978
+ "pointsAtY",
979
+ "pointsAtZ",
980
+ "preserveAlpha",
981
+ "preserveAspectRatio",
982
+ "primitiveUnits",
983
+ "referrerPolicy",
984
+ "refX",
985
+ "refY",
986
+ "rendering-intent",
987
+ "repeatCount",
988
+ "repeatDur",
989
+ "requiredExtensions",
990
+ "requiredFeatures",
991
+ "shapeRendering",
992
+ "specularConstant",
993
+ "specularExponent",
994
+ "spreadMethod",
995
+ "startOffset",
996
+ "stdDeviation",
997
+ "stitchTiles",
998
+ "stopColor",
999
+ "stopOpacity",
1000
+ "strikethroughPosition",
1001
+ "strikethroughThickness",
1002
+ "strokeDasharray",
1003
+ "strokeDashoffset",
1004
+ "strokeLinecap",
1005
+ "strokeLinejoin",
1006
+ "strokeMiterlimit",
1007
+ "strokeOpacity",
1008
+ "strokeWidth",
1009
+ "surfaceScale",
1010
+ "systemLanguage",
1011
+ "tableValues",
1012
+ "targetX",
1013
+ "targetY",
1014
+ "textAnchor",
1015
+ "textDecoration",
1016
+ "textRendering",
1017
+ "textLength",
1018
+ "transformOrigin",
1019
+ "underlinePosition",
1020
+ "underlineThickness",
1021
+ "unicodeBidi",
1022
+ "unicodeRange",
1023
+ "unitsPerEm",
1024
+ "vAlphabetic",
1025
+ "vHanging",
1026
+ "vIdeographic",
1027
+ "vMathematical",
1028
+ "vectorEffect",
1029
+ "vertAdvY",
1030
+ "vertOriginX",
1031
+ "vertOriginY",
1032
+ "viewBox",
1033
+ "viewTarget",
1034
+ "wordSpacing",
1035
+ "writingMode",
1036
+ "xHeight",
1037
+ "xChannelSelector",
1038
+ "xlinkActuate",
1039
+ "xlinkArcrole",
1040
+ "xlinkHref",
1041
+ "xlinkRole",
1042
+ "xlinkShow",
1043
+ "xlinkTitle",
1044
+ "xlinkType",
1045
+ "xmlBase",
1046
+ "xmlLang",
1047
+ "xmlnsXlink",
1048
+ "xmlSpace",
1049
+ "yChannelSelector",
1050
+ "zoomAndPan",
1051
+ // Safari/Apple specific, no listing available
1052
+ "autoCorrect",
1053
+ // https://stackoverflow.com/questions/47985384/html-autocorrect-for-text-input-is-not-working
1054
+ "autoSave",
1055
+ // https://stackoverflow.com/questions/25456396/what-is-autosave-attribute-supposed-to-do-how-do-i-use-it
1056
+ // React specific attributes https://reactjs.org/docs/dom-elements.html#differences-in-attributes
1057
+ "className",
1058
+ "dangerouslySetInnerHTML",
1059
+ "defaultValue",
1060
+ "defaultChecked",
1061
+ "htmlFor",
1062
+ // Events' capture events
1063
+ "onBeforeInput",
1064
+ "onChange",
1065
+ "onInvalid",
1066
+ "onReset",
1067
+ "onTouchCancel",
1068
+ "onTouchEnd",
1069
+ "onTouchMove",
1070
+ "onTouchStart",
1071
+ "suppressContentEditableWarning",
1072
+ "suppressHydrationWarning",
1073
+ "onAbort",
1074
+ "onCanPlay",
1075
+ "onCanPlayThrough",
1076
+ "onDurationChange",
1077
+ "onEmptied",
1078
+ "onEncrypted",
1079
+ "onEnded",
1080
+ "onLoadedData",
1081
+ "onLoadedMetadata",
1082
+ "onLoadStart",
1083
+ "onPause",
1084
+ "onPlay",
1085
+ "onPlaying",
1086
+ "onProgress",
1087
+ "onRateChange",
1088
+ "onResize",
1089
+ "onSeeked",
1090
+ "onSeeking",
1091
+ "onStalled",
1092
+ "onSuspend",
1093
+ "onTimeUpdate",
1094
+ "onVolumeChange",
1095
+ "onWaiting",
1096
+ "onCopyCapture",
1097
+ "onCutCapture",
1098
+ "onPasteCapture",
1099
+ "onCompositionEndCapture",
1100
+ "onCompositionStartCapture",
1101
+ "onCompositionUpdateCapture",
1102
+ "onFocusCapture",
1103
+ "onBlurCapture",
1104
+ "onChangeCapture",
1105
+ "onBeforeInputCapture",
1106
+ "onInputCapture",
1107
+ "onResetCapture",
1108
+ "onSubmitCapture",
1109
+ "onInvalidCapture",
1110
+ "onLoadCapture",
1111
+ "onErrorCapture",
1112
+ "onKeyDownCapture",
1113
+ "onKeyPressCapture",
1114
+ "onKeyUpCapture",
1115
+ "onAbortCapture",
1116
+ "onCanPlayCapture",
1117
+ "onCanPlayThroughCapture",
1118
+ "onDurationChangeCapture",
1119
+ "onEmptiedCapture",
1120
+ "onEncryptedCapture",
1121
+ "onEndedCapture",
1122
+ "onLoadedDataCapture",
1123
+ "onLoadedMetadataCapture",
1124
+ "onLoadStartCapture",
1125
+ "onPauseCapture",
1126
+ "onPlayCapture",
1127
+ "onPlayingCapture",
1128
+ "onProgressCapture",
1129
+ "onRateChangeCapture",
1130
+ "onSeekedCapture",
1131
+ "onSeekingCapture",
1132
+ "onStalledCapture",
1133
+ "onSuspendCapture",
1134
+ "onTimeUpdateCapture",
1135
+ "onVolumeChangeCapture",
1136
+ "onWaitingCapture",
1137
+ "onSelectCapture",
1138
+ "onTouchCancelCapture",
1139
+ "onTouchEndCapture",
1140
+ "onTouchMoveCapture",
1141
+ "onTouchStartCapture",
1142
+ "onScrollCapture",
1143
+ "onWheelCapture",
1144
+ "onAnimationEndCapture",
1145
+ "onAnimationIteration",
1146
+ "onAnimationStartCapture",
1147
+ "onTransitionEndCapture",
1148
+ "onAuxClick",
1149
+ "onAuxClickCapture",
1150
+ "onClickCapture",
1151
+ "onContextMenuCapture",
1152
+ "onDoubleClickCapture",
1153
+ "onDragCapture",
1154
+ "onDragEndCapture",
1155
+ "onDragEnterCapture",
1156
+ "onDragExitCapture",
1157
+ "onDragLeaveCapture",
1158
+ "onDragOverCapture",
1159
+ "onDragStartCapture",
1160
+ "onDropCapture",
1161
+ "onMouseDown",
1162
+ "onMouseDownCapture",
1163
+ "onMouseMoveCapture",
1164
+ "onMouseOutCapture",
1165
+ "onMouseOverCapture",
1166
+ "onMouseUpCapture",
1167
+ // Video specific
1168
+ "autoPictureInPicture",
1169
+ "controlsList",
1170
+ "disablePictureInPicture",
1171
+ "disableRemotePlayback"
1172
+ ];
1173
+ var DOM_PROPERTIES_IGNORE_CASE = [
1174
+ "charset",
1175
+ "allowFullScreen",
1176
+ "webkitAllowFullScreen",
1177
+ "mozAllowFullScreen",
1178
+ "webkitDirectory"
1179
+ ];
1180
+ var ARIA_PROPERTIES = [
1181
+ // See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes
1182
+ // Global attributes
1183
+ "aria-atomic",
1184
+ "aria-braillelabel",
1185
+ "aria-brailleroledescription",
1186
+ "aria-busy",
1187
+ "aria-controls",
1188
+ "aria-current",
1189
+ "aria-describedby",
1190
+ "aria-description",
1191
+ "aria-details",
1192
+ "aria-disabled",
1193
+ "aria-dropeffect",
1194
+ "aria-errormessage",
1195
+ "aria-flowto",
1196
+ "aria-grabbed",
1197
+ "aria-haspopup",
1198
+ "aria-hidden",
1199
+ "aria-invalid",
1200
+ "aria-keyshortcuts",
1201
+ "aria-label",
1202
+ "aria-labelledby",
1203
+ "aria-live",
1204
+ "aria-owns",
1205
+ "aria-relevant",
1206
+ "aria-roledescription",
1207
+ // Widget attributes
1208
+ "aria-autocomplete",
1209
+ "aria-checked",
1210
+ "aria-expanded",
1211
+ "aria-level",
1212
+ "aria-modal",
1213
+ "aria-multiline",
1214
+ "aria-multiselectable",
1215
+ "aria-orientation",
1216
+ "aria-placeholder",
1217
+ "aria-pressed",
1218
+ "aria-readonly",
1219
+ "aria-required",
1220
+ "aria-selected",
1221
+ "aria-sort",
1222
+ "aria-valuemax",
1223
+ "aria-valuemin",
1224
+ "aria-valuenow",
1225
+ "aria-valuetext",
1226
+ // Relationship attributes
1227
+ "aria-activedescendant",
1228
+ "aria-colcount",
1229
+ "aria-colindex",
1230
+ "aria-colindextext",
1231
+ "aria-colspan",
1232
+ "aria-posinset",
1233
+ "aria-rowcount",
1234
+ "aria-rowindex",
1235
+ "aria-rowindextext",
1236
+ "aria-rowspan",
1237
+ "aria-setsize"
1238
+ ];
1239
+ var REACT_ON_PROPS = [
1240
+ "onGotPointerCapture",
1241
+ "onGotPointerCaptureCapture",
1242
+ "onLostPointerCapture",
1243
+ "onLostPointerCapture",
1244
+ "onLostPointerCaptureCapture",
1245
+ "onPointerCancel",
1246
+ "onPointerCancelCapture",
1247
+ "onPointerDown",
1248
+ "onPointerDownCapture",
1249
+ "onPointerEnter",
1250
+ "onPointerEnterCapture",
1251
+ "onPointerLeave",
1252
+ "onPointerLeaveCapture",
1253
+ "onPointerMove",
1254
+ "onPointerMoveCapture",
1255
+ "onPointerOut",
1256
+ "onPointerOutCapture",
1257
+ "onPointerOver",
1258
+ "onPointerOverCapture",
1259
+ "onPointerUp",
1260
+ "onPointerUpCapture"
1261
+ ];
1262
+ function getDOMPropertyNames(context) {
1263
+ const ALL_DOM_PROPERTY_NAMES = DOM_PROPERTY_NAMES_TWO_WORDS.concat(DOM_PROPERTY_NAMES_ONE_WORD);
1264
+ {
1265
+ return ALL_DOM_PROPERTY_NAMES.concat(REACT_ON_PROPS);
1266
+ }
1267
+ }
1268
+ function isValidHTMLTagInJSX(childNode) {
1269
+ const tagConvention = /^[a-z][^-]*$/;
1270
+ if (tagConvention.test(childNode.parent.name.name)) {
1271
+ return !childNode.parent.attributes.some(
1272
+ (attrNode) => attrNode.type === "JSXAttribute" && attrNode.name.type === "JSXIdentifier" && attrNode.name.name === "is"
1273
+ // To learn more about custom web components and `is` attribute,
1274
+ // see https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-customized-builtin-example
1275
+ );
1276
+ }
1277
+ return false;
1278
+ }
1279
+ function normalizeAttributeCase(name2) {
1280
+ return DOM_PROPERTIES_IGNORE_CASE.find((element) => element.toLowerCase() === name2.toLowerCase()) || name2;
1281
+ }
1282
+ function isValidDataAttribute(name2) {
1283
+ return !/^data-xml/i.test(name2) && /^data-[^:]*$/.test(name2);
1284
+ }
1285
+ function hasUpperCaseCharacter(name2) {
1286
+ return name2.toLowerCase() !== name2;
1287
+ }
1288
+ function isValidAriaAttribute(name2) {
1289
+ return ARIA_PROPERTIES.some((element) => element === name2);
1290
+ }
1291
+ function getTagName(node) {
1292
+ if (node?.parent?.name) {
1293
+ return node.parent.name.name;
1294
+ }
1295
+ return null;
1296
+ }
1297
+ function tagNameHasDot(node) {
1298
+ return !!(node.parent?.name && node.parent.name.type === "JSXMemberExpression");
1299
+ }
1300
+ function getStandardName(name2, context) {
1301
+ if (has(DOM_ATTRIBUTE_NAMES, name2)) {
1302
+ return DOM_ATTRIBUTE_NAMES[name2];
1303
+ }
1304
+ if (has(SVGDOM_ATTRIBUTE_NAMES, name2)) {
1305
+ return SVGDOM_ATTRIBUTE_NAMES[name2];
1306
+ }
1307
+ const names = getDOMPropertyNames();
1308
+ return names.find((element) => element.toLowerCase() === name2.toLowerCase());
1309
+ }
1310
+ var messages = {
1311
+ dataLowercaseRequired: "React does not recognize data-* props with uppercase characters on a DOM element. Found '{{name}}', use '{{lowerCaseName}}' instead",
1312
+ invalidPropOnTag: "Invalid property '{{name}}' found on tag '{{tagName}}', but it is only allowed on: {{allowedTags}}",
1313
+ unknownProp: "Unknown property '{{name}}' found",
1314
+ unknownPropWithStandardName: "Unknown property '{{name}}' found, use '{{standardName}}' instead"
1315
+ };
1316
+ var no_unknown_property_default = createRule({
1317
+ meta: {
1318
+ docs: {
1319
+ description: "disallow usage of unknown DOM property"
1320
+ },
1321
+ fixable: "code",
1322
+ messages,
1323
+ schema: [{
1324
+ type: "object",
1325
+ additionalProperties: false,
1326
+ properties: {
1327
+ ignore: {
1328
+ type: "array",
1329
+ items: {
1330
+ type: "string"
1331
+ }
1332
+ },
1333
+ requireDataLowercase: {
1334
+ type: "boolean",
1335
+ default: false
1336
+ }
1337
+ }
1338
+ }]
1339
+ },
1340
+ name: RULE_NAME10,
1341
+ create(context) {
1342
+ function getIgnoreConfig() {
1343
+ return context.options[0]?.ignore || DEFAULTS.ignore;
1344
+ }
1345
+ function getRequireDataLowercase() {
1346
+ return context.options[0] && typeof context.options[0].requireDataLowercase !== "undefined" ? !!context.options[0].requireDataLowercase : DEFAULTS.requireDataLowercase;
1347
+ }
1348
+ return {
1349
+ JSXAttribute(node) {
1350
+ const ignoreNames = getIgnoreConfig();
1351
+ const actualName = getText(context, node.name);
1352
+ if (ignoreNames.indexOf(actualName) >= 0) {
1353
+ return;
1354
+ }
1355
+ const name2 = normalizeAttributeCase(actualName);
1356
+ if (tagNameHasDot(node)) {
1357
+ return;
1358
+ }
1359
+ if (isValidDataAttribute(name2)) {
1360
+ if (getRequireDataLowercase() && hasUpperCaseCharacter(name2)) {
1361
+ report(context, messages.dataLowercaseRequired, "dataLowercaseRequired", {
1362
+ node,
1363
+ data: {
1364
+ name: actualName,
1365
+ lowerCaseName: actualName.toLowerCase()
1366
+ }
1367
+ });
1368
+ }
1369
+ return;
1370
+ }
1371
+ if (isValidAriaAttribute(name2)) return;
1372
+ const tagName = getTagName(node);
1373
+ if (tagName === "fbt" || tagName === "fbs") return;
1374
+ if (!isValidHTMLTagInJSX(node)) return;
1375
+ const allowedTags = has(ATTRIBUTE_TAGS_MAP, name2) ? ATTRIBUTE_TAGS_MAP[name2] : null;
1376
+ if (tagName && allowedTags) {
1377
+ if (allowedTags.indexOf(tagName) === -1) {
1378
+ report(context, messages.invalidPropOnTag, "invalidPropOnTag", {
1379
+ node,
1380
+ data: {
1381
+ name: actualName,
1382
+ allowedTags: allowedTags.join(", "),
1383
+ tagName
1384
+ }
1385
+ });
1386
+ }
1387
+ return;
1388
+ }
1389
+ const standardName = getStandardName(name2);
1390
+ const hasStandardNameButIsNotUsed = standardName && standardName !== name2;
1391
+ const usesStandardName = standardName && standardName === name2;
1392
+ if (usesStandardName) {
1393
+ return;
1394
+ }
1395
+ if (hasStandardNameButIsNotUsed) {
1396
+ report(context, messages.unknownPropWithStandardName, "unknownPropWithStandardName", {
1397
+ node,
1398
+ data: {
1399
+ name: actualName,
1400
+ standardName
1401
+ },
1402
+ fix(fixer) {
1403
+ return fixer.replaceText(node.name, standardName);
1404
+ }
1405
+ });
1406
+ return;
1407
+ }
1408
+ report(context, messages.unknownProp, "unknownProp", {
1409
+ node,
1410
+ data: {
1411
+ name: actualName
1412
+ }
1413
+ });
1414
+ }
1415
+ };
1416
+ },
1417
+ defaultOptions: []
1418
+ });
1419
+ function has(obj, key) {
1420
+ return Object.hasOwn(obj, key);
1421
+ }
1422
+ function getText(context, node) {
1423
+ return context.sourceCode.getText(node);
1424
+ }
1425
+ function report(context, message, messageId, data) {
1426
+ context.report({
1427
+ messageId,
1428
+ ...data
1429
+ });
1430
+ }
1431
+ var RULE_NAME11 = "no-unsafe-iframe-sandbox";
386
1432
  var unsafeCombinations = [
387
1433
  ["allow-scripts", "allow-same-origin"]
388
1434
  // ...
@@ -398,7 +1444,7 @@ var no_unsafe_iframe_sandbox_default = createRule({
398
1444
  },
399
1445
  schema: []
400
1446
  },
401
- name: RULE_NAME10,
1447
+ name: RULE_NAME11,
402
1448
  create(context) {
403
1449
  const { components, polymorphicPropName } = normalizeSettings(decodeSettings(context.settings));
404
1450
  return {
@@ -431,7 +1477,7 @@ var no_unsafe_iframe_sandbox_default = createRule({
431
1477
  },
432
1478
  defaultOptions: []
433
1479
  });
434
- var RULE_NAME11 = "no-unsafe-target-blank";
1480
+ var RULE_NAME12 = "no-unsafe-target-blank";
435
1481
  function isExternalLinkLike(value) {
436
1482
  return value.startsWith("https://") || /^(?:\w+:|\/\/)/u.test(value);
437
1483
  }
@@ -449,7 +1495,7 @@ var no_unsafe_target_blank_default = createRule({
449
1495
  },
450
1496
  schema: []
451
1497
  },
452
- name: RULE_NAME11,
1498
+ name: RULE_NAME12,
453
1499
  create(context) {
454
1500
  const settings = normalizeSettings(decodeSettings(context.settings));
455
1501
  const polymorphicPropName = settings.polymorphicPropName;
@@ -548,6 +1594,7 @@ var src_default = {
548
1594
  "no-namespace": no_namespace_default,
549
1595
  "no-render-return-value": no_render_return_value_default,
550
1596
  "no-script-url": no_script_url_default,
1597
+ "no-unknown-property": no_unknown_property_default,
551
1598
  "no-unsafe-iframe-sandbox": no_unsafe_iframe_sandbox_default,
552
1599
  "no-unsafe-target-blank": no_unsafe_target_blank_default
553
1600
  },