Skip to content

Commit

Permalink
Fix eslint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
twisty committed Mar 18, 2019
1 parent c26df0a commit b8bd627
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
4 changes: 3 additions & 1 deletion examples/playground/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class App extends Component {
onChangeOption={this.handleChangeOption}
onToggle={this.handleToggleOptions}
/>
<h2 className="pb-2 mt-4 mb-3 border-bottom">Layout: <code>{layout}</code></h2>
<h2 className="pb-2 mt-4 mb-3 border-bottom">
Layout: <code>{layout}</code>
</h2>
<Playground
layoutChoice={layout}
validateOnSubmitChoice={validateOnSubmit}
Expand Down
4 changes: 3 additions & 1 deletion examples/playground/src/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ const Playground = props => {
myform = form;
};

const legend = str => <legend className="pb-2 mt-4 mb-3 border-bottom">{str}</legend>;
const legend = str => (
<legend className="pb-2 mt-4 mb-3 border-bottom">{str}</legend>
);

return (
<Form
Expand Down
1 change: 0 additions & 1 deletion src/components/__tests__/input-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ describe('The <Input /> component', () => {
it('has an `aria-invalid="true"` prop on the form control when validation has failed', () => {});

it('has an `aria-required="true"` prop on the form control when validation is required', () => {});

});

describe('Input components do this', () => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/error-messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import PropTypes from 'prop-types';
const ErrorMessages = ({messages}) => {
const messageNodes = messages.map((message, key) => (
// eslint-disable-next-line react/no-array-index-key
<div key={key}>
{message}
</div>
<div key={key}>{message}</div>
));
return <div className="invalid-feedback">{messageNodes}</div>;
};
Expand Down
13 changes: 12 additions & 1 deletion src/components/form-check-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ import React from 'react';
import ErrorMessages from './error-messages';
import Help from './help';
import Row from './row';
import {componentPropTypes, componentDefaultProps} from './component-common';

const FormCheckGroup = props => {
const { layout, help, showErrors, errorMessages, labelClassName, children } = props;
const {
layout,
help,
showErrors,
errorMessages,
labelClassName,
children,
} = props;

if (layout === 'elementOnly') {
return children;
Expand All @@ -19,4 +27,7 @@ const FormCheckGroup = props => {
);
};

FormCheckGroup.propTypes = componentPropTypes;
FormCheckGroup.defaultProps = componentDefaultProps;

export default FormCheckGroup;

0 comments on commit b8bd627

Please sign in to comment.