ESlint: React fixes part 1 (#29062)

* Eslint: allign with latest grafana-eslint-config

* fix ts

* Fix react/jsx-key

* Fix react/no-children-prop

* Fix react/jsx-no-target-blank
This commit is contained in:
Dominik Prokop
2020-11-18 15:36:35 +01:00
committed by GitHub
parent 4b711372c5
commit 0cfb967404
29 changed files with 70 additions and 50 deletions

View File

@@ -26,9 +26,10 @@ export default class AppNotificationItem extends Component<Props> {
<Alert
severity={appNotification.severity}
title={appNotification.title}
children={appNotification.component || appNotification.text}
onRemove={() => onClearNotification(appNotification.id)}
/>
>
{appNotification.component || appNotification.text}
</Alert>
);
}
}

View File

@@ -64,7 +64,7 @@ export class ErrorPage extends PureComponent<Props> {
</p>
<p>
If the error persists, seek help on the{' '}
<a href="https://community.grafana.com" target="_blank" className="error-link">
<a href="https://community.grafana.com" target="_blank" rel="noreferrer" className="error-link">
community site
</a>
.

View File

@@ -51,7 +51,7 @@ const Navigation = ({ children }: { children: NavModelItem[] }) => {
return (
<nav>
<SelectNav customCss="page-header__select-nav" children={children} />
<SelectNav customCss="page-header__select-nav">{children}</SelectNav>
<TabsBar className="page-header__tabs" hideBorder={true}>
{children.map((child, index) => {
return (
@@ -147,7 +147,7 @@ export default class PageHeader extends React.Component<Props, any> {
<div className="page-container">
<div className="page-header">
{this.renderHeaderTitle(main)}
{children && children.length && <Navigation children={children} />}
{children && children.length && <Navigation>{children}</Navigation>}
</div>
</div>
</div>