eslint: jsx-tag-spacing and jsx-closing-bracket-location rules

This commit is contained in:
Sanne Raymaekers 2020-11-04 11:22:30 +01:00
parent afe02e0f2e
commit a39304a3ba
5 changed files with 26 additions and 21 deletions

View file

@ -60,6 +60,12 @@ rules:
- objectLiterals:
- never
- children: true
react/jsx-tag-spacing:
- error
- beforeClosing: never
react/jsx-closing-bracket-location:
- error
- location: after-props
key-spacing: 2
keyword-spacing: 2
linebreak-style:

View file

@ -22,9 +22,9 @@ InsightsRoute.propTypes = {
export const Routes = () => {
return (
<Switch>
<InsightsRoute exact path='/landing' component={ LandingPage } rootClass='landingpage'/>
<InsightsRoute exact path='/imagewizard' component={ CreateImageWizard } rootClass='imagewizard'/>
<Redirect to='/landing'/>
<InsightsRoute exact path='/landing' component={ LandingPage } rootClass='landingpage' />
<InsightsRoute exact path='/imagewizard' component={ CreateImageWizard } rootClass='imagewizard' />
<Redirect to='/landing' />
</Switch>
);
};

View file

@ -33,7 +33,7 @@ const ReleaseComponent = (props) => {
<FormGroup label="Release" fieldId="release-select">
<FormSelect value={ props.value } onChange={ value => props.setRelease(value) }
aria-label="Select release input" id="release-select" data-testid="release-select">
{ options.map(option => <FormSelectOption key={ option.value } value={ option.value } label={ option.label }/>) }
{ options.map(option => <FormSelectOption key={ option.value } value={ option.value } label={ option.label } />) }
</FormSelect>
</FormGroup>
</Form>
@ -55,36 +55,36 @@ const AmazonUploadComponent = (props) => {
<>
<FormGroup isRequired label="Access key ID" fieldId="amazon-access-id"
helperTextInvalid={ (props.errors['amazon-access-id'] && props.errors['amazon-access-id'].value) || '' }
validated={ (props.errors['amazon-access-id'] && 'error') || 'default' } >
validated={ (props.errors['amazon-access-id'] && 'error') || 'default' }>
<TextInput value={ props.upload.options.access_key_id || '' }
type="text" aria-label="amazon access key ID" id="amazon-access-id"
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { access_key_id: value })) }/>
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { access_key_id: value })) } />
</FormGroup>
<FormGroup isRequired label="Secret access key" fieldId="amazon-access-secret"
helperTextInvalid={ (props.errors['amazon-access-secret'] && props.errors['amazon-access-secret'].value) || '' }
validated={ (props.errors['amazon-access-secret'] && 'error') || 'default' }>
<TextInput value={ props.upload.options.secret_access_key || '' }
type="password" aria-label="amazon secret access key" id="amazon-access-secret"
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { secret_access_key: value })) }/>
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { secret_access_key: value })) } />
</FormGroup>
<FormGroup isRequired label="Service" fieldId="amazon-service">
<FormSelect value={ props.upload.options.service } aria-label="Select amazon service" id="amazon-service"
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { service: value })) } >
{ serviceOptions.map(option => <FormSelectOption key={ option.value } value={ option.value } label={ option.label }/>) }
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { service: value })) }>
{ serviceOptions.map(option => <FormSelectOption key={ option.value } value={ option.value } label={ option.label } />) }
</FormSelect>
</FormGroup>
<FormGroup isRequired label="Region" fieldId="amazon-region"
helperTextInvalid={ (props.errors['amazon-region'] && props.errors['amazon-region'].value) || '' }
validated={ (props.errors['amazon-region'] && 'error') || 'default' }>
<TextInput value={ props.upload.options.region } type="text" aria-label="amazon region" id="amazon-region"
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { region: value })) }/>
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { region: value })) } />
</FormGroup>
{ props.upload.options.service === 's3' &&
<FormGroup isRequired label="Bucket" fieldId="amazon-bucket"
helperTextInvalid={ (props.errors['amazon-bucket'] && props.errors['amazon-bucket'].value) || '' }
validated={ (props.errors['amazon-bucket'] && 'error') || 'default' }>
<TextInput value={ props.upload.options.bucket || '' } type="text" aria-label="amazon bucket" id="amazon-bucket"
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { bucket: value })) }/>
onChange={ value => props.setUploadOptions(Object.assign(props.upload.options, { bucket: value })) } />
</FormGroup> }
</>
);
@ -107,11 +107,11 @@ const UploadComponent = (props) => {
<FormGroup isRequired label="Destination" fieldId="upload-destination">
<FormSelect value={ props.upload.type || '' } id="upload-destination"
onChange={ value => props.setUpload({ type: value, options: null }) } aria-label="Select upload destination">
{ uploadTypes.map(type => <FormSelectOption key={ type.value } value={ type.value } label={ type.label }/>) }
{ uploadTypes.map(type => <FormSelectOption key={ type.value } value={ type.value } label={ type.label } />) }
</FormSelect>
</FormGroup>
{ props.upload.type === 'aws' &&
<AmazonUploadComponent upload={ props.upload } setUploadOptions={ props.setUploadOptions } errors={ props.errors }/> }
<AmazonUploadComponent upload={ props.upload } setUploadOptions={ props.setUploadOptions } errors={ props.errors } /> }
</Form>
</>
);
@ -130,7 +130,7 @@ const SubscriptionComponent = (props) => {
<FormGroup isRequired label="Register the system" fieldId="subscribe-radio">
<Radio name="subscribe-radio" isChecked={ props.subscribeNow } id="subscribe-radio"
label="Embed an activation key and register systems on first boot"
onChange={ () => props.setSubscribeNow(true) }/>
onChange={ () => props.setSubscribeNow(true) } />
<Radio name="subscribe-radio" isChecked={ !props.subscribeNow }
label="Register the system later" id="subscribe-radio"
onChange={ () => props.setSubscribeNow(false) } />
@ -143,10 +143,10 @@ const SubscriptionComponent = (props) => {
</FormGroup>
<FormGroup isRequired label="Activation key" fieldId="subscription-activation"
helperTextInvalid={ (props.errors['subscription-activation'] && props.errors['subscription-activation'].value) || '' }
validated={ (props.errors['subscription-activation'] && 'error') || 'default' } >
validated={ (props.errors['subscription-activation'] && 'error') || 'default' }>
<TextInput value={ props.subscription['activation-key'] || '' } type="password"
id="subscription-activation" aria-label="Subscription activation key"
onChange={ value => props.setSubscription(Object.assign(props.subscription, { 'activation-key': value })) }/>
onChange={ value => props.setSubscription(Object.assign(props.subscription, { 'activation-key': value })) } />
</FormGroup>
</> }
</Form>
@ -197,7 +197,7 @@ const ReviewComponent = (props) => {
{ error.label }
</FlexItem>
<FlexItem breakpointMods={ [{ modifier: FlexModifiers['flex-2'] }] }>
<ExclamationCircleIcon className="error"/> { error.value }
<ExclamationCircleIcon className="error" /> { error.value }
</FlexItem>
</Flex>);
})}
@ -221,7 +221,7 @@ const ReviewComponent = (props) => {
{ error.label }
</FlexItem>
<FlexItem breakpointMods={ [{ modifier: FlexModifiers['flex-2'] }] }>
<ExclamationCircleIcon className="error"/> { error.value }
<ExclamationCircleIcon className="error" /> { error.value }
</FlexItem>
</Flex>);
})}

View file

@ -79,8 +79,7 @@ class ImagesTable extends Component {
aria-label="Images"
rows={ rows }
cells={ this.state.columns }
data-testid="images-table"
>
data-testid="images-table">
<TableHeader />
<TableBody />
</Table>

View file

@ -10,7 +10,7 @@ import getBaseName from './Utilities/getBaseName';
ReactDOM.render(
<Provider store={ init(logger).getStore() }>
<Router basename={ getBaseName(window.location.pathname) }>
<App/>
<App />
</Router>
</Provider>,