Skip to content

Commit 05575dd

Browse files
authored
chore: lint (#879)
1 parent 2bd40e4 commit 05575dd

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

examples/react-renderer/src/Autocomplete.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { Hit } from '@algolia/client-search';
88
import algoliasearch from 'algoliasearch/lite';
99
import React from 'react';
1010

11-
import { Highlight } from './Highlight';
1211
import { ClearIcon } from './ClearIcon';
12+
import { Highlight } from './Highlight';
1313
import { SearchIcon } from './SearchIcon';
1414

1515
const searchClient = algoliasearch(
@@ -170,9 +170,7 @@ export function Autocomplete(
170170
/>
171171
</div>
172172
<div className="aa-ItemContentBody">
173-
<div
174-
className="aa-ItemContentTitle"
175-
>
173+
<div className="aa-ItemContentTitle">
176174
<Highlight hit={item} attribute="name" />
177175
</div>
178176
<div className="aa-ItemContentDescription">

examples/react-renderer/src/Highlight.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createElement, Fragment } from "react";
2-
import { parseAlgoliaHitHighlight } from "@algolia/autocomplete-preset-algolia";
1+
import { parseAlgoliaHitHighlight } from '@algolia/autocomplete-preset-algolia';
2+
import { createElement, Fragment } from 'react';
33

44
type HighlightHitParams<THit> = {
55
/**
@@ -23,14 +23,16 @@ type HighlightHitParams<THit> = {
2323
export function Highlight<THit>({
2424
hit,
2525
attribute,
26-
tagName = "mark",
26+
tagName = 'mark',
2727
}: HighlightHitParams<THit>): JSX.Element {
2828
return createElement(
2929
Fragment,
3030
{},
3131
parseAlgoliaHitHighlight<THit>({ hit, attribute }).map(
3232
({ value, isHighlighted }, index) => {
33-
if (isHighlighted) return createElement(tagName, { key: index }, value);
33+
if (isHighlighted) {
34+
return createElement(tagName, { key: index }, value);
35+
}
3436

3537
return value;
3638
}

0 commit comments

Comments
 (0)