Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 226-unused-prop-types
# Conflicts: # index.js
- Loading branch information
Showing
13 changed files
with
514 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Enforce style prop value being an object (style-prop-object) | ||
|
||
Require that the value of the prop `style` be an object or a variable that is | ||
an object. | ||
|
||
## Rule Details | ||
|
||
The following patterns are considered warnings: | ||
|
||
```jsx | ||
<div style="color: 'red'" /> | ||
|
||
<div style={true} /> | ||
|
||
<Hello style={true} /> | ||
|
||
const styles = true; | ||
<div style={styles} /> | ||
``` | ||
|
||
```js | ||
React.createElement("div", { style: "color: 'red'" }); | ||
|
||
React.createElement("div", { style: true }); | ||
|
||
React.createElement("Hello", { style: true }); | ||
|
||
const styles = true; | ||
React.createElement("div", { style: styles }); | ||
``` | ||
|
||
|
||
The following patterns are not considered warnings: | ||
|
||
```jsx | ||
<div style={{ color: "red" }} /> | ||
|
||
<Hello style={{ color: "red" }} /> | ||
|
||
const styles = { color: "red" }; | ||
<div style={styles} /> | ||
``` | ||
|
||
```js | ||
React.createElement("div", { style: { color: 'red' }}); | ||
|
||
React.createElement("Hello", { style: { color: 'red' }}); | ||
|
||
const styles = { height: '100px' }; | ||
React.createElement("div", { style: styles }); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.