Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter: allow expressions in JSX fragment #621

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-undef": "error",
"react/jsx-no-useless-fragment": "warn",
"react/jsx-no-useless-fragment": [
"warn",
{
"allowExpressions": true
}
],
"react/jsx-pascal-case": "error",
"react/jsx-props-no-multi-spaces": "error",
"react/jsx-tag-spacing": [
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/Loader/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Loader extends Component {
{isLoading ? (
<UILoader active size="huge" inline="centered" />
) : (
// eslint-disable-next-line react/jsx-no-useless-fragment
<>{children}</>
)}
</Overridable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ export class OrderDocumentRequest extends React.Component {
render() {
const { documentRequest, isLoading, hasError } = this.state;
return (
<>
<Loader isLoading={isLoading}>
{hasError
? this.renderError()
: this.renderResultsOrEmpty(documentRequest)}
</Loader>
</>
<Loader isLoading={isLoading}>
{hasError
? this.renderError()
: this.renderResultsOrEmpty(documentRequest)}
</Loader>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ export default class DocumentPurchaseOrders extends Component {
render() {
const { orders, isLoading, hasError } = this.state;
return (
<>
<Loader isLoading={isLoading}>
{hasError ? this.renderError() : this.renderResultsOrEmpty(orders)}
</Loader>
</>
<Loader isLoading={isLoading}>
{hasError ? this.renderError() : this.renderResultsOrEmpty(orders)}
</Loader>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,14 @@ class SeriesPanel extends Component {
/>

{series.metadata.publisher && (
<>
<div>
Published by <b>{series.metadata.publisher}</b>
{series.metadata.publication_year && (
<>
, <b>{series.metadata.publication_year}</b>
</>
)}
</div>
</>
<div>
Published by <b>{series.metadata.publisher}</b>
{series.metadata.publication_year && (
<>
, <b>{series.metadata.publication_year}</b>
</>
)}
</div>
)}
</ILSParagraphPlaceholder>
<ILSParagraphPlaceholder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,14 @@ class SeriesPanelMobile extends Component {
authors={series.metadata.authors}
/>
{series.metadata.publisher && (
<>
<div>
Published by <b>{series.metadata.publisher}</b>
{series.metadata.publication_year && (
<>
, <b>{series.metadata.publication_year}</b>
</>
)}
</div>
</>
<div>
Published by <b>{series.metadata.publisher}</b>
{series.metadata.publication_year && (
<>
, <b>{series.metadata.publication_year}</b>
</>
)}
</div>
)}
</ILSParagraphPlaceholder>
<ILSParagraphPlaceholder linesNumber={1} isLoading={isLoading}>
Expand Down
Loading