Skip to content

Commit a4591a8

Browse files
committed
[ui] fix linting errors + replace eslint by biome
1 parent e400b5c commit a4591a8

File tree

22 files changed

+92
-1282
lines changed

22 files changed

+92
-1282
lines changed

.github/workflows/ui-ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ jobs:
3838
yarn --cwd quickwit-ui cypress run
3939
- name: Lint
4040
command: yarn --cwd quickwit-ui lint
41-
- name: Check formatting
42-
command: yarn --cwd quickwit-ui check-formatting
4341
- name: Check type consistency
4442
command: yarn --cwd quickwit-ui type
4543
- name: Unit Test

quickwit/quickwit-ui/biome.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,21 @@
55
"indentStyle": "space",
66
"includes": ["**", "!**/build"]
77
},
8-
"linter": { "enabled": false }
8+
"linter": {
9+
"enabled": true,
10+
"rules": {
11+
"recommended": true,
12+
"style": "off",
13+
"complexity": "off",
14+
"correctness": {
15+
"useExhaustiveDependencies": "warn"
16+
},
17+
"suspicious": {
18+
"useIterableCallbackReturn": "off",
19+
"noExplicitAny": "off",
20+
"noArrayIndexKey": "off"
21+
}
22+
},
23+
"includes": ["**", "!**/build"]
24+
}
925
}

quickwit/quickwit-ui/package.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@
2323
"@types/react": "17.0.65",
2424
"@types/react-dom": "17.0.18",
2525
"@types/swagger-ui-react": "4.18.2",
26-
"@typescript-eslint/eslint-plugin": "6.8.0",
27-
"@typescript-eslint/parser": "6.8.0",
2826
"babel-jest": "30.2.0",
2927
"babel-preset-react-app": "10.1.0",
3028
"cypress": "13.3.2",
3129
"dayjs": "1.11.7",
32-
"eslint": "8.3.0",
33-
"eslint-config-react-app": "7.0.1",
3430
"jest": "30.2.0",
3531
"jest-environment-jsdom": "30.2.0",
3632
"jest-transform-stub": "2.0.0",
@@ -57,16 +53,9 @@
5753
"start": "vite",
5854
"build": "vite build --outDir build",
5955
"test": "jest",
60-
"lint": "eslint . --ext .ts",
61-
"check-formatting": "biome check",
56+
"lint": "biome check",
6257
"format": "biome check --write",
6358
"type": "tsc",
6459
"e2e-test": "cypress run"
65-
},
66-
"eslintConfig": {
67-
"extends": [
68-
"react-app",
69-
"react-app/jest"
70-
]
7160
}
7261
}

quickwit/quickwit-ui/src/components/ApiUrlFooter.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const Footer = styled(Box)`
3030
export default function ApiUrlFooter(url: string) {
3131
const urlMaxLength = 80;
3232
const origin =
33-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
3433
// @ts-ignore
3534
process.env.NODE_ENV === "development"
3635
? "http://localhost:7280"

quickwit/quickwit-ui/src/components/IndexSummary.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@ import { Index } from "../utils/models";
2323
dayjs.extend(utc);
2424

2525
const ItemContainer = styled.div`
26-
padding: 10px;
27-
display: flex;
28-
flex-direction: column;
26+
padding: 10px;
27+
display: flex;
28+
flex-direction: column;
2929
`;
3030
const Row = styled.div`
31-
padding: 5px;
32-
display: flex;
33-
flex-direction: row;
34-
&:nth-of-type(odd){ background: rgba(0,0,0,0.05) }
31+
padding: 5px;
32+
display: flex;
33+
flex-direction: row;
34+
&:nth-of-type(odd) {
35+
background: rgba(0, 0, 0, 0.05);
36+
}
3537
`;
3638
const RowKey = styled.div`
37-
width: 350px;
39+
width: 350px;
3840
`;
3941
const IndexRow: FC<{ title: string; children: ReactNode }> = ({
4042
title,
@@ -49,13 +51,13 @@ const IndexRow: FC<{ title: string; children: ReactNode }> = ({
4951
export function IndexSummary({ index }: { index: Index }) {
5052
const all_splits = index.splits;
5153
const published_splits = all_splits.filter(
52-
(split) => split.split_state == "Published",
54+
(split) => split.split_state === "Published",
5355
);
5456
const num_of_staged_splits = all_splits.filter(
55-
(split) => split.split_state == "Staged",
57+
(split) => split.split_state === "Staged",
5658
).length;
5759
const num_of_marked_for_delete_splits = all_splits.filter(
58-
(split) => split.split_state == "MarkedForDeletion",
60+
(split) => split.split_state === "MarkedForDeletion",
5961
).length;
6062
const total_num_docs = published_splits
6163
.map((split) => split.num_docs)

quickwit/quickwit-ui/src/components/IndexesTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const IndexesTable = ({
3232
indexesMetadata,
3333
}: Readonly<{ indexesMetadata: IndexMetadata[] }>) => {
3434
const navigate = useNavigate();
35-
const handleClick = function (indexId: string) {
35+
const handleClick = (indexId: string) => {
3636
navigate(`/indexes/${indexId}`);
3737
};
3838

quickwit/quickwit-ui/src/components/Loader.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
import { Box, keyframes, styled } from "@mui/material";
16-
import logo_url from "../assets/img/logo.svg";
16+
import loadinIcongUrl from "../assets/img/quickwit-logo-monochrome.svg";
1717

1818
const spin = keyframes`
1919
from {
@@ -24,15 +24,15 @@ to {
2424
}
2525
`;
2626

27-
const Logo = (props: React.ComponentProps<"img">) => (
28-
<img {...props} src={logo_url} />
27+
const LoadingIcon = (props: React.ComponentProps<"img">) => (
28+
<img {...props} src={loadinIcongUrl} alt="loading icon" />
2929
);
3030

31-
const SpinningLogo = styled(Logo)`
32-
height: 10vmin;
33-
pointer-events: none;
34-
fill: #CBD1DD;
35-
animation: ${spin} infinite 5s linear;
31+
const SpinningLoadingIcon = styled(LoadingIcon)`
32+
height: 10vmin;
33+
pointer-events: none;
34+
fill: #cbd1dd;
35+
animation: ${spin} infinite 5s linear;
3636
`;
3737

3838
export default function Loader() {
@@ -43,7 +43,7 @@ export default function Loader() {
4343
alignItems="center"
4444
minHeight="40vh"
4545
>
46-
<SpinningLogo></SpinningLogo>
46+
<SpinningLoadingIcon></SpinningLoadingIcon>
4747
</Box>
4848
);
4949
}

quickwit/quickwit-ui/src/components/QueryActionBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function QueryEditorActionBar(props: SearchComponentProps) {
2525
const handleChange = (_event: React.SyntheticEvent, newTab: number) => {
2626
const updatedSearchRequest = {
2727
...props.searchRequest,
28-
aggregation: newTab != 0,
28+
aggregation: newTab !== 0,
2929
};
3030
props.onSearchRequestUpdate(updatedSearchRequest);
3131
props.runSearch(updatedSearchRequest);

0 commit comments

Comments
 (0)