From 4125dd85f9c8b9eb5fd2142a04cdfe98e76a5a23 Mon Sep 17 00:00:00 2001 From: XantreGodlike Date: Sun, 7 Jan 2024 12:18:03 +0100 Subject: [PATCH] use phf for hash maps and sets --- .../src/rules/react/no_unknown_property.rs | 401 +++++++++--------- .../src/snapshots/no_unknown_property.snap | 30 +- 2 files changed, 213 insertions(+), 218 deletions(-) diff --git a/crates/oxc_linter/src/rules/react/no_unknown_property.rs b/crates/oxc_linter/src/rules/react/no_unknown_property.rs index 9ff10b8f69e97..6e7d0fc237ac2 100644 --- a/crates/oxc_linter/src/rules/react/no_unknown_property.rs +++ b/crates/oxc_linter/src/rules/react/no_unknown_property.rs @@ -1,3 +1,4 @@ +use itertools::Itertools; use lazy_static::lazy_static; use once_cell::sync::Lazy; use oxc_ast::{ @@ -10,10 +11,10 @@ use oxc_diagnostics::{ }; use oxc_macros::declare_oxc_lint; use oxc_span::{GetSpan, Span}; +use phf::{phf_map, phf_set, Map, Set}; use regex::Regex; use serde::Deserialize; use std::collections::hash_map::HashMap; -use std::collections::hash_set::HashSet; use crate::{ context::LintContext, @@ -71,107 +72,102 @@ declare_oxc_lint!( ); lazy_static! { - static ref ATTRIBUTE_TAGS_MAP: HashMap<&'static str, Vec<&'static str>> = HashMap::from([ - ("abbr", vec!["th", "td"]), - ("charset", vec!["meta"]), - ("checked", vec!["input"]), + static ref ATTRIBUTE_TAGS_MAP: Map<&'static str, Set<&'static str>> = phf_map! { + "abbr" => phf_set! {"th", "td"}, + "charset" => phf_set! {"meta"}, + "checked" => phf_set! {"input"}, // image is required for SVG support, all other tags are HTML. - ("crossOrigin", vec!["script", "img", "video", "audio", "link", "image"]), - ("displaystyle", vec!["math"]), + "crossOrigin" => phf_set! {"script", "img", "video", "audio", "link", "image"}, + "displaystyle" => phf_set! {"math"}, // https://html.spec.whatwg.org/multipage/links.html#downloading-resources - ("download", vec!["a", "area"]), - ( - "fill", - vec![ - // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill - // Fill color - "altGlyph", - "circle", - "ellipse", - "g", - "line", - "marker", - "mask", - "path", - "polygon", - "polyline", - "rect", - "svg", - "symbol", - "text", - "textPath", - "tref", - "tspan", - "use", - // Animation final state - "animate", - "animateColor", - "animateMotion", - "animateTransform", - "set", - ], - ), - ("focusable", vec!["svg"]), - ("imageSizes", vec!["link"]), - ("imageSrcSet", vec!["link"]), - ("property", vec!["meta"]), - ("viewBox", vec!["marker", "pattern", "svg", "symbol", "view"]), - ("as", vec!["link"]), - ( - "align", - vec![ - "applet", "caption", "col", "colgroup", "hr", "iframe", "img", "table", "tbody", "td", - "tfoot", "th", "thead", "tr", - ], - ), // deprecated, but known - ("valign", vec!["tr", "td", "th", "thead", "tbody", "tfoot", "colgroup", "col"]), // deprecated, but known - ("noModule", vec!["script"]), + "download" => phf_set! {"a", "area"}, + "fill" => phf_set! { + // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill + // Fill color + "altGlyph", + "circle", + "ellipse", + "g", + "line", + "marker", + "mask", + "path", + "polygon", + "polyline", + "rect", + "svg", + "symbol", + "text", + "textPath", + "tref", + "tspan", + "use", + // Animation final state + "animate", + "animateColor", + "animateMotion", + "animateTransform", + "set", + }, + "focusable" => phf_set! {"svg"}, + "imageSizes" => phf_set! {"link"}, + "imageSrcSet" => phf_set! {"link"}, + "property" => phf_set! {"meta"}, + "viewBox" => phf_set! {"marker", "pattern", "svg", "symbol", "view"}, + "as" => phf_set! {"link"}, + "align" => phf_set! { + "applet", "caption", "col", "colgroup", "hr", "iframe", "img", "table", "tbody", "td", + "tfoot", "th", "thead", "tr", + }, + // deprecated, but known + "valign" => phf_set! {"tr", "td", "th", "thead", "tbody", "tfoot", "colgroup", "col"}, // deprecated, but kno, + "noModule" => phf_set! {"script"}, // Media events allowed only on audio and video tags, see https://github.com/facebook/react/blob/256aefbea1449869620fb26f6ec695536ab453f5/CHANGELOG.md#notable-enhancements - ("onAbort", vec!["audio", "video"]), - ("onCancel", vec!["dialog"]), - ("onCanPlay", vec!["audio", "video"]), - ("onCanPlayThrough", vec!["audio", "video"]), - ("onClose", vec!["dialog"]), - ("onDurationChange", vec!["audio", "video"]), - ("onEmptied", vec!["audio", "video"]), - ("onEncrypted", vec!["audio", "video"]), - ("onEnded", vec!["audio", "video"]), - ("onError", vec!["audio", "video", "img", "link", "source", "script", "picture", "iframe"]), - ("onLoad", vec!["script", "img", "link", "picture", "iframe", "object", "source"]), - ("onLoadedData", vec!["audio", "video"]), - ("onLoadedMetadata", vec!["audio", "video"]), - ("onLoadStart", vec!["audio", "video"]), - ("onPause", vec!["audio", "video"]), - ("onPlay", vec!["audio", "video"]), - ("onPlaying", vec!["audio", "video"]), - ("onProgress", vec!["audio", "video"]), - ("onRateChange", vec!["audio", "video"]), - ("onResize", vec!["audio", "video"]), - ("onSeeked", vec!["audio", "video"]), - ("onSeeking", vec!["audio", "video"]), - ("onStalled", vec!["audio", "video"]), - ("onSuspend", vec!["audio", "video"]), - ("onTimeUpdate", vec!["audio", "video"]), - ("onVolumeChange", vec!["audio", "video"]), - ("onWaiting", vec!["audio", "video"]), - ("autoPictureInPicture", vec!["video"]), - ("controls", vec!["audio", "video"]), - ("controlsList", vec!["audio", "video"]), - ("disablePictureInPicture", vec!["video"]), - ("disableRemotePlayback", vec!["audio", "video"]), - ("loop", vec!["audio", "video"]), - ("muted", vec!["audio", "video"]), - ("playsInline", vec!["video"]), - ("allowFullScreen", vec!["iframe", "video"]), - ("webkitAllowFullScreen", vec!["iframe", "video"]), - ("mozAllowFullScreen", vec!["iframe", "video"]), - ("poster", vec!["video"]), - ("preload", vec!["audio", "video"]), - ("scrolling", vec!["iframe"]), - ("returnValue", vec!["dialog"]), - ("webkitDirectory", vec!["input"]), - ]); - static ref DOM_PROPERTIES_NAMES: HashSet<&'static str> = [ + "onAbort" => phf_set! {"audio", "video"}, + "onCancel" => phf_set! {"dialog"}, + "onCanPlay" => phf_set! {"audio", "video"}, + "onCanPlayThrough" => phf_set! {"audio", "video"}, + "onClose" => phf_set! {"dialog"}, + "onDurationChange" => phf_set! {"audio", "video"}, + "onEmptied" => phf_set! {"audio", "video"}, + "onEncrypted" => phf_set! {"audio", "video"}, + "onEnded" => phf_set! {"audio", "video"}, + "onError" => phf_set! {"audio", "video", "img", "link", "source", "script", "picture", "iframe"}, + "onLoad" => phf_set! {"script", "img", "link", "picture", "iframe", "object", "source"}, + "onLoadedData" => phf_set! {"audio", "video"}, + "onLoadedMetadata" => phf_set! {"audio", "video"}, + "onLoadStart" => phf_set! {"audio", "video"}, + "onPause" => phf_set! {"audio", "video"}, + "onPlay" => phf_set! {"audio", "video"}, + "onPlaying" => phf_set! {"audio", "video"}, + "onProgress" => phf_set! {"audio", "video"}, + "onRateChange" => phf_set! {"audio", "video"}, + "onResize" => phf_set! {"audio", "video"}, + "onSeeked" => phf_set! {"audio", "video"}, + "onSeeking" => phf_set! {"audio", "video"}, + "onStalled" => phf_set! {"audio", "video"}, + "onSuspend" => phf_set! {"audio", "video"}, + "onTimeUpdate" => phf_set! {"audio", "video"}, + "onVolumeChange" => phf_set! {"audio", "video"}, + "onWaiting" => phf_set! {"audio", "video"}, + "autoPictureInPicture" => phf_set! {"video"}, + "controls" => phf_set! {"audio", "video"}, + "controlsList" => phf_set! {"audio", "video"}, + "disablePictureInPicture" => phf_set! {"video"}, + "disableRemotePlayback" => phf_set! {"audio", "video"}, + "loop" => phf_set! {"audio", "video"}, + "muted" => phf_set! {"audio", "video"}, + "playsInline" => phf_set! {"video"}, + "allowFullScreen" => phf_set! {"iframe", "video"}, + "webkitAllowFullScreen" => phf_set! {"iframe", "video"}, + "mozAllowFullScreen" => phf_set! {"iframe", "video"}, + "poster" => phf_set! {"video"}, + "preload" => phf_set! {"audio", "video"}, + "scrolling" => phf_set! {"iframe"}, + "returnValue" => phf_set! {"dialog"}, + "webkitDirectory" => phf_set! {"input"}, + }; + static ref DOM_PROPERTIES_NAMES: Set<&'static str> = phf_set! { // Global attributes - can be used on any HTML/DOM element // See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes "dir", "draggable", "hidden", "id", "lang", "nonce", "part", "slot", "style", "title", "translate", "inert", @@ -190,10 +186,10 @@ lazy_static! { "accumulate", "additive", "alphabetic", "amplitude", "ascent", "azimuth", "bbox", "begin", "bias", "by", "clip", "color", "cursor", "cx", "cy", "d", "decelerate", "descent", "direction", "display", "divisor", "dur", "dx", "dy", "elevation", "end", "exponent", "fill", "filter", - "format", "from", "fr", "fx", "fy", "g1", "g2", "hanging", "height", "hreflang", "ideographic", + "format", "from", "fr", "fx", "fy", "g1", "g2", "hanging", "hreflang", "ideographic", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "local", "mask", "mode", "offset", "opacity", "operator", "order", "orient", "orientation", "origin", "overflow", "path", - "ping", "points", "r", "radius", "rel", "restart", "result", "rotate", "rx", "ry", "scale", + "points", "r", "radius", "restart", "result", "rotate", "rx", "ry", "scale", "seed", "slope", "spacing", "speed", "stemh", "stemv", "string", "stroke", "to", "transform", "u1", "u2", "unicode", "values", "version", "visibility", "widths", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", @@ -241,7 +237,7 @@ lazy_static! { "overlinePosition", "overlineThickness", "panose1", "paintOrder", "pathLength", "patternContentUnits", "patternTransform", "patternUnits", "pointerEvents", "pointsAtX", "pointsAtY", "pointsAtZ", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", - "referrerPolicy", "refX", "refY", "rendering-intent", "repeatCount", "repeatDur", + "refX", "refY", "rendering-intent", "repeatCount", "repeatDur", "requiredExtensions", "requiredFeatures", "shapeRendering", "specularConstant", "specularExponent", "spreadMethod", "startOffset", "stdDeviation", "stitchTiles", "stopColor", "stopOpacity", "strikethroughPosition", "strikethroughThickness", "strokeDasharray", @@ -260,7 +256,7 @@ lazy_static! { // React specific attributes https://reactjs.org/docs/dom-elements.html#differences-in-attributes "className", "dangerouslySetInnerHTML", "defaultValue", "defaultChecked", "htmlFor", // Events" capture events - "onBeforeInput", "onChange", + "onBeforeInput", "onInvalid", "onReset", "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart", "suppressContentEditableWarning", "suppressHydrationWarning", "onAbort", "onCanPlay", "onCanPlayThrough", "onDurationChange", "onEmptied", "onEncrypted", "onEnded", "onLoadedData", "onLoadedMetadata", "onLoadStart", "onPause", "onPlay", "onPlaying", "onProgress", "onRateChange", "onResize", @@ -272,11 +268,11 @@ lazy_static! { "onEndedCapture", "onLoadedDataCapture", "onLoadedMetadataCapture", "onLoadStartCapture", "onPauseCapture", "onPlayCapture", "onPlayingCapture", "onProgressCapture", "onRateChangeCapture", "onSeekedCapture", "onSeekingCapture", "onStalledCapture", "onSuspendCapture", "onTimeUpdateCapture", "onVolumeChangeCapture", "onWaitingCapture", "onSelectCapture", "onTouchCancelCapture", "onTouchEndCapture", - "onTouchMoveCapture", "onTouchStartCapture", "onScrollCapture", "onWheelCapture", "onAnimationEndCapture", "onAnimationIteration", + "onTouchMoveCapture", "onTouchStartCapture", "onScrollCapture", "onWheelCapture", "onAnimationEndCapture", "onAnimationStartCapture", "onTransitionEndCapture", "onAuxClick", "onAuxClickCapture", "onClickCapture", "onContextMenuCapture", "onDoubleClickCapture", "onDragCapture", "onDragEndCapture", "onDragEnterCapture", "onDragExitCapture", "onDragLeaveCapture", - "onDragOverCapture", "onDragStartCapture", "onDropCapture", "onMouseDown", "onMouseDownCapture", + "onDragOverCapture", "onDragStartCapture", "onDropCapture", "onMouseDownCapture", "onMouseMoveCapture", "onMouseOutCapture", "onMouseOverCapture", "onMouseUpCapture", // Video specific "autoPictureInPicture", "controlsList", "disablePictureInPicture", "disableRemotePlayback", @@ -284,7 +280,6 @@ lazy_static! { // React on props "onGotPointerCaptureCapture", "onLostPointerCapture", - "onLostPointerCapture", "onLostPointerCaptureCapture", "onPointerCancel", "onPointerCancelCapture", @@ -302,10 +297,10 @@ lazy_static! { "onPointerOverCapture", "onPointerUp", "onPointerUpCapture", - ].into(); + }; static ref DOM_PROPERTIES_LOWER_MAP: HashMap = DOM_PROPERTIES_NAMES.iter().map(|it| (it.to_lowercase(), *it)).collect::>(); - static ref ARIA_PROPERTIES: HashSet<&'static str> = HashSet::from([ + static ref ARIA_PROPERTIES: Set<&'static str> = phf_set! { // See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes // Global attributes "aria-atomic", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-controls", "aria-current", @@ -320,107 +315,107 @@ lazy_static! { // Relationship attributes "aria-activedescendant", "aria-colcount", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-posinset", "aria-rowcount", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-setsize", - ]); + }; - static ref DOM_PROPERTIES_IGNORE_CASE: Box<[&'static str]> = Box::new([ + static ref DOM_PROPERTIES_IGNORE_CASE: [&'static str; 5] = [ "charset", "allowFullScreen", "webkitAllowFullScreen", "mozAllowFullScreen", "webkitDirectory", - ]); + ]; - static ref DOM_ATTRIBUTES_TO_CAMEL: HashMap<&'static str, &'static str> = HashMap::from([ - ("accept-charset", "acceptCharset"), - ("class", "className"), - ("http-equiv", "httpEquiv"), - ("crossorigin", "crossOrigin"), - ("for", "htmlFor"), - ("nomodule", "noModule"), + static ref DOM_ATTRIBUTES_TO_CAMEL: Map<&'static str, &'static str> = phf_map! { + "accept-charset" => "acceptCharset", + "class" => "className", + "http-equiv" => "httpEquiv", + "crossorigin" => "crossOrigin", + "for" => "htmlFor", + "nomodule" => "noModule", // svg - ("accent-height", "accentHeight"), - ("alignment-baseline", "alignmentBaseline"), - ("arabic-form", "arabicForm"), - ("baseline-shift", "baselineShift"), - ("cap-height", "capHeight"), - ("clip-path", "clipPath"), - ("clip-rule", "clipRule"), - ("color-interpolation", "colorInterpolation"), - ("color-interpolation-filters", "colorInterpolationFilters"), - ("color-profile", "colorProfile"), - ("color-rendering", "colorRendering"), - ("dominant-baseline", "dominantBaseline"), - ("enable-background", "enableBackground"), - ("fill-opacity", "fillOpacity"), - ("fill-rule", "fillRule"), - ("flood-color", "floodColor"), - ("flood-opacity", "floodOpacity"), - ("font-family", "fontFamily"), - ("font-size", "fontSize"), - ("font-size-adjust", "fontSizeAdjust"), - ("font-stretch", "fontStretch"), - ("font-style", "fontStyle"), - ("font-variant", "fontVariant"), - ("font-weight", "fontWeight"), - ("glyph-name", "glyphName"), - ("glyph-orientation-horizontal", "glyphOrientationHorizontal"), - ("glyph-orientation-vertical", "glyphOrientationVertical"), - ("horiz-adv-x", "horizAdvX"), - ("horiz-origin-x", "horizOriginX"), - ("image-rendering", "imageRendering"), - ("letter-spacing", "letterSpacing"), - ("lighting-color", "lightingColor"), - ("marker-end", "markerEnd"), - ("marker-mid", "markerMid"), - ("marker-start", "markerStart"), - ("overline-position", "overlinePosition"), - ("overline-thickness", "overlineThickness"), - ("paint-order", "paintOrder"), - ("panose-1", "panose1"), - ("pointer-events", "pointerEvents"), - ("rendering-intent", "renderingIntent"), - ("shape-rendering", "shapeRendering"), - ("stop-color", "stopColor"), - ("stop-opacity", "stopOpacity"), - ("strikethrough-position", "strikethroughPosition"), - ("strikethrough-thickness", "strikethroughThickness"), - ("stroke-dasharray", "strokeDasharray"), - ("stroke-dashoffset", "strokeDashoffset"), - ("stroke-linecap", "strokeLinecap"), - ("stroke-linejoin", "strokeLinejoin"), - ("stroke-miterlimit", "strokeMiterlimit"), - ("stroke-opacity", "strokeOpacity"), - ("stroke-width", "strokeWidth"), - ("text-anchor", "textAnchor"), - ("text-decoration", "textDecoration"), - ("text-rendering", "textRendering"), - ("underline-position", "underlinePosition"), - ("underline-thickness", "underlineThickness"), - ("unicode-bidi", "unicodeBidi"), - ("unicode-range", "unicodeRange"), - ("units-per-em", "unitsPerEm"), - ("v-alphabetic", "vAlphabetic"), - ("v-hanging", "vHanging"), - ("v-ideographic", "vIdeographic"), - ("v-mathematical", "vMathematical"), - ("vector-effect", "vectorEffect"), - ("vert-adv-y", "vertAdvY"), - ("vert-origin-x", "vertOriginX"), - ("vert-origin-y", "vertOriginY"), - ("word-spacing", "wordSpacing"), - ("writing-mode", "writingMode"), - ("x-height", "xHeight"), - ("xlink:actuate", "xlinkActuate"), - ("xlink:arcrole", "xlinkArcrole"), - ("xlink:href", "xlinkHref"), - ("xlink:role", "xlinkRole"), - ("xlink:show", "xlinkShow"), - ("xlink:title", "xlinkTitle"), - ("xlink:type", "xlinkType"), - ("xml:base", "xmlBase"), - ("xml:lang", "xmlLang"), - ("xml:space", "xmlSpace"), - ]); + "accent-height" => "accentHeight", + "alignment-baseline" => "alignmentBaseline", + "arabic-form" => "arabicForm", + "baseline-shift" => "baselineShift", + "cap-height" => "capHeight", + "clip-path" => "clipPath", + "clip-rule" => "clipRule", + "color-interpolation" => "colorInterpolation", + "color-interpolation-filters" => "colorInterpolationFilters", + "color-profile" => "colorProfile", + "color-rendering" => "colorRendering", + "dominant-baseline" => "dominantBaseline", + "enable-background" => "enableBackground", + "fill-opacity" => "fillOpacity", + "fill-rule" => "fillRule", + "flood-color" => "floodColor", + "flood-opacity" => "floodOpacity", + "font-family" => "fontFamily", + "font-size" => "fontSize", + "font-size-adjust" => "fontSizeAdjust", + "font-stretch" => "fontStretch", + "font-style" => "fontStyle", + "font-variant" => "fontVariant", + "font-weight" => "fontWeight", + "glyph-name" => "glyphName", + "glyph-orientation-horizontal" => "glyphOrientationHorizontal", + "glyph-orientation-vertical" => "glyphOrientationVertical", + "horiz-adv-x" => "horizAdvX", + "horiz-origin-x" => "horizOriginX", + "image-rendering" => "imageRendering", + "letter-spacing" => "letterSpacing", + "lighting-color" => "lightingColor", + "marker-end" => "markerEnd", + "marker-mid" => "markerMid", + "marker-start" => "markerStart", + "overline-position" => "overlinePosition", + "overline-thickness" => "overlineThickness", + "paint-order" => "paintOrder", + "panose-1" => "panose1", + "pointer-events" => "pointerEvents", + "rendering-intent" => "renderingIntent", + "shape-rendering" => "shapeRendering", + "stop-color" => "stopColor", + "stop-opacity" => "stopOpacity", + "strikethrough-position" => "strikethroughPosition", + "strikethrough-thickness" => "strikethroughThickness", + "stroke-dasharray" => "strokeDasharray", + "stroke-dashoffset" => "strokeDashoffset", + "stroke-linecap" => "strokeLinecap", + "stroke-linejoin" => "strokeLinejoin", + "stroke-miterlimit" => "strokeMiterlimit", + "stroke-opacity" => "strokeOpacity", + "stroke-width" => "strokeWidth", + "text-anchor" => "textAnchor", + "text-decoration" => "textDecoration", + "text-rendering" => "textRendering", + "underline-position" => "underlinePosition", + "underline-thickness" => "underlineThickness", + "unicode-bidi" => "unicodeBidi", + "unicode-range" => "unicodeRange", + "units-per-em" => "unitsPerEm", + "v-alphabetic" => "vAlphabetic", + "v-hanging" => "vHanging", + "v-ideographic" => "vIdeographic", + "v-mathematical" => "vMathematical", + "vector-effect" => "vectorEffect", + "vert-adv-y" => "vertAdvY", + "vert-origin-x" => "vertOriginX", + "vert-origin-y" => "vertOriginY", + "word-spacing" => "wordSpacing", + "writing-mode" => "writingMode", + "x-height" => "xHeight", + "xlink:actuate" => "xlinkActuate", + "xlink:arcrole" => "xlinkArcrole", + "xlink:href" => "xlinkHref", + "xlink:role" => "xlinkRole", + "xlink:show" => "xlinkShow", + "xlink:title" => "xlinkTitle", + "xlink:type" => "xlinkType", + "xml:base" => "xmlBase", + "xml:lang" => "xmlLang", + "xml:space" => "xmlSpace", + }; } /// @@ -502,11 +497,11 @@ impl Rule for NoUnknownProperty { }; let name = normalize_attribute_case(actual_name.as_str()); if let Some(tags) = ATTRIBUTE_TAGS_MAP.get(name) { - if !tags.iter().any(|tag| *tag == el_type.as_str()) { + if !tags.contains(el_type.as_str()) { ctx.diagnostic(NoUnknownPropertyDiagnostic::InvalidPropOnTag( span, actual_name.to_string(), - tags.join(", "), + tags.iter().join(", "), )); } return; diff --git a/crates/oxc_linter/src/snapshots/no_unknown_property.snap b/crates/oxc_linter/src/snapshots/no_unknown_property.snap index 241fd46ec0a0c..9e2f3525bfaa4 100644 --- a/crates/oxc_linter/src/snapshots/no_unknown_property.snap +++ b/crates/oxc_linter/src/snapshots/no_unknown_property.snap @@ -134,7 +134,7 @@ expression: no_unknown_property 1 │
· ─────────── ╰──── - help: Property 'crossOrigin' is only allowed on: script, img, video, audio, link, image + help: Property 'crossOrigin' is only allowed on: script, audio, link, image, video, img ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] @@ -148,78 +148,78 @@ expression: no_unknown_property 1 │
· ─────── ╰──── - help: Property 'onAbort' is only allowed on: audio, video + help: Property 'onAbort' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ──────────────── ╰──── - help: Property 'onDurationChange' is only allowed on: audio, video + help: Property 'onDurationChange' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ───────── ╰──── - help: Property 'onEmptied' is only allowed on: audio, video + help: Property 'onEmptied' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ─────── ╰──── - help: Property 'onEnded' is only allowed on: audio, video + help: Property 'onEnded' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ──────── ╰──── - help: Property 'onResize' is only allowed on: audio, video + help: Property 'onResize' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ─────── ╰──── - help: Property 'onError' is only allowed on: audio, video, img, link, source, script, picture, iframe + help: Property 'onError' is only allowed on: source, link, script, audio, video, iframe, img, picture ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ────── ╰──── - help: Property 'onLoad' is only allowed on: script, img, link, picture, iframe, object, source + help: Property 'onLoad' is only allowed on: source, iframe, picture, script, object, img, link ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ──── ╰──── - help: Property 'fill' is only allowed on: altGlyph, circle, ellipse, g, line, marker, mask, path, polygon, polyline, rect, svg, symbol, text, textPath, tref, tspan, use, animate, animateColor, - animateMotion, animateTransform, set + help: Property 'fill' is only allowed on: rect, ellipse, textPath, animateMotion, tref, animate, marker, svg, animateColor, use, symbol, polygon, text, circle, polyline, path, altGlyph, tspan, + set, g, line, animateTransform, mask ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ──────── ╰──── - help: Property 'controls' is only allowed on: audio, video + help: Property 'controls' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ──── ╰──── - help: Property 'loop' is only allowed on: audio, video + help: Property 'loop' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] 1 │
· ───── ╰──── - help: Property 'muted' is only allowed on: audio, video + help: Property 'muted' is only allowed on: video, audio ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] @@ -240,7 +240,7 @@ expression: no_unknown_property 1 │
· ──────── ╰──── - help: Property 'download' is only allowed on: a, area + help: Property 'download' is only allowed on: area, a ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1] @@ -282,7 +282,7 @@ expression: no_unknown_property 1 │
· ──── ╰──── - help: Property 'abbr' is only allowed on: th, td + help: Property 'abbr' is only allowed on: td, th ⚠ eslint-plugin-react(no-unknown-property): Invalid property found ╭─[no_unknown_property.tsx:1:1]