Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit ef4d635

Browse files
authored
fix: ESLint issues (#387)
Also add action to test on each PR
1 parent aa9de6d commit ef4d635

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+115
-108
lines changed

.github/workflows/prettier.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
name: Continuous Integration
22

3-
on: pull_request
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
48

59
jobs:
610
prettier:
11+
timeout-minutes: 60
712
runs-on: ubuntu-latest
8-
913
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v4
12-
- name: Prettify code
13-
uses: creyD/[email protected]
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: lts/*
18+
- name: Install dependencies
19+
run: npm install -g pnpm && pnpm install
20+
- name: Run ESLint
21+
run: pnpm run lint

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"dev": "vite --host --port 3001",
88
"build": "tsc && vite build",
99
"build:test": "tsc && vite build --mode test",
10-
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --quiet",
1111
"start": "vite preview --host --port 3002",
1212
"tsCheck": "tsc --noEmit",
1313
"pq": "pretty-quick",

src/@types/parseable/api/dashboards.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ export type TickConfig = {
4444
export type Visualization = {
4545
visualization_type: VizType;
4646
size: TileSize;
47-
circular_chart_config?: null | { name_key: string; value_key: string } | {};
47+
circular_chart_config?: null | { name_key: string; value_key: string } | object;
4848
graph_config?:
4949
| null
5050
| { x_key: string; y_keys: string[]; type: CommonGraphBasicType; orientation: CommonGraphOrientationType }
51-
| {};
51+
| object;
5252
color_config: ColorConfig[];
5353
tick_config: TickConfig[];
5454
};
@@ -116,9 +116,9 @@ export type BarChartBasicTypes = 'default' | 'stacked' | 'percent';
116116
export type AreaChartBasicTypes = 'default' | 'stacked' | 'percent';
117117

118118
// orientation
119-
export type BarChartOrientationType = 'horizontal' | 'vertical'
120-
export type AreaChartOrientationType = 'horizontal' | 'vertical'
121-
export type LineChartOrientationType = 'horizontal' | 'vertical'
119+
export type BarChartOrientationType = 'horizontal' | 'vertical';
120+
export type AreaChartOrientationType = 'horizontal' | 'vertical';
121+
export type LineChartOrientationType = 'horizontal' | 'vertical';
122122

123123
export type BarChartProps = {
124124
data: TileData;
@@ -137,7 +137,7 @@ export type LineChartProps = {
137137
xUnit: UnitType;
138138
yUnit: UnitType;
139139
orientation: LineChartOrientationType;
140-
}
140+
};
141141

142142
export type AreaChartProps = {
143143
data: TileData;

src/@types/parseable/api/stream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export type HotTierConfig =
5353
available_size: string;
5454
oldest_date_time_entry: string;
5555
}
56-
| {};
56+
| object;
5757

5858
export type UpdateHotTierConfig = {
5959
size: string;

src/api/auth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ export const loginIn = (username: string, password: string) => {
1313

1414
export const logOut = () => {
1515
return Axios().get(LOGOUT_URL);
16-
}
16+
};

src/api/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import _ from 'lodash';
22

33
const API_V1 = 'api/v1';
44

5-
export type Params = Record<string, string> | null | {} | undefined;
5+
export type Params = Record<string, string> | null | object | undefined;
66

77
const parseParamsToQueryString = (params: Params) => {
88
if (_.isEmpty(params) || _.isNil(params) || !params) return '';
@@ -20,7 +20,7 @@ const parseParamsToQueryString = (params: Params) => {
2020
// Streams Management
2121
export const LOG_STREAM_LIST_URL = `${API_V1}/logstream`;
2222
export const LOG_STREAMS_SCHEMA_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/schema`;
23-
export const LOG_QUERY_URL = (params?: Params, resourcePath: string = 'query') =>
23+
export const LOG_QUERY_URL = (params?: Params, resourcePath = 'query') =>
2424
`${API_V1}/${resourcePath}` + parseParamsToQueryString(params);
2525
export const LOG_STREAMS_ALERTS_URL = (streamName: string) => `${LOG_STREAM_LIST_URL}/${streamName}/alert`;
2626
export const LIST_SAVED_FILTERS_URL = `${API_V1}/filters`;

src/api/query.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import _ from 'lodash';
21
import { Axios } from './axios';
32
import { LOG_QUERY_URL } from './constants';
43
import { Log, LogsQuery, LogsResponseWithHeaders } from '@/@types/parseable/api/query';

src/assets/customLoader/ParseableAnimate.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,6 @@ const ParseableAnimated: MantineLoaderComponent = forwardRef(() => (
5757
</svg>
5858
));
5959

60+
ParseableAnimated.displayName = 'ParsableAnimated';
61+
6062
export default ParseableAnimated;

src/components/Header/RefreshInterval.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { appStoreReducers, useAppStore } from '@/layouts/MainLayout/providers/Ap
1212
const { setRefreshInterval, getCleanStoreForRefetch } = logsStoreReducers;
1313
const { syncTimeRange } = appStoreReducers;
1414
const RefreshInterval: FC = () => {
15-
const [, setAppStore] = useAppStore((_store) => null);
15+
const [, setAppStore] = useAppStore(() => null);
1616
const [refreshInterval, setLogsStore] = useLogsStore((store) => store.refreshInterval);
1717
const Icon = useMemo(() => (refreshInterval ? IconRefresh : IconRefreshOff), [refreshInterval]);
1818
const timerRef = useRef<NodeJS.Timer | null>(null);

src/components/Header/RefreshNow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const { syncTimeRange } = appStoreReducers;
1111
const renderRefreshIcon = () => <IconReload size={px('1rem')} stroke={1.5} />;
1212

1313
const RefreshNow: FC = () => {
14-
const [, setLogsStore] = useLogsStore((_store) => null);
15-
const [, setAppStore] = useAppStore((_store) => null);
14+
const [, setLogsStore] = useLogsStore(() => null);
15+
const [, setAppStore] = useAppStore(() => null);
1616

1717
const onRefresh = useCallback(() => {
1818
setAppStore((store) => syncTimeRange(store));

0 commit comments

Comments
 (0)