Skip to content

Commit 63dedea

Browse files
committed
chore(*): update eslint and run lint
1 parent 7cb1864 commit 63dedea

File tree

191 files changed

+1237
-1210
lines changed

Some content is hidden

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

191 files changed

+1237
-1210
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1",
2626
"@evilmartians/lefthook": "^1.8.1",
2727
"@kong/design-tokens": "1.17.3",
28-
"@kong/eslint-config-kong-ui": "^1.1.2",
28+
"@kong/eslint-config-kong-ui": "^1.2.8",
2929
"@kong/kongponents": "9.29.9",
3030
"@stylistic/stylelint-plugin": "^3.1.1",
3131
"@types/flat": "^5.0.5",
@@ -43,7 +43,7 @@
4343
"cross-env": "^7.0.3",
4444
"cypress": "^13.15.1",
4545
"cz-conventional-changelog": "^3.3.0",
46-
"eslint": "^9.14.0",
46+
"eslint": "^9.25.1",
4747
"js-yaml": "^4.1.0",
4848
"jsdom": "^25.0.1",
4949
"lerna": "^8.1.8",

packages/analytics/analytics-chart/sandbox/pages/BarChartDemo.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ enum Metrics {
238238
}
239239
240240
interface MetricSelection {
241-
name: Metrics,
242-
unit: string,
241+
name: Metrics
242+
unit: string
243243
}
244244
245245
// Inject the app-links from the entry file

packages/analytics/analytics-chart/sandbox/pages/DonutChartDemo.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<KLabel>Dataset options</KLabel>
5555
<div class="dataset-options">
5656
<KButton
57-
appearance="outline"
57+
appearance="secondary"
5858
size="small"
5959
@click="addDataset()"
6060
>
@@ -175,8 +175,8 @@ enum Metrics {
175175
}
176176
177177
interface MetricSelection {
178-
name: Metrics,
179-
unit: string,
178+
name: Metrics
179+
unit: string
180180
}
181181
182182
// Inject the app-links from the entry file

packages/analytics/analytics-chart/sandbox/pages/TimeSeriesChartDemo.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,8 @@ enum Metrics {
274274
}
275275
276276
interface MetricSelection {
277-
name: Metrics,
278-
unit: string,
277+
name: Metrics
278+
unit: string
279279
}
280280
281281
// Inject the app-links from the entry file

packages/analytics/analytics-chart/src/components/AnalyticsChart.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const props = defineProps({
198198
})
199199
200200
const emit = defineEmits<{
201-
(e: 'zoom-time-range', newTimeRange: AbsoluteTimeRangeV4): void,
201+
(e: 'zoom-time-range', newTimeRange: AbsoluteTimeRangeV4): void
202202
}>()
203203
204204
const { i18n } = composables.useI18n()

