Fixup style for long lines

This commit is contained in:
Paul O’Shannessy
2016-01-11 17:27:37 -08:00
parent 171305f7e2
commit 26f53de4a6
6 changed files with 59 additions and 38 deletions
@@ -106,24 +106,32 @@ var ReactDOMInput = {
);
didWarnCheckedLink = true;
}
if (props.checked !== undefined && props.defaultChecked !== undefined &&
!didWarnCheckedDefaultChecked) {
if (
props.checked !== undefined &&
props.defaultChecked !== undefined &&
!didWarnCheckedDefaultChecked
) {
warning(
false,
'Input elements must be either controlled or uncontrolled (specify either the ' +
'checked prop, or the defaultChecked prop, but not both). Decide between using a ' +
'controlled or uncontrolled input and remove one of these props. More info: ' +
'Input elements must be either controlled or uncontrolled ' +
'(specify either the checked prop, or the defaultChecked prop, but not ' +
'both). Decide between using a controlled or uncontrolled input ' +
'element and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);
didWarnCheckedDefaultChecked = true;
}
if (props.value !== undefined && props.defaultValue !== undefined &&
!didWarnValueDefaultValue) {
if (
props.value !== undefined &&
props.defaultValue !== undefined &&
!didWarnValueDefaultValue
) {
warning(
false,
'Input elements must be either controlled or uncontrolled (specify either the value ' +
'prop, or the defaultValue prop, but not both). Decide between using a controlled ' +
'or uncontrolled input and remove one of these props. More info: ' +
'Input elements must be either controlled or uncontrolled ' +
'(specify either the value prop, or the defaultValue prop, but not ' +
'both). Decide between using a controlled or uncontrolled input ' +
'element and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);
didWarnValueDefaultValue = true;
@@ -180,13 +180,17 @@ var ReactDOMSelect = {
wasMultiple: Boolean(props.multiple),
};
if (props.value !== undefined && props.defaultValue !== undefined &&
!didWarnValueDefaultValue) {
if (
props.value !== undefined &&
props.defaultValue !== undefined &&
!didWarnValueDefaultValue
) {
warning(
false,
'Select elements must be either controlled or uncontrolled (specify either the ' +
'value prop, or the defaultValue prop, but not both). Decide between using a ' +
'controlled or uncontrolled select element and remove one of these props. More info: ' +
'Select elements must be either controlled or uncontrolled ' +
'(specify either the value prop, or the defaultValue prop, but not ' +
'both). Decide between using a controlled or uncontrolled select ' +
'element and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);
didWarnValueDefaultValue = true;
@@ -92,12 +92,17 @@ var ReactDOMTextarea = {
);
didWarnValueLink = true;
}
if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
if (
props.value !== undefined &&
props.defaultValue !== undefined &&
!didWarnValDefaultVal
) {
warning(
false,
'Textarea elements must be either controlled or uncontrolled (specify either the value ' +
'prop, or the defaultValue prop, but not both). Decide between using a controlled or ' +
'uncontrolled input and remove one of these props. More info: ' +
'Textarea elements must be either controlled or uncontrolled ' +
'(specify either the value prop, or the defaultValue prop, but not ' +
'both). Decide between using a controlled or uncontrolled textarea ' +
'and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);
didWarnValDefaultVal = true;
@@ -403,7 +403,7 @@ describe('ReactDOMInput', function() {
expect(() => ReactDOM.render(instance, node)).toThrow();
});
it('should throw warning message if value is null', function() {
it('should warn if value is null', function() {
ReactTestUtils.renderIntoDocument(<input type="text" value={null} />);
expect(console.error.argsForCall[0][0]).toContain(
'`value` prop on `input` should not be null. ' +
@@ -415,14 +415,15 @@ describe('ReactDOMInput', function() {
expect(console.error.argsForCall.length).toBe(1);
});
it('should throw warning message if checked and defaultChecked props are specified', function() {
it('should warn if checked and defaultChecked props are specified', function() {
ReactTestUtils.renderIntoDocument(
<input type="radio" checked={true} defaultChecked={true} readOnly={true} />
);
expect(console.error.argsForCall[0][0]).toContain(
'Input elements must be either controlled or uncontrolled (specify either the ' +
'checked prop, or the defaultChecked prop, but not both). Decide between using a ' +
'controlled or uncontrolled input and remove one of these props. More info: ' +
'Input elements must be either controlled or uncontrolled ' +
'(specify either the checked prop, or the defaultChecked prop, but not ' +
'both). Decide between using a controlled or uncontrolled input ' +
'element and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);
@@ -432,14 +433,15 @@ describe('ReactDOMInput', function() {
expect(console.error.argsForCall.length).toBe(1);
});
it('should throw warning message if value and defaultValue props are specified', function() {
it('should warn if value and defaultValue props are specified', function() {
ReactTestUtils.renderIntoDocument(
<input type="text" value="foo" defaultValue="bar" readOnly={true} />
);
expect(console.error.argsForCall[0][0]).toContain(
'Input elements must be either controlled or uncontrolled (specify either the value ' +
'prop, or the defaultValue prop, but not both). Decide between using a controlled or ' +
'uncontrolled input and remove one of these props. More info: ' +
'Input elements must be either controlled or uncontrolled ' +
'(specify either the value prop, or the defaultValue prop, but not ' +
'both). Decide between using a controlled or uncontrolled input ' +
'element and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);
@@ -462,7 +462,7 @@ describe('ReactDOMSelect', function() {
expect(node.options[2].selected).toBe(false); // gorilla
});
it('should throw warning message if value is null', function() {
it('should warn if value is null', function() {
spyOn(console, 'error');
ReactTestUtils.renderIntoDocument(<select value={null}><option value="test"/></select>);
@@ -491,7 +491,7 @@ describe('ReactDOMSelect', function() {
expect(node.value).toBe('giraffe');
});
it('should throw warning message if value and defaultValue props are specified', function() {
it('should warn if value and defaultValue props are specified', function() {
spyOn(console, 'error');
ReactTestUtils.renderIntoDocument(
<select value="giraffe" defaultValue="giraffe" readOnly={true}>
@@ -501,9 +501,10 @@ describe('ReactDOMSelect', function() {
</select>
);
expect(console.error.argsForCall[0][0]).toContain(
'Select elements must be either controlled or uncontrolled (specify either the ' +
'value prop, or the defaultValue prop, but not both). Decide between using a ' +
'controlled or uncontrolled select element and remove one of these props. More info: ' +
'Select elements must be either controlled or uncontrolled ' +
'(specify either the value prop, or the defaultValue prop, but not ' +
'both). Decide between using a controlled or uncontrolled select ' +
'element and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);
@@ -265,7 +265,7 @@ describe('ReactDOMTextarea', function() {
ReactDOM.unmountComponentAtNode(container);
});
it('should throw warning message if value is null', function() {
it('should warn if value is null', function() {
spyOn(console, 'error');
ReactTestUtils.renderIntoDocument(<textarea value={null} />);
@@ -279,15 +279,16 @@ describe('ReactDOMTextarea', function() {
expect(console.error.argsForCall.length).toBe(1);
});
it('should throw warning message if value and defaultValue are specified', function() {
it('should warn if value and defaultValue are specified', function() {
spyOn(console, 'error');
ReactTestUtils.renderIntoDocument(
<textarea value="foo" defaultValue="bar" readOnly={true} />
);
expect(console.error.argsForCall[0][0]).toContain(
'Textarea elements must be either controlled or uncontrolled (specify either the value ' +
'prop, or the defaultValue prop, but not both). Decide between using a controlled or ' +
'uncontrolled input and remove one of these props. More info: ' +
'Textarea elements must be either controlled or uncontrolled ' +
'(specify either the value prop, or the defaultValue prop, but not ' +
'both). Decide between using a controlled or uncontrolled textarea ' +
'and remove one of these props. More info: ' +
'https://fb.me/react-controlled-components'
);