react-props-check 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/react_props.js +6 -0
- package/dist/esm/index.js +13 -0
- package/dist/esm/react_props.js +6 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.test.d.ts +1 -0
- package/dist/types/react_props.d.ts +3 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Marco Antonio Ghiani
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# react-props-check
|
|
2
|
+
|
|
3
|
+
[](https://github.com/tonyghiani/mnt/actions)
|
|
4
|
+
[](https://github.com/tonyghiani/mnt/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
`react-props-check` is a lightweight utility library designed to simplify prop validation in React applications. When working with React components, it's essential to ensure that your components receive the correct props to prevent unexpected issues during runtime. This package streamlines the process of validating React component props, helping you maintain code quality and reliability.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
You can install `react-props-check` via npm or yarn. Make sure you have Node.js and npm (or yarn) installed in your project before proceeding.
|
|
11
|
+
|
|
12
|
+
### Using npm
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install react-props-check
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Using yarn
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
yarn add react-props-check
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Once the package is installed, you can import it into your React application and start using it to validate props.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
`react-props-check` provides a simple and effective way to validate React component props. You can use it to check if a prop is one of the accepted properties defined in your application. Here's a basic example:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import isValidProp from 'react-props-check';
|
|
32
|
+
|
|
33
|
+
const isValid = isValidProp('className'); // Check if 'className' is a valid React prop
|
|
34
|
+
|
|
35
|
+
if (isValid) {
|
|
36
|
+
// Prop is valid, proceed with your logic
|
|
37
|
+
} else {
|
|
38
|
+
// Prop is not valid, handle the error
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## API Reference
|
|
43
|
+
|
|
44
|
+
### `isValidProp(property: ReactAcceptedProp | DataAttribute): boolean`
|
|
45
|
+
|
|
46
|
+
- `property` (ReactAcceptedProp | DataAttribute): The prop or data attribute to validate.
|
|
47
|
+
|
|
48
|
+
Returns `true` if the property is valid, `false` otherwise.
|
|
49
|
+
|
|
50
|
+
### DataAttribute
|
|
51
|
+
|
|
52
|
+
- `DataAttribute` is a string type representing data attributes in the format `data-{string}`.
|
|
53
|
+
|
|
54
|
+
### ReactAcceptedProp
|
|
55
|
+
|
|
56
|
+
- `ReactAcceptedProp` is an exported type that represents valid React props.
|
|
57
|
+
|
|
58
|
+
```javascript
|
|
59
|
+
import { ReactAcceptedProp } from 'react-props-check';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/tonyghiani/mnt/blob/main/LICENSE) file for details. You are free to use and distribute this package under the terms of the MIT License.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const react_props = require("./react_props.js");
|
|
4
|
+
function isValidProp(property) {
|
|
5
|
+
return react_props.reactAcceptedPropertiesSet.has(property) || isDataAttribute(property);
|
|
6
|
+
}
|
|
7
|
+
function isDataAttribute(property) {
|
|
8
|
+
return property.startsWith("data-");
|
|
9
|
+
}
|
|
10
|
+
exports.reactAcceptedProperties = react_props.reactAcceptedProperties;
|
|
11
|
+
exports.reactAcceptedPropertiesSet = react_props.reactAcceptedPropertiesSet;
|
|
12
|
+
exports.default = isValidProp;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const reactAcceptedProperties = ["abbr", "about", "accentHeight", "accept", "acceptCharset", "accessKey", "accumulate", "action", "additive", "alignmentBaseline", "allow", "allowFullScreen", "allowPaymentRequest", "allowReorder", "allowTransparency", "allowUserMedia", "alphabetic", "alt", "amplitude", "arabicForm", "aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-colcount", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-modal", "aria-multiline", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-placeholder", "aria-posinset", "aria-pressed", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected", "aria-setsize", "aria-sort", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "as", "ascent", "async", "attributeName", "attributeType", "autoCapitalize", "autoComplete", "autoCorrect", "autofocus", "autoFocus", "autoPlay", "autoReverse", "autoSave", "azimuth", "baseFrequency", "baselineShift", "baseProfile", "bbox", "begin", "bias", "by", "calcMode", "capHeight", "capture", "cellPadding", "cellSpacing", "challenge", "charSet", "checked", "children", "cite", "class", "classID", "className", "clip", "clipPath", "clipPathUnits", "clipRule", "color", "colorInterpolation", "colorInterpolationFilters", "colorProfile", "colorRendering", "cols", "colSpan", "content", "contentEditable", "contentScriptType", "contentStyleType", "contextMenu", "controls", "controlsList", "coords", "crossOrigin", "cursor", "cx", "cy", "d", "dangerouslySetInnerHTML", "data", "datatype", "dateTime", "decelerate", "decoding", "default", "defaultChecked", "defaultValue", "defer", "descent", "diffuseConstant", "dir", "direction", "disabled", "disablePictureInPicture", "display", "divisor", "dominantBaseline", "download", "draggable", "dur", "dx", "dy", "edgeMode", "elevation", "enableBackground", "encType", "end", "enterKeyHint", "exponent", "externalResourcesRequired", "fallback", "fill", "fillOpacity", "fillRule", "filter", "filterRes", "filterUnits", "floodColor", "floodOpacity", "focusable", "fontFamily", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontWeight", "for", "form", "formAction", "format", "formEncType", "formMethod", "formNoValidate", "formTarget", "fr", "frameBorder", "from", "fx", "fy", "g1", "g2", "glyphName", "glyphOrientationHorizontal", "glyphOrientationVertical", "glyphRef", "gradientTransform", "gradientUnits", "hanging", "headers", "height", "hidden", "high", "horizAdvX", "horizOriginX", "href", "hrefLang", "htmlFor", "httpEquiv", "id", "ideographic", "imageRendering", "in", "in2", "incremental", "inert", "inlist", "innerHTML", "inputMode", "integrity", "intercept", "is", "itemID", "itemProp", "itemRef", "itemScope", "itemType", "k", "k1", "k2", "k3", "k4", "kernelMatrix", "kernelUnitLength", "kerning", "key", "keyParams", "keyPoints", "keySplines", "keyTimes", "keyType", "kind", "label", "lang", "lengthAdjust", "letterSpacing", "lightingColor", "limitingConeAngle", "list", "loading", "local", "loop", "low", "manifest", "marginHeight", "marginWidth", "markerEnd", "markerHeight", "markerMid", "markerStart", "markerUnits", "markerWidth", "mask", "maskContentUnits", "maskUnits", "mathematical", "max", "maxLength", "media", "mediaGroup", "method", "min", "minLength", "mode", "multiple", "muted", "name", "nonce", "noValidate", "numOctaves", "offset", "on", "onAbort", "onAbortCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onAnimationStart", "onAnimationStartCapture", "onAuxClick", "onAuxClickCapture", "onBeforeInput", "onBeforeInputCapture", "onBlur", "onBlurCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onChange", "onChangeCapture", "onClick", "onClickCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onContextMenu", "onContextMenuCapture", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onError", "onErrorCapture", "onFocus", "onFocusCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onInput", "onInputCapture", "onInvalid", "onInvalidCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onLoad", "onLoadCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onPaste", "onPasteCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerDown", "onPointerDownCapture", "onPointerEnter", "onPointerEnterCapture", "onPointerLeave", "onPointerLeaveCapture", "onPointerMove", "onPointerMoveCapture", "onPointerOut", "onPointerOutCapture", "onPointerOver", "onPointerOverCapture", "onPointerUp", "onPointerUpCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onReset", "onResetCapture", "onResize", "onResizeCapture", "onScroll", "onScrollCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onSelect", "onSelectCapture", "onStalled", "onStalledCapture", "onSubmit", "onSubmitCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onTransitionEnd", "onTransitionEndCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onWheel", "onWheelCapture", "opacity", "open", "operator", "optimum", "option", "order", "orient", "orientation", "origin", "overflow", "overlinePosition", "overlineThickness", "paintOrder", "panose1", "pathLength", "pattern", "patternContentUnits", "patternTransform", "patternUnits", "placeholder", "playsInline", "pointerEvents", "points", "pointsAtX", "pointsAtY", "pointsAtZ", "poster", "prefix", "preload", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "profile", "property", "r", "radioGroup", "radius", "readOnly", "ref", "referrerPolicy", "refX", "refY", "rel", "renderingIntent", "repeatCount", "repeatDur", "required", "requiredExtensions", "requiredFeatures", "resource", "restart", "result", "results", "rev", "reversed", "role", "rotate", "rows", "rowSpan", "rx", "ry", "sandbox", "scale", "scope", "scoped", "scrolling", "seamless", "security", "seed", "selected", "shape", "shapeRendering", "size", "sizes", "slope", "slot", "spacing", "span", "specularConstant", "specularExponent", "speed", "spellCheck", "spreadMethod", "src", "srcDoc", "srcLang", "srcSet", "start", "startOffset", "stdDeviation", "stemh", "stemv", "step", "stitchTiles", "stopColor", "stopOpacity", "strikethroughPosition", "strikethroughThickness", "string", "stroke", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "style", "summary", "suppressContentEditableWarning", "suppressHydrationWarning", "surfaceScale", "systemLanguage", "tabIndex", "tableValues", "target", "targetX", "targetY", "textAnchor", "textDecoration", "textLength", "textRendering", "title", "to", "transform", "translate", "type", "typeof", "u1", "u2", "underlinePosition", "underlineThickness", "unicode", "unicodeBidi", "unicodeRange", "unitsPerEm", "unselectable", "useMap", "vAlphabetic", "value", "valueLink", "values", "vectorEffect", "version", "vertAdvY", "vertOriginX", "vertOriginY", "vHanging", "vIdeographic", "viewBox", "viewTarget", "visibility", "vMathematical", "vocab", "width", "widths", "wmode", "wordSpacing", "wrap", "writingMode", "x", "x1", "x2", "xChannelSelector", "xHeight", "xlinkActuate", "xlinkArcrole", "xlinkHref", "xlinkRole", "xlinkShow", "xlinkTitle", "xlinkType", "xmlBase", "xmlLang", "xmlns", "xmlnsXlink", "xmlSpace", "y", "y1", "y2", "yChannelSelector", "z", "zoomAndPan"];
|
|
4
|
+
const reactAcceptedPropertiesSet = new Set(reactAcceptedProperties);
|
|
5
|
+
exports.reactAcceptedProperties = reactAcceptedProperties;
|
|
6
|
+
exports.reactAcceptedPropertiesSet = reactAcceptedPropertiesSet;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { reactAcceptedPropertiesSet } from "./react_props.js";
|
|
2
|
+
import { reactAcceptedProperties } from "./react_props.js";
|
|
3
|
+
function isValidProp(property) {
|
|
4
|
+
return reactAcceptedPropertiesSet.has(property) || isDataAttribute(property);
|
|
5
|
+
}
|
|
6
|
+
function isDataAttribute(property) {
|
|
7
|
+
return property.startsWith("data-");
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
isValidProp as default,
|
|
11
|
+
reactAcceptedProperties,
|
|
12
|
+
reactAcceptedPropertiesSet
|
|
13
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
const reactAcceptedProperties = ["abbr", "about", "accentHeight", "accept", "acceptCharset", "accessKey", "accumulate", "action", "additive", "alignmentBaseline", "allow", "allowFullScreen", "allowPaymentRequest", "allowReorder", "allowTransparency", "allowUserMedia", "alphabetic", "alt", "amplitude", "arabicForm", "aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-colcount", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-modal", "aria-multiline", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-placeholder", "aria-posinset", "aria-pressed", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected", "aria-setsize", "aria-sort", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "as", "ascent", "async", "attributeName", "attributeType", "autoCapitalize", "autoComplete", "autoCorrect", "autofocus", "autoFocus", "autoPlay", "autoReverse", "autoSave", "azimuth", "baseFrequency", "baselineShift", "baseProfile", "bbox", "begin", "bias", "by", "calcMode", "capHeight", "capture", "cellPadding", "cellSpacing", "challenge", "charSet", "checked", "children", "cite", "class", "classID", "className", "clip", "clipPath", "clipPathUnits", "clipRule", "color", "colorInterpolation", "colorInterpolationFilters", "colorProfile", "colorRendering", "cols", "colSpan", "content", "contentEditable", "contentScriptType", "contentStyleType", "contextMenu", "controls", "controlsList", "coords", "crossOrigin", "cursor", "cx", "cy", "d", "dangerouslySetInnerHTML", "data", "datatype", "dateTime", "decelerate", "decoding", "default", "defaultChecked", "defaultValue", "defer", "descent", "diffuseConstant", "dir", "direction", "disabled", "disablePictureInPicture", "display", "divisor", "dominantBaseline", "download", "draggable", "dur", "dx", "dy", "edgeMode", "elevation", "enableBackground", "encType", "end", "enterKeyHint", "exponent", "externalResourcesRequired", "fallback", "fill", "fillOpacity", "fillRule", "filter", "filterRes", "filterUnits", "floodColor", "floodOpacity", "focusable", "fontFamily", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontWeight", "for", "form", "formAction", "format", "formEncType", "formMethod", "formNoValidate", "formTarget", "fr", "frameBorder", "from", "fx", "fy", "g1", "g2", "glyphName", "glyphOrientationHorizontal", "glyphOrientationVertical", "glyphRef", "gradientTransform", "gradientUnits", "hanging", "headers", "height", "hidden", "high", "horizAdvX", "horizOriginX", "href", "hrefLang", "htmlFor", "httpEquiv", "id", "ideographic", "imageRendering", "in", "in2", "incremental", "inert", "inlist", "innerHTML", "inputMode", "integrity", "intercept", "is", "itemID", "itemProp", "itemRef", "itemScope", "itemType", "k", "k1", "k2", "k3", "k4", "kernelMatrix", "kernelUnitLength", "kerning", "key", "keyParams", "keyPoints", "keySplines", "keyTimes", "keyType", "kind", "label", "lang", "lengthAdjust", "letterSpacing", "lightingColor", "limitingConeAngle", "list", "loading", "local", "loop", "low", "manifest", "marginHeight", "marginWidth", "markerEnd", "markerHeight", "markerMid", "markerStart", "markerUnits", "markerWidth", "mask", "maskContentUnits", "maskUnits", "mathematical", "max", "maxLength", "media", "mediaGroup", "method", "min", "minLength", "mode", "multiple", "muted", "name", "nonce", "noValidate", "numOctaves", "offset", "on", "onAbort", "onAbortCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onAnimationStart", "onAnimationStartCapture", "onAuxClick", "onAuxClickCapture", "onBeforeInput", "onBeforeInputCapture", "onBlur", "onBlurCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onChange", "onChangeCapture", "onClick", "onClickCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onContextMenu", "onContextMenuCapture", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onError", "onErrorCapture", "onFocus", "onFocusCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onInput", "onInputCapture", "onInvalid", "onInvalidCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onLoad", "onLoadCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onPaste", "onPasteCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerDown", "onPointerDownCapture", "onPointerEnter", "onPointerEnterCapture", "onPointerLeave", "onPointerLeaveCapture", "onPointerMove", "onPointerMoveCapture", "onPointerOut", "onPointerOutCapture", "onPointerOver", "onPointerOverCapture", "onPointerUp", "onPointerUpCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onReset", "onResetCapture", "onResize", "onResizeCapture", "onScroll", "onScrollCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onSelect", "onSelectCapture", "onStalled", "onStalledCapture", "onSubmit", "onSubmitCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onTransitionEnd", "onTransitionEndCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onWheel", "onWheelCapture", "opacity", "open", "operator", "optimum", "option", "order", "orient", "orientation", "origin", "overflow", "overlinePosition", "overlineThickness", "paintOrder", "panose1", "pathLength", "pattern", "patternContentUnits", "patternTransform", "patternUnits", "placeholder", "playsInline", "pointerEvents", "points", "pointsAtX", "pointsAtY", "pointsAtZ", "poster", "prefix", "preload", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "profile", "property", "r", "radioGroup", "radius", "readOnly", "ref", "referrerPolicy", "refX", "refY", "rel", "renderingIntent", "repeatCount", "repeatDur", "required", "requiredExtensions", "requiredFeatures", "resource", "restart", "result", "results", "rev", "reversed", "role", "rotate", "rows", "rowSpan", "rx", "ry", "sandbox", "scale", "scope", "scoped", "scrolling", "seamless", "security", "seed", "selected", "shape", "shapeRendering", "size", "sizes", "slope", "slot", "spacing", "span", "specularConstant", "specularExponent", "speed", "spellCheck", "spreadMethod", "src", "srcDoc", "srcLang", "srcSet", "start", "startOffset", "stdDeviation", "stemh", "stemv", "step", "stitchTiles", "stopColor", "stopOpacity", "strikethroughPosition", "strikethroughThickness", "string", "stroke", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "style", "summary", "suppressContentEditableWarning", "suppressHydrationWarning", "surfaceScale", "systemLanguage", "tabIndex", "tableValues", "target", "targetX", "targetY", "textAnchor", "textDecoration", "textLength", "textRendering", "title", "to", "transform", "translate", "type", "typeof", "u1", "u2", "underlinePosition", "underlineThickness", "unicode", "unicodeBidi", "unicodeRange", "unitsPerEm", "unselectable", "useMap", "vAlphabetic", "value", "valueLink", "values", "vectorEffect", "version", "vertAdvY", "vertOriginX", "vertOriginY", "vHanging", "vIdeographic", "viewBox", "viewTarget", "visibility", "vMathematical", "vocab", "width", "widths", "wmode", "wordSpacing", "wrap", "writingMode", "x", "x1", "x2", "xChannelSelector", "xHeight", "xlinkActuate", "xlinkArcrole", "xlinkHref", "xlinkRole", "xlinkShow", "xlinkTitle", "xlinkType", "xmlBase", "xmlLang", "xmlns", "xmlnsXlink", "xmlSpace", "y", "y1", "y2", "yChannelSelector", "z", "zoomAndPan"];
|
|
2
|
+
const reactAcceptedPropertiesSet = new Set(reactAcceptedProperties);
|
|
3
|
+
export {
|
|
4
|
+
reactAcceptedProperties,
|
|
5
|
+
reactAcceptedPropertiesSet
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const reactAcceptedProperties: readonly ["abbr", "about", "accentHeight", "accept", "acceptCharset", "accessKey", "accumulate", "action", "additive", "alignmentBaseline", "allow", "allowFullScreen", "allowPaymentRequest", "allowReorder", "allowTransparency", "allowUserMedia", "alphabetic", "alt", "amplitude", "arabicForm", "aria-activedescendant", "aria-atomic", "aria-autocomplete", "aria-braillelabel", "aria-brailleroledescription", "aria-busy", "aria-checked", "aria-colcount", "aria-colindex", "aria-colindextext", "aria-colspan", "aria-controls", "aria-current", "aria-describedby", "aria-description", "aria-details", "aria-disabled", "aria-dropeffect", "aria-errormessage", "aria-expanded", "aria-flowto", "aria-grabbed", "aria-haspopup", "aria-hidden", "aria-invalid", "aria-keyshortcuts", "aria-label", "aria-labelledby", "aria-level", "aria-live", "aria-modal", "aria-multiline", "aria-multiselectable", "aria-orientation", "aria-owns", "aria-placeholder", "aria-posinset", "aria-pressed", "aria-readonly", "aria-relevant", "aria-required", "aria-roledescription", "aria-rowcount", "aria-rowindex", "aria-rowindextext", "aria-rowspan", "aria-selected", "aria-setsize", "aria-sort", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext", "as", "ascent", "async", "attributeName", "attributeType", "autoCapitalize", "autoComplete", "autoCorrect", "autofocus", "autoFocus", "autoPlay", "autoReverse", "autoSave", "azimuth", "baseFrequency", "baselineShift", "baseProfile", "bbox", "begin", "bias", "by", "calcMode", "capHeight", "capture", "cellPadding", "cellSpacing", "challenge", "charSet", "checked", "children", "cite", "class", "classID", "className", "clip", "clipPath", "clipPathUnits", "clipRule", "color", "colorInterpolation", "colorInterpolationFilters", "colorProfile", "colorRendering", "cols", "colSpan", "content", "contentEditable", "contentScriptType", "contentStyleType", "contextMenu", "controls", "controlsList", "coords", "crossOrigin", "cursor", "cx", "cy", "d", "dangerouslySetInnerHTML", "data", "datatype", "dateTime", "decelerate", "decoding", "default", "defaultChecked", "defaultValue", "defer", "descent", "diffuseConstant", "dir", "direction", "disabled", "disablePictureInPicture", "display", "divisor", "dominantBaseline", "download", "draggable", "dur", "dx", "dy", "edgeMode", "elevation", "enableBackground", "encType", "end", "enterKeyHint", "exponent", "externalResourcesRequired", "fallback", "fill", "fillOpacity", "fillRule", "filter", "filterRes", "filterUnits", "floodColor", "floodOpacity", "focusable", "fontFamily", "fontSize", "fontSizeAdjust", "fontStretch", "fontStyle", "fontVariant", "fontWeight", "for", "form", "formAction", "format", "formEncType", "formMethod", "formNoValidate", "formTarget", "fr", "frameBorder", "from", "fx", "fy", "g1", "g2", "glyphName", "glyphOrientationHorizontal", "glyphOrientationVertical", "glyphRef", "gradientTransform", "gradientUnits", "hanging", "headers", "height", "hidden", "high", "horizAdvX", "horizOriginX", "href", "hrefLang", "htmlFor", "httpEquiv", "id", "ideographic", "imageRendering", "in", "in2", "incremental", "inert", "inlist", "innerHTML", "inputMode", "integrity", "intercept", "is", "itemID", "itemProp", "itemRef", "itemScope", "itemType", "k", "k1", "k2", "k3", "k4", "kernelMatrix", "kernelUnitLength", "kerning", "key", "keyParams", "keyPoints", "keySplines", "keyTimes", "keyType", "kind", "label", "lang", "lengthAdjust", "letterSpacing", "lightingColor", "limitingConeAngle", "list", "loading", "local", "loop", "low", "manifest", "marginHeight", "marginWidth", "markerEnd", "markerHeight", "markerMid", "markerStart", "markerUnits", "markerWidth", "mask", "maskContentUnits", "maskUnits", "mathematical", "max", "maxLength", "media", "mediaGroup", "method", "min", "minLength", "mode", "multiple", "muted", "name", "nonce", "noValidate", "numOctaves", "offset", "on", "onAbort", "onAbortCapture", "onAnimationEnd", "onAnimationEndCapture", "onAnimationIteration", "onAnimationIterationCapture", "onAnimationStart", "onAnimationStartCapture", "onAuxClick", "onAuxClickCapture", "onBeforeInput", "onBeforeInputCapture", "onBlur", "onBlurCapture", "onCanPlay", "onCanPlayCapture", "onCanPlayThrough", "onCanPlayThroughCapture", "onChange", "onChangeCapture", "onClick", "onClickCapture", "onCompositionEnd", "onCompositionEndCapture", "onCompositionStart", "onCompositionStartCapture", "onCompositionUpdate", "onCompositionUpdateCapture", "onContextMenu", "onContextMenuCapture", "onCopy", "onCopyCapture", "onCut", "onCutCapture", "onDoubleClick", "onDoubleClickCapture", "onDrag", "onDragCapture", "onDragEnd", "onDragEndCapture", "onDragEnter", "onDragEnterCapture", "onDragExit", "onDragExitCapture", "onDragLeave", "onDragLeaveCapture", "onDragOver", "onDragOverCapture", "onDragStart", "onDragStartCapture", "onDrop", "onDropCapture", "onDurationChange", "onDurationChangeCapture", "onEmptied", "onEmptiedCapture", "onEncrypted", "onEncryptedCapture", "onEnded", "onEndedCapture", "onError", "onErrorCapture", "onFocus", "onFocusCapture", "onGotPointerCapture", "onGotPointerCaptureCapture", "onInput", "onInputCapture", "onInvalid", "onInvalidCapture", "onKeyDown", "onKeyDownCapture", "onKeyPress", "onKeyPressCapture", "onKeyUp", "onKeyUpCapture", "onLoad", "onLoadCapture", "onLoadedData", "onLoadedDataCapture", "onLoadedMetadata", "onLoadedMetadataCapture", "onLoadStart", "onLoadStartCapture", "onLostPointerCapture", "onLostPointerCaptureCapture", "onMouseDown", "onMouseDownCapture", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseMoveCapture", "onMouseOut", "onMouseOutCapture", "onMouseOver", "onMouseOverCapture", "onMouseUp", "onMouseUpCapture", "onPaste", "onPasteCapture", "onPause", "onPauseCapture", "onPlay", "onPlayCapture", "onPlaying", "onPlayingCapture", "onPointerCancel", "onPointerCancelCapture", "onPointerDown", "onPointerDownCapture", "onPointerEnter", "onPointerEnterCapture", "onPointerLeave", "onPointerLeaveCapture", "onPointerMove", "onPointerMoveCapture", "onPointerOut", "onPointerOutCapture", "onPointerOver", "onPointerOverCapture", "onPointerUp", "onPointerUpCapture", "onProgress", "onProgressCapture", "onRateChange", "onRateChangeCapture", "onReset", "onResetCapture", "onResize", "onResizeCapture", "onScroll", "onScrollCapture", "onSeeked", "onSeekedCapture", "onSeeking", "onSeekingCapture", "onSelect", "onSelectCapture", "onStalled", "onStalledCapture", "onSubmit", "onSubmitCapture", "onSuspend", "onSuspendCapture", "onTimeUpdate", "onTimeUpdateCapture", "onTouchCancel", "onTouchCancelCapture", "onTouchEnd", "onTouchEndCapture", "onTouchMove", "onTouchMoveCapture", "onTouchStart", "onTouchStartCapture", "onTransitionEnd", "onTransitionEndCapture", "onVolumeChange", "onVolumeChangeCapture", "onWaiting", "onWaitingCapture", "onWheel", "onWheelCapture", "opacity", "open", "operator", "optimum", "option", "order", "orient", "orientation", "origin", "overflow", "overlinePosition", "overlineThickness", "paintOrder", "panose1", "pathLength", "pattern", "patternContentUnits", "patternTransform", "patternUnits", "placeholder", "playsInline", "pointerEvents", "points", "pointsAtX", "pointsAtY", "pointsAtZ", "poster", "prefix", "preload", "preserveAlpha", "preserveAspectRatio", "primitiveUnits", "profile", "property", "r", "radioGroup", "radius", "readOnly", "ref", "referrerPolicy", "refX", "refY", "rel", "renderingIntent", "repeatCount", "repeatDur", "required", "requiredExtensions", "requiredFeatures", "resource", "restart", "result", "results", "rev", "reversed", "role", "rotate", "rows", "rowSpan", "rx", "ry", "sandbox", "scale", "scope", "scoped", "scrolling", "seamless", "security", "seed", "selected", "shape", "shapeRendering", "size", "sizes", "slope", "slot", "spacing", "span", "specularConstant", "specularExponent", "speed", "spellCheck", "spreadMethod", "src", "srcDoc", "srcLang", "srcSet", "start", "startOffset", "stdDeviation", "stemh", "stemv", "step", "stitchTiles", "stopColor", "stopOpacity", "strikethroughPosition", "strikethroughThickness", "string", "stroke", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "style", "summary", "suppressContentEditableWarning", "suppressHydrationWarning", "surfaceScale", "systemLanguage", "tabIndex", "tableValues", "target", "targetX", "targetY", "textAnchor", "textDecoration", "textLength", "textRendering", "title", "to", "transform", "translate", "type", "typeof", "u1", "u2", "underlinePosition", "underlineThickness", "unicode", "unicodeBidi", "unicodeRange", "unitsPerEm", "unselectable", "useMap", "vAlphabetic", "value", "valueLink", "values", "vectorEffect", "version", "vertAdvY", "vertOriginX", "vertOriginY", "vHanging", "vIdeographic", "viewBox", "viewTarget", "visibility", "vMathematical", "vocab", "width", "widths", "wmode", "wordSpacing", "wrap", "writingMode", "x", "x1", "x2", "xChannelSelector", "xHeight", "xlinkActuate", "xlinkArcrole", "xlinkHref", "xlinkRole", "xlinkShow", "xlinkTitle", "xlinkType", "xmlBase", "xmlLang", "xmlns", "xmlnsXlink", "xmlSpace", "y", "y1", "y2", "yChannelSelector", "z", "zoomAndPan"];
|
|
2
|
+
export type ReactAcceptedProp = (typeof reactAcceptedProperties)[number];
|
|
3
|
+
export declare const reactAcceptedPropertiesSet: Set<string>;
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-props-check",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Validate React properties to keep the DOM semantic.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"attributes",
|
|
7
|
+
"components",
|
|
8
|
+
"properties",
|
|
9
|
+
"react component",
|
|
10
|
+
"react",
|
|
11
|
+
"typescript"
|
|
12
|
+
],
|
|
13
|
+
"homepage": "https://github.com/tonyghiani/mnt/tree/main/packages/react-props-check#readme",
|
|
14
|
+
"repository": "https://github.com/tonyghiani/mnt",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"author": "Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>",
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"main": "dist/cjs/index.js",
|
|
19
|
+
"module": "dist/esm/index.js",
|
|
20
|
+
"types": "dist/types/index.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "yarn clean:build && yarn build:vite && yarn build:types",
|
|
26
|
+
"build:types": "tsc --project ./tsconfig.types.json",
|
|
27
|
+
"build:vite": "vite build",
|
|
28
|
+
"clean:build": "rimraf dist *.tsbuildinfo",
|
|
29
|
+
"commit": "git cz",
|
|
30
|
+
"lint": "eslint",
|
|
31
|
+
"lint:package": "sort-package-json",
|
|
32
|
+
"release": "semantic-release",
|
|
33
|
+
"test": "NODE_ENV=testing jest --passWithNoTests"
|
|
34
|
+
},
|
|
35
|
+
"config": {
|
|
36
|
+
"commitizen": {
|
|
37
|
+
"path": "git-cz"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"gitHead": "bb73a6fcd36ec512bba0da9ccf28dbcc7c040c2e"
|
|
44
|
+
}
|