packages/analytics/analytics-chart/src/components/CsvExportModal.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ import type { CsvData, Header, TimeseriesColumn } from '../types'
9292
const { i18n } = composables.useI18n()
9393
9494
const props = withDefaults(defineProps<{
95-
filename: string,
96-
modalDescription?: string,
97-
chartData: ExploreResultV4,
95+
filename: string
96+
modalDescription?: string
97+
chartData: ExploreResultV4
9898
}>(), {
9999
modalDescription: undefined,
100100
})
@@ -185,7 +185,7 @@ const tableData = computed(() => {
185185
]
186186
187187
interface AccumulatorRow {
188-
[key: string]: string;
188+
[key: string]: string
189189
}
190190
191191
const csvHeaders: Record<string, string> = displayHeaders.reduce((accum: AccumulatorRow, h: TimeseriesColumn) => {

packages/analytics/analytics-chart/src/components/DownloadCsv.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import type { CsvData } from '../types'
1717
import VueJsonCsv from './vue-json-csv/VueJsonCsv.vue'
1818
1919
const props = defineProps<{
20-
rows: CsvData,
21-
headers: Record<string, string>,
22-
filename: string,
20+
rows: CsvData
21+
headers: Record<string, string>
22+
filename: string
2323
}>()
2424
2525
const fields = computed(() => Object.keys(props.headers))

packages/analytics/analytics-chart/src/components/chart-types/StackedBarChart.vue

+1
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ const chartInstance = composables.useChartJSCommon(
438438
const maxOverflow = computed(() => {
439439
// Need this reactive dependency to re-compute the max overflow when the chart updates.
440440
441+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
441442
dependsOnChartUpdate.value
442443
443444
// ChartJS says that labels are optional, but we always provide them.

packages/analytics/analytics-chart/src/components/chart-types/TimeSeriesChart.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const props = defineProps({
154154
})
155155
156156
const emit = defineEmits<{
157-
(e: 'zoom-time-range', newTimeRange: AbsoluteTimeRangeV4): void,
157+
(e: 'zoom-time-range', newTimeRange: AbsoluteTimeRangeV4): void
158158
}>()
159159
160160
const verticalLinePlugin = new VerticalLinePlugin()
@@ -290,6 +290,7 @@ onUnmounted(() => {
290290
chartInstance.value.chart.canvas.removeEventListener('dragSelectMove', handleDragMove)
291291
}
292292
293+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
293294
verticalLinePlugin
294295
})
295296

packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { saveAs } from 'file-saver'
2020
import { unparse } from 'papaparse'
2121
2222
const emit = defineEmits<{
23-
(event: 'export-started', data: CsvData): void,
24-
(event: 'export-finished', data: string): void,
23+
(event: 'export-started', data: CsvData): void
24+
(event: 'export-finished', data: string): void
2525
}>()
2626
2727
const props = defineProps({
@@ -89,7 +89,7 @@ const exportableData: ComputedRef<CsvData | null> = computed(() => {
8989
})
9090
9191
// Replaces the keys in the key/value pairs with more human-readable ones (if provided)
92-
// eslint-disable-next-line @typescript-eslint/ban-types
92+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
9393
const labelsFunctionGenerator = (): Function => {
9494
const labels: any = props.labels
9595
@@ -98,7 +98,7 @@ const labelsFunctionGenerator = (): Function => {
9898
}
9999
100100
if (typeof labels as ValidType === ValidType.Object) {
101-
// eslint-disable-next-line @typescript-eslint/ban-types
101+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
102102
return (item: Function) => {
103103
return mapKeys(item, (item, key) => {
104104
return labels[key] || key
@@ -111,7 +111,7 @@ const labelsFunctionGenerator = (): Function => {
111111
}
112112
113113
// Trims each data row based, keeping only the columns (fields) passed in
114-
// eslint-disable-next-line @typescript-eslint/ban-types
114+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
115115
const fieldsFunctionGenerator = (): Function => {
116116
const fields: any = props.fields
117117
if (typeof props.fields as ValidType !== ValidType.Object && !Array.isArray(fields)) {
@@ -120,7 +120,7 @@ const fieldsFunctionGenerator = (): Function => {
120120
121121
if (Array.isArray(fields)) {
122122
// Keep only requested object properties
123-
// eslint-disable-next-line @typescript-eslint/ban-types
123+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
124124
return (item: Function) => {
125125
return pick(item, fields)
126126
}

packages/analytics/analytics-chart/src/composables/useBarChartOptions.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ export default function useBarChartOptions(chartOptions: BarChartOptions) {
203203

204204
declare module 'chart.js' {
205205
interface TooltipPositionerMap {
206-
[key: string]: TooltipPositionerFunction<ChartType>;
206+
[key: string]: TooltipPositionerFunction<ChartType>
207207
}
208208
interface InteractionModeMap {
209-
customInteractionMode: InteractionModeFunction;
209+
customInteractionMode: InteractionModeFunction
210210
}
211211
}

packages/analytics/analytics-chart/src/composables/useDonutChartOptions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,6 @@ export default function useDonutChartOptions(chartOptions: DonutChartOptions) {
8787

8888
declare module 'chart.js' {
8989
interface TooltipPositionerMap {
90-
[key: string]: TooltipPositionerFunction<ChartType>;
90+
[key: string]: TooltipPositionerFunction<ChartType>
9191
}
9292
}

packages/analytics/analytics-chart/src/composables/useLineChartOptions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,6 @@ export default function useLinechartOptions(chartOptions: LineChartOptions) {
176176

177177
declare module 'chart.js' {
178178
interface TooltipPositionerMap {
179-
[key: string]: TooltipPositionerFunction<ChartType>;
179+
[key: string]: TooltipPositionerFunction<ChartType>
180180
}
181181
}

packages/analytics/analytics-chart/src/types/chart-data.ts

+26-26
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import type { ExploreAggregations } from '@kong-ui-public/analytics-utilities'
55

66
// Chart.js extended interfaces
77
export type Dataset = ChartDataset & {
8-
rawDimension: string,
9-
rawMetric?: string,
10-
total?: number,
11-
lineTension?: number,
12-
fill?: boolean,
13-
isThreshold?: boolean,
14-
isSegmentEmpty?: boolean,
8+
rawDimension: string
9+
rawMetric?: string
10+
total?: number
11+
lineTension?: number
12+
fill?: boolean
13+
isThreshold?: boolean
14+
isSegmentEmpty?: boolean
1515
}
1616

1717
export interface KChartData extends ChartData {
@@ -21,8 +21,8 @@ export interface KChartData extends ChartData {
2121
}
2222

2323
export interface AnalyticsDataPoint {
24-
x: number,
25-
y: number,
24+
x: number
25+
y: number
2626
}
2727

2828
/**
@@ -38,9 +38,9 @@ export interface AnalyticsChartColors {
3838
}
3939

4040
export interface LegendValueEntry {
41-
raw: number,
42-
formatted: string,
43-
isThreshold?: boolean,
41+
raw: number
42+
formatted: string
43+
isThreshold?: boolean
4444
}
4545

4646
/**
@@ -70,33 +70,33 @@ export interface AnalyticsChartOptions {
7070
* If stacked, the datasets are stacked on top of each other.
7171
* Applies to timeseries charts as well as bar charts.
7272
*/
73-
stacked?: boolean,
73+
stacked?: boolean
7474
/**
7575
* Title to display for the metric axis
7676
* If not provided, show nothing
7777
*/
78-
metricAxesTitle?: string,
78+
metricAxesTitle?: string
7979
/**
8080
* Title to display for the dimension axis
8181
* If not provided, show nothing
8282
*/
83-
dimensionAxesTitle?: string,
83+
dimensionAxesTitle?: string
8484
/**
8585
* Chart dataset color palette
8686
*/
87-
chartDatasetColors?: AnalyticsChartColors | string[],
87+
chartDatasetColors?: AnalyticsChartColors | string[]
8888
/**
8989
* Sort the datasets as they are displayed in the legend and tooltip
9090
*/
91-
chartLegendSortFn?: ChartLegendSortFn,
91+
chartLegendSortFn?: ChartLegendSortFn
9292
/**
9393
* Sort tooltip entries
9494
*/
95-
chartTooltipSortFn?: ChartTooltipSortFn,
95+
chartTooltipSortFn?: ChartTooltipSortFn
9696
/**
9797
* A static or dynamic metric threshold to be displayed on a timeseries chart
9898
*/
99-
threshold?: Record<ExploreAggregations, number>,
99+
threshold?: Record<ExploreAggregations, number>
100100
}
101101

102102
/**
@@ -117,23 +117,23 @@ export interface SimpleChartOptions {
117117
/**
118118
* Chart dataset color palette
119119
*/
120-
chartDatasetColors?: AnalyticsChartColors | string[],
120+
chartDatasetColors?: AnalyticsChartColors | string[]
121121
/**
122122
* Determines how much detail about the metric (eg: value, info text, etc) is to be shown in the center
123123
*/
124-
metricDisplay?: SimpleChartMetricDisplay,
124+
metricDisplay?: SimpleChartMetricDisplay
125125
/**
126126
* Determines whether the dataset order will be reversed
127127
*/
128-
reverseDataset?: boolean,
128+
reverseDataset?: boolean
129129
/**
130130
* Determines which dataset value will be display as large text
131131
*/
132-
numerator?: number,
132+
numerator?: number
133133
/**
134134
* Determines number of decimal points to display in SingleValue chart
135135
*/
136-
decimalPoints?: number,
136+
decimalPoints?: number
137137
}
138138

139139
export interface LegendValues {
@@ -148,8 +148,8 @@ export interface DonutChartData {
148148
}
149149

150150
export interface DatasetLabel {
151-
name: string,
152-
id: string,
151+
name: string
152+
id: string
153153
}
154154

155155
export interface TopNTableRecord {

packages/analytics/analytics-chart/src/types/chart-export.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export interface Header {
1616
}
1717

1818
export interface TimeseriesColumn {
19-
label: string;
20-
key: string;
19+
label: string
20+
key: string
2121
}
2222

2323
export type CsvData = CsvKeyValuePair[]

0 commit comments

Comments
 (0)