style-prop-object
Configuration
rslint.config.ts
Rule Details
Enforce that the style prop value is an object. In React, the style prop expects a JavaScript object, not a CSS string.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
allow: An array of component names that are allowed to use a non-objectstyleprop.
Limitations
- Detects
<pragma>.createElement(...)where<pragma>defaults toReactand can be overridden viasettings.react.pragma. DestructuredcreateElement(e.g.import { createElement } from 'react') and@jsxcomment pragmas are not supported.