This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid any for oneOf arrays with identifiers
- Loading branch information
1 parent
7c70ecb
commit f947a23
Showing
5 changed files
with
36 additions
and
31 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
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import React from 'react'; | ||
|
||
const FOO = 'foo'; | ||
const BAR = 'bar'; | ||
const fooOrBar = ['foo', 'bar']; | ||
const fooOrBarWithConsts = [FOO, BAR]; | ||
const shape = { string: React.PropTypes.string }; | ||
|
||
export default class SomeComponent extends React.Component { | ||
static propTypes = { | ||
someOneOf: React.PropTypes.oneOf(fooOrBar), | ||
anotherOneOf: React.PropTypes.oneOf(fooOrBarWithConsts), | ||
someShape: React.PropTypes.shape(shape) | ||
}; | ||
} |