From 2e9ff8bc5aaed73c646bfaffff9db10b02b86c0d Mon Sep 17 00:00:00 2001 From: Adam DeHaven Date: Thu, 6 Jun 2024 09:36:06 -0400 Subject: [PATCH 1/2] feat(eslint): eslint v9 and shared configs [KHCP-11627] --- .eslintignore | 6 - .eslintrc.cjs | 106 -- eslint.config.mjs | 30 + package.json | 13 +- .../analytics/analytics-chart/package.json | 4 +- .../src/components/AnalyticsChart.vue | 6 +- .../chart-types/StackedBarChart.vue | 4 +- .../chart-types/TimeSeriesChart.vue | 4 +- .../components/vue-json-csv/VueJsonCsv.cy.ts | 6 +- .../components/vue-json-csv/VueJsonCsv.vue | 8 +- .../src/composables/useChartSelectedRange.ts | 4 +- .../useExploreResultToTimeDatasets.ts | 7 +- .../src/enums/chart-legend-position.enum.ts | 2 +- .../src/enums/chart-metric-display.enum.ts | 2 +- .../src/enums/chart-types-simple.enum.ts | 4 +- .../src/enums/chart-types.enum.ts | 4 +- .../src/utils/commonOptions.ts | 1 + .../analytics-chart/src/utils/customColors.ts | 2 +- .../analytics-config-store/package.json | 4 +- .../analytics-metric-provider/package.json | 4 +- .../src/enums/metric-card-size.enum.ts | 4 +- .../src/enums/metric-card-type.enum.ts | 2 +- .../analytics-utilities/package.json | 4 +- .../src/types/chart-types.ts | 4 +- .../src/types/timeframe-keys.ts | 4 +- .../src/utils/chartDataGenerator.ts | 2 +- .../analytics/dashboard-renderer/package.json | 4 +- packages/analytics/metric-cards/package.json | 4 +- .../analytics/metric-cards/src/constants.ts | 4 +- .../src/enums/metric-card-type.enum.ts | 2 +- .../portal-analytics-bridge/package.json | 4 +- .../core/app-layout/fixtures/sidebar-items.ts | 2 - packages/core/app-layout/package.json | 4 +- .../app-layout/src/components/AppLayout.cy.ts | 2 +- .../src/components/navbar/AppNavbar.cy.ts | 2 +- .../src/components/sidebar/AppSidebar.cy.ts | 2 +- .../src/components/sidebar/SidebarItem.vue | 2 +- packages/core/cli/package.json | 4 +- .../core/cli/src/__template__/package.json | 4 +- packages/core/cli/src/core/package.ts | 2 +- packages/core/core/package.json | 4 +- .../core/core/src/useDate/useDate.spec.ts | 6 +- packages/core/core/src/usePackage/index.ts | 8 +- packages/core/core/src/useSwrvState/index.ts | 2 +- .../core/core/src/useWindow/useWindow.spec.ts | 2 +- packages/core/documentation/package.json | 4 +- packages/core/documentation/sandbox/App.vue | 2 +- .../src/components/DocumentationContent.vue | 2 +- .../src/components/DocumentationDisplay.vue | 2 +- packages/core/documentation/src/helpers.ts | 4 +- .../documentation/src/types/document-list.ts | 4 +- packages/core/error-boundary/package.json | 4 +- .../components/AppCrashBuggyComponent.vue | 2 +- packages/core/error-boundary/sandbox/index.ts | 2 +- .../src/components/ErrorBoundary.vue | 2 +- packages/core/expressions/package.json | 4 +- packages/core/expressions/src/schema.ts | 2 +- packages/core/forms/package.json | 4 +- .../src/composables/useAbstractFields.ts | 1 + packages/core/forms/src/forms/ACMEForm.vue | 2 +- .../core/forms/src/forms/ExitTransformer.vue | 4 +- .../core/forms/src/forms/PostFunction.vue | 4 +- .../src/generator/fields/abstractField.ts | 3 +- .../__tests__/FieldAutoSuggest.spec.js | 7 +- .../src/generator/fields/core/fieldSubmit.vue | 1 + .../fields/optional/fieldGoogleAddress.vue | 4 +- .../fields/optional/fieldRangeSlider.vue | 1 + .../src/generator/utils/dateFieldHelper.ts | 2 +- .../core/forms/src/generator/utils/schema.ts | 2 +- .../forms/src/generator/utils/validators.ts | 10 +- packages/core/i18n/package.json | 4 +- packages/core/i18n/src/Translation.ts | 2 +- packages/core/i18n/src/i18n.spec.ts | 6 +- packages/core/i18n/src/i18n.ts | 2 +- packages/core/misc-widgets/package.json | 4 +- packages/core/sandbox-layout/package.json | 4 +- .../entities-certificates/package.json | 4 +- .../package.json | 4 +- .../fixtures/mockData.ts | 2 +- .../entities-consumer-groups/package.json | 4 +- .../src/types/consumer-group-form.ts | 2 +- .../entities-consumers/fixtures/mockData.ts | 2 +- .../entities/entities-consumers/package.json | 4 +- .../src/types/consumer-form.ts | 2 +- .../entities-data-plane-nodes/package.json | 4 +- .../src/composables/useAsyncScheduler.ts | 4 +- .../entities-gateway-services/package.json | 4 +- .../src/composables/getPortFromProtocol.ts | 4 +- .../entities/entities-key-sets/package.json | 4 +- packages/entities/entities-keys/package.json | 4 +- .../entities/entities-plugins/package.json | 4 +- .../src/components/PluginEntityForm.vue | 4 +- .../src/components/PluginSelect.vue | 2 +- .../src/composables/useSchemas.ts | 2 +- .../src/definitions/schemas/typedefs.ts | 8 +- .../entities-plugins/src/types/plugin-form.ts | 2 +- .../src/types/plugins/acl.d.ts | 2 +- .../src/types/plugins/basic-auth.d.ts | 2 +- .../graphql-rate-limiting-advanced.d.ts | 2 +- .../src/types/plugins/hmac-auth.d.ts | 2 +- .../src/types/plugins/jwt.d.ts | 4 +- .../src/types/plugins/key-auth.d.ts | 2 +- .../src/types/plugins/pre-function.d.ts | 14 +- .../plugins/request-transformer-advaced.d.ts | 32 +- .../src/types/plugins/stats-d.d.ts | 1 + .../entities/entities-routes/package.json | 4 +- .../src/components/RouteList.vue | 2 +- .../entities-routes/src/types/method-badge.ts | 2 +- .../entities-routes/src/types/route-form.ts | 4 +- .../entities/entities-shared/package.json | 4 +- .../components/SandboxPermissionsControl.vue | 3 +- .../ConfigCardDisplay.vue | 2 +- .../ConfigCardItem.vue | 5 +- .../entity-base-table/EntityBaseTable.vue | 4 +- .../EntityToggleModal.cy.ts | 4 +- .../src/composables/useExternalLinkCreator.ts | 2 +- .../src/composables/useFetchUrlBuilder.ts | 2 - .../src/types/entity-delete-modal.ts | 2 +- .../entities-shared/src/types/utils.ts | 2 +- packages/entities/entities-snis/package.json | 4 +- .../entities-upstreams-targets/package.json | 4 +- .../UpstreamsFormActiveHealthCheck.vue | 2 +- .../UpstreamsFormPassiveHealthCheck.vue | 2 +- .../src/types/upstreams-form.ts | 4 +- .../entities/entities-vaults/package.json | 4 +- .../entities-vaults/src/types/vault-form.ts | 6 +- packages/portal/document-viewer/package.json | 4 +- .../src/components/nodes/TaskCheckbox.vue | 2 +- .../portal/document-viewer/src/types/index.ts | 6 +- packages/portal/spec-renderer/package.json | 4 +- .../src/components/SpecOperationsList.vue | 4 +- pnpm-lock.yaml | 1299 ++++++----------- 132 files changed, 687 insertions(+), 1237 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.cjs create mode 100644 eslint.config.mjs diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 6039158d4b..0000000000 --- a/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules -dist -**/dist/* -public -bin -__template__ diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index c43016b655..0000000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,106 +0,0 @@ -/* eslint-env node */ -require('@rushstack/eslint-patch/modern-module-resolution') -const kongponentsUtilityClasses = require('./utilities/disallowed-utility-classes') - -module.exports = { - root: true, - env: { - node: true, - }, - extends: [ - 'plugin:vue/vue3-essential', - 'eslint:recommended', - '@vue/eslint-config-typescript', - 'plugin:vue/vue3-recommended', - '@vue/standard', - 'plugin:cypress/recommended', // if this is missing, it looks like type errors - ], - parserOptions: { - ecmaVersion: 'latest', - }, - rules: { - indent: 'off', - semi: ['error', 'never'], - 'space-before-function-paren': 'off', - quotes: ['error', 'single', {avoidEscape: true}], - 'no-multi-spaces': 'error', - 'no-unused-vars': 'off', - 'no-trailing-spaces': 'error', - 'padded-blocks': 'off', - 'comma-dangle': ['error', 'always-multiline'], - 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', - 'max-len': [process.env.NODE_ENV === 'production' ? 'warn' : 'off', { - code: 120, - ignoreTrailingComments: true, - ignoreUrls: true, - ignoreStrings: true, - ignoreTemplateLiterals: true, - ignoreRegExpLiterals: true, - }], - '@typescript-eslint/space-before-function-paren': ['error', { - anonymous: 'never', - named: 'never', - asyncArrow: 'always', - }], - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/indent': ['error', 2], - '@typescript-eslint/consistent-type-imports': ['error', { - prefer: 'type-imports', - fixStyle: 'separate-type-imports', - }], - // Ensures ESLint understands that `defineEmits<{ ... }>()` does _not_ fail this rule. - 'func-call-spacing': 'off', - '@typescript-eslint/func-call-spacing': ['error', 'never'], - 'vue/attributes-order': ['error', { - alphabetical: true, - }], - 'vue/multiline-html-element-content-newline': ['error', { - ignoreWhenEmpty: true, - ignores: ['code', 'pre', 'textarea', 'a', 'span', 'router-link'], - }], - // Disallow Kongponents utility classes - 'vue/no-restricted-class': ['error', ...kongponentsUtilityClasses], - // This rule is too restrictive: https://github.com/vuejs/eslint-plugin-vue/issues/2259 - 'vue/no-setup-props-destructure': 'off', - 'vue/no-restricted-static-attribute': ['error', - { - key: 'data-test-id', - message: 'Using "data-test-id" is not allowed. Use "data-testid" instead.', - }, - { - key: 'data-tracking-id', - message: 'Using "data-tracking-id" is not allowed. Use "data-testid" instead.', - }, - ], - 'vue/no-restricted-v-bind': ['error', - { - argument: 'data-test-id', - message: 'Using "data-test-id" is not allowed. Use "data-testid" instead.', - }, - { - argument: 'data-tracking-id', - message: 'Using "data-tracking-id" is not allowed. Use "data-testid" instead.', - }, - ], - }, - overrides: [ - { - files: [ - 'cypress/integration/**.spec.{js,ts,jsx,tsx}', - 'cypress/integration/**.cy.{js,ts,jsx,tsx}', - ], - extends: [ - 'plugin:cypress/recommended', - ], - }, - { - files: [ - 'packages/portal/document-viewer/src/components/**/*.vue', - ], - rules: { - 'vue/multi-word-component-names': ['off'], - }, - }, - ], -} diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..ebe9be4915 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,30 @@ +import eslintKongUiConfig from '@kong/eslint-config-kong-ui' +import eslintKongUiConfigJson from '@kong/eslint-config-kong-ui/json' +import eslintKongUiConfigCypress from '@kong/eslint-config-kong-ui/cypress' + +export default [ + ...eslintKongUiConfig, + // Only apply the shared JSON config to files that match the given pattern + ...eslintKongUiConfigJson.map(config => ({ + ...config, + files: ['tokens/**/*.json'], + })), + ...eslintKongUiConfigCypress.map(config => ({ + ...config, + files: [ + '**/cypress/**', + '**/*.cy.{js,ts,jsx,tsx}', + ], + })), + { + ignores: ['**/__template__/**'], + }, + { + files: [ + 'packages/portal/document-viewer/src/components/**/*.vue', + ], + rules: { + 'vue/multi-word-component-names': ['off'], + }, + }, +] diff --git a/package.json b/package.json index 9851730c60..32e5a7b106 100644 --- a/package.json +++ b/package.json @@ -25,20 +25,16 @@ "@digitalroute/cz-conventional-changelog-for-jira": "^8.0.1", "@evilmartians/lefthook": "^1.6.10", "@kong/design-tokens": "1.12.12", + "@kong/eslint-config-kong-ui": "^1.0.3", "@kong/kongponents": "9.0.0-alpha.162", - "@rushstack/eslint-patch": "^1.7.2", "@types/flat": "^5.0.5", "@types/js-yaml": "^4.0.9", "@types/jsdom": "^21.1.6", "@types/node": "^18.19.31", "@types/uuid": "^9.0.8", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", "@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vitest/ui": "^1.3.1", - "@vue/eslint-config-standard": "^8.0.1", - "@vue/eslint-config-typescript": "^12.0.0", "@vue/test-utils": "^2.4.5", "@vue/tsconfig": "^0.5.1", "c8": "^9.1.0", @@ -46,12 +42,7 @@ "cross-env": "^7.0.3", "cypress": "^13.6.6", "cz-conventional-changelog": "^3.3.0", - "eslint": "^8.57.0", - "eslint-plugin-cypress": "^2.15.2", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.1.1", - "eslint-plugin-vue": "^9.22.0", + "eslint": "^9.4.0", "js-yaml": "^4.1.0", "jsdom": "^24.0.0", "lerna": "^8.1.2", diff --git a/packages/analytics/analytics-chart/package.json b/packages/analytics/analytics-chart/package.json index 944360f191..b12b2ba970 100644 --- a/packages/analytics/analytics-chart/package.json +++ b/packages/analytics/analytics-chart/package.json @@ -46,8 +46,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/analytics/analytics-chart/src/components/AnalyticsChart.vue b/packages/analytics/analytics-chart/src/components/AnalyticsChart.vue index 7b190562a7..39c5ffb14d 100644 --- a/packages/analytics/analytics-chart/src/components/AnalyticsChart.vue +++ b/packages/analytics/analytics-chart/src/components/AnalyticsChart.vue @@ -203,7 +203,9 @@ const computedChartData = computed(() => { }) const timeRangeMs = computed(() => { - if (!props.chartData?.meta) { return 0 } + if (!props.chartData?.meta) { + return 0 + } return ('start_ms' in props.chartData.meta) ? props.chartData.meta.end_ms - props.chartData.meta.start_ms @@ -251,7 +253,7 @@ const metricAxesTitle = computed(() => { }) const dimensionAxesTitle = computed(() => { - const dimension = isTimeSeriesChart.value ? 'Time' : Object.keys(props.chartData.meta.display || props.chartData.meta.metric_names as Object)[0] + const dimension = isTimeSeriesChart.value ? 'Time' : Object.keys(props.chartData.meta.display || props.chartData.meta.metric_names as Record)[0] // @ts-ignore - dynamic i18n key return props.chartOptions.dimensionAxesTitle || (i18n.te(`chartLabels.${dimension}`) && // @ts-ignore - dynamic i18n key diff --git a/packages/analytics/analytics-chart/src/components/chart-types/StackedBarChart.vue b/packages/analytics/analytics-chart/src/components/chart-types/StackedBarChart.vue index 613bdf6df3..8cc07cec93 100644 --- a/packages/analytics/analytics-chart/src/components/chart-types/StackedBarChart.vue +++ b/packages/analytics/analytics-chart/src/components/chart-types/StackedBarChart.vue @@ -425,7 +425,7 @@ const chartInstance = composables.useChartJSCommon( const maxOverflow = computed(() => { // Need this reactive dependency to re-compute the max overflow when the chart updates. - // eslint-disable-next-line no-unused-expressions + dependsOnChartUpdate.value // ChartJS says that labels are optional, but we always provide them. @@ -522,7 +522,7 @@ const onScrolling = (event: Event) => { axesTooltip.value.offset = target.scrollLeft } -const tooltipDimensions = ({ width, height }: { width: number, height: number}) => { +const tooltipDimensions = ({ width, height }: { width: number, height: number }) => { tooltipData.width = width tooltipData.height = height } diff --git a/packages/analytics/analytics-chart/src/components/chart-types/TimeSeriesChart.vue b/packages/analytics/analytics-chart/src/components/chart-types/TimeSeriesChart.vue index 711af562c1..c63454182b 100644 --- a/packages/analytics/analytics-chart/src/components/chart-types/TimeSeriesChart.vue +++ b/packages/analytics/analytics-chart/src/components/chart-types/TimeSeriesChart.vue @@ -144,7 +144,7 @@ const props = defineProps({ }) const { translateUnit } = composables.useTranslatedUnits() -const chartInstance = ref<{chart: Chart}>() +const chartInstance = ref<{ chart: Chart }>() const legendID = ref(uuidv4()) const chartID = ref(uuidv4()) const legendItems = ref([]) @@ -208,7 +208,7 @@ const chartFlexClass = (position: `${ChartLegendPosition}`) => { }[position] } -// @ts-ignore +// @ts-ignore: allow untyped param const tooltipDimensions = ({ width, height }) => { tooltipData.width = width tooltipData.height = height diff --git a/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.cy.ts b/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.cy.ts index 2369389443..adaef2b7aa 100644 --- a/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.cy.ts +++ b/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.cy.ts @@ -25,7 +25,7 @@ describe('', () => { // eslint-disable-next-line cypress/unsafe-to-chain-command cy.getTestId('export-csv').click().then(() => { - // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.wrap(Cypress.vueWrapper.emitted()).should('have.property', 'export-started').then((evt) => { const incomingData = evt[0][0] const firstRow = incomingData[0] @@ -36,7 +36,7 @@ describe('', () => { cy.wrap(incomingData).should('have.length', CSV_DATA.length) }) - // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.wrap(Cypress.vueWrapper.emitted()).should('have.property', 'export-finished').then((evt) => { const exportedFilename = evt[0][0] @@ -59,7 +59,7 @@ describe('', () => { // eslint-disable-next-line cypress/unsafe-to-chain-command cy.getTestId('export-csv').click().then(() => { - // eslint-disable-next-line cypress/unsafe-to-chain-command + cy.wrap(Cypress.vueWrapper.emitted()).should('have.property', 'export-finished').then((evt) => { const exportedFilename = evt[0][0] diff --git a/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.vue b/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.vue index ec9e4a5f03..1fc11b02d7 100644 --- a/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.vue +++ b/packages/analytics/analytics-chart/src/components/vue-json-csv/VueJsonCsv.vue @@ -89,6 +89,7 @@ const exportableData: ComputedRef = computed(() => { }) // Replaces the keys in the key/value pairs with more human-readable ones (if provided) +// eslint-disable-next-line @typescript-eslint/ban-types const labelsFunctionGenerator = (): Function => { const labels: any = props.labels @@ -97,6 +98,7 @@ const labelsFunctionGenerator = (): Function => { } if (typeof labels as ValidType === ValidType.Object) { + // eslint-disable-next-line @typescript-eslint/ban-types return (item: Function) => { return mapKeys(item, (item, key) => { return labels[key] || key @@ -104,11 +106,12 @@ const labelsFunctionGenerator = (): Function => { } } - // @ts-ignore + // @ts-ignore: valid return return item => item } // Trims each data row based, keeping only the columns (fields) passed in +// eslint-disable-next-line @typescript-eslint/ban-types const fieldsFunctionGenerator = (): Function => { const fields: any = props.fields if (typeof props.fields as ValidType !== ValidType.Object && !Array.isArray(fields)) { @@ -117,12 +120,13 @@ const fieldsFunctionGenerator = (): Function => { if (Array.isArray(fields)) { // Keep only requested object properties + // eslint-disable-next-line @typescript-eslint/ban-types return (item: Function) => { return pick(item, fields) } } - // @ts-ignore + // @ts-ignore: valid return type return item => item } diff --git a/packages/analytics/analytics-chart/src/composables/useChartSelectedRange.ts b/packages/analytics/analytics-chart/src/composables/useChartSelectedRange.ts index 214ecc261f..c29a0c4cff 100644 --- a/packages/analytics/analytics-chart/src/composables/useChartSelectedRange.ts +++ b/packages/analytics/analytics-chart/src/composables/useChartSelectedRange.ts @@ -5,7 +5,9 @@ import { formatTime } from '../utils' export default function useChartSelectedRange(chartData: Ref): Ref { const formattedTimeRange = computed(() => { - if (!chartData.value?.meta) { return '' } + if (!chartData.value?.meta) { + return '' + } const start = chartData.value.meta.start_ms const end = chartData.value.meta.end_ms diff --git a/packages/analytics/analytics-chart/src/composables/useExploreResultToTimeDatasets.ts b/packages/analytics/analytics-chart/src/composables/useExploreResultToTimeDatasets.ts index 4350ff445e..19ac9da4b6 100644 --- a/packages/analytics/analytics-chart/src/composables/useExploreResultToTimeDatasets.ts +++ b/packages/analytics/analytics-chart/src/composables/useExploreResultToTimeDatasets.ts @@ -97,9 +97,9 @@ export default function useExploreResultToTimeDataset( const timedEvents = !records?.length ? {} - : records.reduce((acc: {[label: string]: any}, druidRow) => { + : records.reduce((acc: { [label: string]: any }, druidRow) => { const timestamp: number = new Date(druidRow.timestamp).valueOf() - const event = druidRow.event as {[label: string]: string | number} + const event = druidRow.event as { [label: string]: string | number } for (const metric of metricNames) { dimensionPositions.add(metric) @@ -137,7 +137,7 @@ export default function useExploreResultToTimeDataset( }) : datasetLabels.map(label => [label.name, label.name]) - const colorMap: {[label: string]: string} = {} + const colorMap: { [label: string]: string } = {} const datasets: Dataset[] = [...dimensionsCrossMetrics].map(([metric, dimension], i) => { const filled = zeroFilledTimeSeries.map(ts => { @@ -148,6 +148,7 @@ export default function useExploreResultToTimeDataset( return { x: ts, y: 0 } }) + // eslint-disable-next-line prefer-const let { colorPalette, fill } = deps if (isNullOrUndef(colorPalette)) { diff --git a/packages/analytics/analytics-chart/src/enums/chart-legend-position.enum.ts b/packages/analytics/analytics-chart/src/enums/chart-legend-position.enum.ts index 236ec46aa7..d8796dbc10 100644 --- a/packages/analytics/analytics-chart/src/enums/chart-legend-position.enum.ts +++ b/packages/analytics/analytics-chart/src/enums/chart-legend-position.enum.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ + export enum ChartLegendPosition { Hidden = 'hidden', Right = 'right', diff --git a/packages/analytics/analytics-chart/src/enums/chart-metric-display.enum.ts b/packages/analytics/analytics-chart/src/enums/chart-metric-display.enum.ts index d8bc233e6d..4b96b5dfcf 100644 --- a/packages/analytics/analytics-chart/src/enums/chart-metric-display.enum.ts +++ b/packages/analytics/analytics-chart/src/enums/chart-metric-display.enum.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ + export enum ChartMetricDisplay { Hidden = 'hidden', SingleMetric = 'single', diff --git a/packages/analytics/analytics-chart/src/enums/chart-types-simple.enum.ts b/packages/analytics/analytics-chart/src/enums/chart-types-simple.enum.ts index 63f4d7c5ec..c7587bc494 100644 --- a/packages/analytics/analytics-chart/src/enums/chart-types-simple.enum.ts +++ b/packages/analytics/analytics-chart/src/enums/chart-types-simple.enum.ts @@ -1,5 +1,5 @@ -/* eslint-disable no-unused-vars */ + export enum ChartTypesSimple { GAUGE = 'Gauge', - TOPN = 'TopN' + TOPN = 'TopN', } diff --git a/packages/analytics/analytics-chart/src/enums/chart-types.enum.ts b/packages/analytics/analytics-chart/src/enums/chart-types.enum.ts index 741f5f2dc6..09c1ee0cff 100644 --- a/packages/analytics/analytics-chart/src/enums/chart-types.enum.ts +++ b/packages/analytics/analytics-chart/src/enums/chart-types.enum.ts @@ -1,8 +1,8 @@ -/* eslint-disable no-unused-vars */ + export enum ChartTypes { DOUGHNUT = 'Doughnut', HORIZONTAL_BAR = 'HorizontalBar', VERTICAL_BAR = 'VerticalBar', TIMESERIES_LINE = 'Line', - TIMESERIES_BAR = 'TimeSeriesBar' + TIMESERIES_BAR = 'TimeSeriesBar', } diff --git a/packages/analytics/analytics-chart/src/utils/commonOptions.ts b/packages/analytics/analytics-chart/src/utils/commonOptions.ts index 8e4af89667..09821e7bd1 100644 --- a/packages/analytics/analytics-chart/src/utils/commonOptions.ts +++ b/packages/analytics/analytics-chart/src/utils/commonOptions.ts @@ -130,6 +130,7 @@ export const verticalTooltipPositioning = (position: Point, tooltipHeight: numbe return y } +// eslint-disable-next-line @typescript-eslint/ban-types export function debounce(fn: Function, delay: number) { let timeoutId: number return (...args: any) => { diff --git a/packages/analytics/analytics-chart/src/utils/customColors.ts b/packages/analytics/analytics-chart/src/utils/customColors.ts index d1adfaa473..8555f6db1c 100644 --- a/packages/analytics/analytics-chart/src/utils/customColors.ts +++ b/packages/analytics/analytics-chart/src/utils/customColors.ts @@ -8,7 +8,7 @@ export const lightGrey = '#e0e4ea' // kui-color-background-disabled // The algorithm assigns status codes consistent colors, regardless of which codes are present in a given // chart. This is a tradeoff: in rare cases, it can lead to (for example) two codes with the same color // ending up next to each other. -const statusCodePalette: {[label: string]: string[]} = { +const statusCodePalette: { [label: string]: string[] } = { 100: ['#c8e2fd', '#80bfff', '#4da6ff', '#1a8cff', '#0072e5', '#0059b2'], 200: ['#ceedd2', '#9edca6', '#89d595', '#6fcc83', '#44c26b', '#0bb652', '#0ca84a', '#169643', '#196e33', '#1b572a'], 300: ['#fff4db', '#ffe9b8', '#ffe2a1', '#ffd982', '#ffd062', '#fdc53b', '#f4bb1e', '#e8b00b', '#d9a30f', '#c89407'], diff --git a/packages/analytics/analytics-config-store/package.json b/packages/analytics/analytics-config-store/package.json index caf9f77d17..994c1482a0 100644 --- a/packages/analytics/analytics-config-store/package.json +++ b/packages/analytics/analytics-config-store/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/analytics/analytics-metric-provider/package.json b/packages/analytics/analytics-metric-provider/package.json index a4120a2ed3..eb2fd2c063 100644 --- a/packages/analytics/analytics-metric-provider/package.json +++ b/packages/analytics/analytics-metric-provider/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/analytics/analytics-metric-provider/src/enums/metric-card-size.enum.ts b/packages/analytics/analytics-metric-provider/src/enums/metric-card-size.enum.ts index 099dc0a298..53347bed6c 100644 --- a/packages/analytics/analytics-metric-provider/src/enums/metric-card-size.enum.ts +++ b/packages/analytics/analytics-metric-provider/src/enums/metric-card-size.enum.ts @@ -1,7 +1,7 @@ -/* eslint-disable no-unused-vars */ + export enum MetricCardSize { Small = 'sm', Medium = 'md', Large = 'lg', - ExtraLarge = 'xl' + ExtraLarge = 'xl', } diff --git a/packages/analytics/analytics-metric-provider/src/enums/metric-card-type.enum.ts b/packages/analytics/analytics-metric-provider/src/enums/metric-card-type.enum.ts index 017e251dc2..fd3ece614a 100644 --- a/packages/analytics/analytics-metric-provider/src/enums/metric-card-type.enum.ts +++ b/packages/analytics/analytics-metric-provider/src/enums/metric-card-type.enum.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ + export enum MetricCardType { GENERIC_COUNT = 'GenericCount', TRAFFIC = 'Traffic', diff --git a/packages/analytics/analytics-utilities/package.json b/packages/analytics/analytics-utilities/package.json index 9fcc9956b2..2af89cf8b2 100644 --- a/packages/analytics/analytics-utilities/package.json +++ b/packages/analytics/analytics-utilities/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/analytics/analytics-utilities/src/types/chart-types.ts b/packages/analytics/analytics-utilities/src/types/chart-types.ts index a1cdeeac5e..57ce9281bd 100644 --- a/packages/analytics/analytics-utilities/src/types/chart-types.ts +++ b/packages/analytics/analytics-utilities/src/types/chart-types.ts @@ -1,10 +1,10 @@ -/* eslint-disable no-unused-vars */ + export enum ChartTypes { DOUGHNUT = 'Doughnut', HORIZONTAL_BAR = 'HorizontalBar', VERTICAL_BAR = 'VerticalBar', TIMESERIES_LINE = 'Line', - TIMESERIES_BAR = 'TimeSeriesBar' + TIMESERIES_BAR = 'TimeSeriesBar', } export const reportChartTypes = [ diff --git a/packages/analytics/analytics-utilities/src/types/timeframe-keys.ts b/packages/analytics/analytics-utilities/src/types/timeframe-keys.ts index 4642af8b4b..71c6ed513c 100644 --- a/packages/analytics/analytics-utilities/src/types/timeframe-keys.ts +++ b/packages/analytics/analytics-utilities/src/types/timeframe-keys.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ + export enum TimeframeKeys { FIFTEEN_MIN = '15m', ONE_HOUR = '1h', @@ -12,5 +12,5 @@ export enum TimeframeKeys { CURRENT_QUARTER = 'current_quarter', PREVIOUS_WEEK = 'previous_week', PREVIOUS_MONTH = 'previous_month', - PREVIOUS_QUARTER = 'previous_quarter' + PREVIOUS_QUARTER = 'previous_quarter', } diff --git a/packages/analytics/analytics-utilities/src/utils/chartDataGenerator.ts b/packages/analytics/analytics-utilities/src/utils/chartDataGenerator.ts index 27f952f9c7..c020ae1f00 100644 --- a/packages/analytics/analytics-utilities/src/utils/chartDataGenerator.ts +++ b/packages/analytics/analytics-utilities/src/utils/chartDataGenerator.ts @@ -99,7 +99,7 @@ export const generateMultipleMetricTimeSeriesData = (metrics: Metric[]) => { const start = Date.now() - 6 * 60 * 60 * 1000 // 6 hours ago const end = Date.now() const data = [] - const metricValues: {[metric: string]: number} = {} + const metricValues: { [metric: string]: number } = {} metrics.forEach(metric => { metricValues[metric.name] = 0 diff --git a/packages/analytics/dashboard-renderer/package.json b/packages/analytics/dashboard-renderer/package.json index cb4b203003..e758a9d08d 100644 --- a/packages/analytics/dashboard-renderer/package.json +++ b/packages/analytics/dashboard-renderer/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/analytics/metric-cards/package.json b/packages/analytics/metric-cards/package.json index bbf15e2032..ae90e93a5e 100644 --- a/packages/analytics/metric-cards/package.json +++ b/packages/analytics/metric-cards/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/analytics/metric-cards/src/constants.ts b/packages/analytics/metric-cards/src/constants.ts index 44128b00a2..9b30e6c42b 100644 --- a/packages/analytics/metric-cards/src/constants.ts +++ b/packages/analytics/metric-cards/src/constants.ts @@ -1,8 +1,8 @@ -/* eslint-disable no-unused-vars */ + export enum MetricCardSize { Small = 'sm', Medium = 'md', Large = 'lg', LargeCompact = 'lgc', - ExtraLarge = 'xl' + ExtraLarge = 'xl', } diff --git a/packages/analytics/metric-cards/src/enums/metric-card-type.enum.ts b/packages/analytics/metric-cards/src/enums/metric-card-type.enum.ts index 017e251dc2..fd3ece614a 100644 --- a/packages/analytics/metric-cards/src/enums/metric-card-type.enum.ts +++ b/packages/analytics/metric-cards/src/enums/metric-card-type.enum.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ + export enum MetricCardType { GENERIC_COUNT = 'GenericCount', TRAFFIC = 'Traffic', diff --git a/packages/analytics/portal-analytics-bridge/package.json b/packages/analytics/portal-analytics-bridge/package.json index e1abdbfc59..486392d389 100644 --- a/packages/analytics/portal-analytics-bridge/package.json +++ b/packages/analytics/portal-analytics-bridge/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/app-layout/fixtures/sidebar-items.ts b/packages/core/app-layout/fixtures/sidebar-items.ts index 962c38cec0..0687dfa518 100644 --- a/packages/core/app-layout/fixtures/sidebar-items.ts +++ b/packages/core/app-layout/fixtures/sidebar-items.ts @@ -1,5 +1,3 @@ -import { OverviewIcon, RuntimesIcon, PeopleIcon, CogIcon } from '@kong/icons' - export const topItems = [ { name: 'Overview', diff --git a/packages/core/app-layout/package.json b/packages/core/app-layout/package.json index 6e62e78407..f47ba15c51 100644 --- a/packages/core/app-layout/package.json +++ b/packages/core/app-layout/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/app-layout/src/components/AppLayout.cy.ts b/packages/core/app-layout/src/components/AppLayout.cy.ts index 44ce6b4ff9..7d10ce6a68 100644 --- a/packages/core/app-layout/src/components/AppLayout.cy.ts +++ b/packages/core/app-layout/src/components/AppLayout.cy.ts @@ -74,7 +74,7 @@ describe('', () => { Object.keys(viewports).forEach((viewportName: string) => { describe(`${viewportName} viewport`, { // Enforce the viewport size - // @ts-ignore + // @ts-ignore: string keys are valid viewportHeight: viewports[viewportName].height, viewportWidth: viewports[viewportName].width, }, () => { it('should render content passed in through notification slot', () => { diff --git a/packages/core/app-layout/src/components/navbar/AppNavbar.cy.ts b/packages/core/app-layout/src/components/navbar/AppNavbar.cy.ts index e1001bb1bb..ce98e9d738 100644 --- a/packages/core/app-layout/src/components/navbar/AppNavbar.cy.ts +++ b/packages/core/app-layout/src/components/navbar/AppNavbar.cy.ts @@ -27,7 +27,7 @@ describe('', () => { Object.keys(viewports).forEach((viewportName: string) => { describe(`${viewportName} viewport`, { // Enforce the viewport size - // @ts-ignore + // @ts-ignore: string keys are valid viewportHeight: viewports[viewportName].height, viewportWidth: viewports[viewportName].width, }, () => { const isDesktopViewport = viewportName === 'desktop' diff --git a/packages/core/app-layout/src/components/sidebar/AppSidebar.cy.ts b/packages/core/app-layout/src/components/sidebar/AppSidebar.cy.ts index cd2f06e74a..50fd38489a 100644 --- a/packages/core/app-layout/src/components/sidebar/AppSidebar.cy.ts +++ b/packages/core/app-layout/src/components/sidebar/AppSidebar.cy.ts @@ -36,7 +36,7 @@ describe('', () => { Object.keys(viewports).forEach((viewportName: string) => { describe(`${viewportName} viewport`, { // Enforce the viewport size - // @ts-ignore + // @ts-ignore: string keys are valid viewportHeight: viewports[viewportName].height, viewportWidth: viewports[viewportName].width, }, () => { it('renders a sidebar with top and bottom nav', () => { diff --git a/packages/core/app-layout/src/components/sidebar/SidebarItem.vue b/packages/core/app-layout/src/components/sidebar/SidebarItem.vue index f8fda12b30..255374651c 100644 --- a/packages/core/app-layout/src/components/sidebar/SidebarItem.vue +++ b/packages/core/app-layout/src/components/sidebar/SidebarItem.vue @@ -128,7 +128,7 @@ const itemClick = (item: SidebarPrimaryItem | SidebarSecondaryItem): void => { emit('click', item) } -const navigate = (event: Event, item: SidebarPrimaryItem | SidebarSecondaryItem, routerNavigate?: Function): void => { +const navigate = (event: Event, item: SidebarPrimaryItem | SidebarSecondaryItem, routerNavigate?: () => void): void => { itemClick(item) if (typeof routerNavigate === 'function') { event.preventDefault() diff --git a/packages/core/cli/package.json b/packages/core/cli/package.json index 2488de1d4c..11f908f4eb 100644 --- a/packages/core/cli/package.json +++ b/packages/core/cli/package.json @@ -9,8 +9,8 @@ "build:cli": "rimraf ./bin && tsc --project './tsconfig.json' && chmod u+x ./bin/index.js", "prepare": "pnpm run build:cli", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix" + "lint": "eslint", + "lint:fix": "eslint --fix" }, "devDependencies": { "@types/inquirer": "^9.0.7", diff --git a/packages/core/cli/src/__template__/package.json b/packages/core/cli/src/__template__/package.json index b85bfab688..eed21510dd 100644 --- a/packages/core/cli/src/__template__/package.json +++ b/packages/core/cli/src/__template__/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/cli/src/core/package.ts b/packages/core/cli/src/core/package.ts index 875c1c6b72..5a7e3ff696 100644 --- a/packages/core/cli/src/core/package.ts +++ b/packages/core/cli/src/core/package.ts @@ -65,7 +65,7 @@ const createPackageFiles = async (workspace: string, packageName: string): Promi spinner.start({ text: 'Creating package files...' }) // Create new files in packages/${workspace}/{packageName} - // eslint-disable-next-line array-callback-return + for (const filename of packageFilesToCreate) { const stats = fs.statSync(filename) const filenamePath = filename.split('__template__/') diff --git a/packages/core/core/package.json b/packages/core/core/package.json index 520287ccef..2e1e9e582e 100644 --- a/packages/core/core/package.json +++ b/packages/core/core/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/core/src/useDate/useDate.spec.ts b/packages/core/core/src/useDate/useDate.spec.ts index ce066ac494..7f50267261 100644 --- a/packages/core/core/src/useDate/useDate.spec.ts +++ b/packages/core/core/src/useDate/useDate.spec.ts @@ -22,17 +22,17 @@ describe('formatUnixToDate()', () => { }) it('should handle undefined', () => { - // @ts-ignore + // @ts-ignore: allow undefined for test value expect(helpers.formatUnixToDate(undefined)).toEqual('') }) it('should handle null', () => { - // @ts-ignore + // @ts-ignore: allow null for test value expect(helpers.formatUnixToDate(null)).toEqual('') }) it('should handle bogus number', () => { - // eslint-disable-next-line no-loss-of-precision + // eslint-disable-next-line @typescript-eslint/no-loss-of-precision expect(helpers.formatUnixToDate(894750982347502987435908275)).toEqual('') }) }) diff --git a/packages/core/core/src/usePackage/index.ts b/packages/core/core/src/usePackage/index.ts index 28cee263ac..a69760c852 100644 --- a/packages/core/core/src/usePackage/index.ts +++ b/packages/core/core/src/usePackage/index.ts @@ -35,11 +35,11 @@ export default function usePackage({ script, styles, onReady }: ImportParams): { const globalLibVariable = libName.startsWith('kong-ui-') ? libName : `kong-ui-${libName}` // If the package global is already bound to the window, return the existing object - // @ts-ignore + // @ts-ignore: string is valid key if (window[globalLibVariable]) return window[globalLibVariable] // Scripts is a umd file, so inject into the document.head - // @ts-ignore + // @ts-ignore: string is valid key window[globalLibVariable] = await new Promise((resolve, reject) => { const script = document.createElement('script') script.async = true @@ -52,7 +52,7 @@ export default function usePackage({ script, styles, onReady }: ImportParams): { // Set loadingPackage ref to false after calling the optional onReady() callback loadingPackage.value = false - // @ts-ignore + // @ts-ignore: string is valid key resolve(window[globalLibVariable]) }) script.addEventListener('error', () => { @@ -62,7 +62,7 @@ export default function usePackage({ script, styles, onReady }: ImportParams): { document.head.appendChild(script) }) - // @ts-ignore + // @ts-ignore: string is valid key return window[globalLibVariable] } diff --git a/packages/core/core/src/useSwrvState/index.ts b/packages/core/core/src/useSwrvState/index.ts index bd851bc949..0646d638d0 100644 --- a/packages/core/core/src/useSwrvState/index.ts +++ b/packages/core/core/src/useSwrvState/index.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-unused-vars */ + import type { Ref } from 'vue' import { ref, watchEffect } from 'vue' diff --git a/packages/core/core/src/useWindow/useWindow.spec.ts b/packages/core/core/src/useWindow/useWindow.spec.ts index ec84f43afa..16a6ad5db1 100644 --- a/packages/core/core/src/useWindow/useWindow.spec.ts +++ b/packages/core/core/src/useWindow/useWindow.spec.ts @@ -14,7 +14,7 @@ describe('useWindow', () => { const windowSpy = vi.spyOn(global, 'window', 'get') windowSpy.mockImplementation(() => ({ // Ignore missing properties - // @ts-ignore + // @ts-ignore: ignore missing properties location: locationMock, })) }) diff --git a/packages/core/documentation/package.json b/packages/core/documentation/package.json index c57914dfa6..34d4793400 100644 --- a/packages/core/documentation/package.json +++ b/packages/core/documentation/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/documentation/sandbox/App.vue b/packages/core/documentation/sandbox/App.vue index e26dc1ecda..e66c03d288 100644 --- a/packages/core/documentation/sandbox/App.vue +++ b/packages/core/documentation/sandbox/App.vue @@ -43,7 +43,7 @@ import { selectedDocResponse, documentListResponse } from './sample_data' type SelectedDocument = { document: DocumentTree status: 'published' | 'unpublished' - ast: Object + ast: Record markdown?: string // The raw markdown } diff --git a/packages/core/documentation/src/components/DocumentationContent.vue b/packages/core/documentation/src/components/DocumentationContent.vue index 379488abc3..b97e9ec40a 100644 --- a/packages/core/documentation/src/components/DocumentationContent.vue +++ b/packages/core/documentation/src/components/DocumentationContent.vue @@ -136,7 +136,7 @@ const props = defineProps({ default: '', }, selectedDocument: { - type: Object as PropType<{ document: DocumentTree, ast: Object, markdown?: string, status: 'published' | 'unpublished'}>, + type: Object as PropType<{ document: DocumentTree, ast: Record, markdown?: string, status: 'published' | 'unpublished' }>, default: () => null, }, }) diff --git a/packages/core/documentation/src/components/DocumentationDisplay.vue b/packages/core/documentation/src/components/DocumentationDisplay.vue index 181dfaa6e7..9ac0b4c335 100644 --- a/packages/core/documentation/src/components/DocumentationDisplay.vue +++ b/packages/core/documentation/src/components/DocumentationDisplay.vue @@ -118,7 +118,7 @@ const props = defineProps({ default: false, }, selectedDocument: { - type: Object as PropType<{ document: DocumentTree, ast: Object, markdown?: string, status: 'published' | 'unpublished'}>, + type: Object as PropType<{ document: DocumentTree, ast: Record, markdown?: string, status: 'published' | 'unpublished' }>, default: () => null, }, }) diff --git a/packages/core/documentation/src/helpers.ts b/packages/core/documentation/src/helpers.ts index 20325f6224..ca9b2fdd0a 100644 --- a/packages/core/documentation/src/helpers.ts +++ b/packages/core/documentation/src/helpers.ts @@ -1,5 +1,7 @@ export function cloneDeep(a: any) { - if (a === undefined) { return } + if (a === undefined) { + return + } return JSON.parse(JSON.stringify(a)) } diff --git a/packages/core/documentation/src/types/document-list.ts b/packages/core/documentation/src/types/document-list.ts index 969001700a..8c7966b2f5 100644 --- a/packages/core/documentation/src/types/document-list.ts +++ b/packages/core/documentation/src/types/document-list.ts @@ -3,7 +3,7 @@ export interface DocumentTree { parent_document_id?: string | null title: string slug: string - metadata: object + metadata: Record status?: 'published' | 'unpublished' children: Array revision?: { @@ -13,7 +13,7 @@ export interface DocumentTree { modified_at: string }, id: string - metadata: Object, + metadata: Record, raw_md_content: string, title: string } diff --git a/packages/core/error-boundary/package.json b/packages/core/error-boundary/package.json index 2047040892..015c88d7f3 100644 --- a/packages/core/error-boundary/package.json +++ b/packages/core/error-boundary/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/error-boundary/sandbox/components/AppCrashBuggyComponent.vue b/packages/core/error-boundary/sandbox/components/AppCrashBuggyComponent.vue index c93aeb45f7..400940b9db 100644 --- a/packages/core/error-boundary/sandbox/components/AppCrashBuggyComponent.vue +++ b/packages/core/error-boundary/sandbox/components/AppCrashBuggyComponent.vue @@ -23,7 +23,7 @@ const computedName = computed((): string => { throw new Error('computed error') } - // eslint-disable-next-line no-unreachable + return 'Buggy Component' }) diff --git a/packages/core/error-boundary/sandbox/index.ts b/packages/core/error-boundary/sandbox/index.ts index 53a426e7eb..949c845466 100644 --- a/packages/core/error-boundary/sandbox/index.ts +++ b/packages/core/error-boundary/sandbox/index.ts @@ -5,7 +5,7 @@ import ErrorBoundaryPlugin from '../src' const app = createApp(App) app.use(ErrorBoundaryPlugin, { - // eslint-disable-next-line @typescript-eslint/no-unused-vars + onError: ({ error, context }) => { console.log('plugin-options: error', error, 'tags', context.tags) }, diff --git a/packages/core/error-boundary/src/components/ErrorBoundary.vue b/packages/core/error-boundary/src/components/ErrorBoundary.vue index eb124563a4..08daa5c14d 100644 --- a/packages/core/error-boundary/src/components/ErrorBoundary.vue +++ b/packages/core/error-boundary/src/components/ErrorBoundary.vue @@ -67,7 +67,7 @@ const allTags = computed((): string[] => { // Provide the reactive ref (not the ref.value) provide(KONG_UI_ERROR_BOUNDARY_TAGS_INJECTION_KEY, allTags) -// eslint-disable-next-line @typescript-eslint/no-unused-vars + onErrorCaptured((error: unknown, instance: ComponentPublicInstance | null, info: string) => { // Store the error and context to the ref capturedErrorContext.value = { diff --git a/packages/core/expressions/package.json b/packages/core/expressions/package.json index 421b129bed..34feb18d41 100644 --- a/packages/core/expressions/package.json +++ b/packages/core/expressions/package.json @@ -26,8 +26,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/expressions/src/schema.ts b/packages/core/expressions/src/schema.ts index 09bfc3c873..13681b446c 100644 --- a/packages/core/expressions/src/schema.ts +++ b/packages/core/expressions/src/schema.ts @@ -2,7 +2,7 @@ import { Schema as AtcSchema, type AstType } from '@kong/atc-router' export type SchemaDefinition = { [K in AstType]?: string[]; -}; +} export interface Schema { name: string; diff --git a/packages/core/forms/package.json b/packages/core/forms/package.json index 510c760790..cc299e7147 100644 --- a/packages/core/forms/package.json +++ b/packages/core/forms/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/forms/src/composables/useAbstractFields.ts b/packages/core/forms/src/composables/useAbstractFields.ts index b6ce3b01fc..8b794c256d 100644 --- a/packages/core/forms/src/composables/useAbstractFields.ts +++ b/packages/core/forms/src/composables/useAbstractFields.ts @@ -106,6 +106,7 @@ export default function useAbstractFields(formData: AbstractFieldParams) { const result = validator(value.value, formData.schema, formData.model?.value) if (result && isFunction(result.then)) { + // eslint-disable-next-line promise/catch-or-return result.then((err: any) => { if (err) { errors.value = errors.value.concat(err) diff --git a/packages/core/forms/src/forms/ACMEForm.vue b/packages/core/forms/src/forms/ACMEForm.vue index 789b8a6fde..c92f9809a6 100644 --- a/packages/core/forms/src/forms/ACMEForm.vue +++ b/packages/core/forms/src/forms/ACMEForm.vue @@ -152,7 +152,7 @@ const props = defineProps({ default: () => {}, }, onModelUpdated: { - type: Function as PropType<() => {}>, + type: Function as PropType<() => void>, required: true, }, isEditing: { diff --git a/packages/core/forms/src/forms/ExitTransformer.vue b/packages/core/forms/src/forms/ExitTransformer.vue index 54fe338d79..a8f5c9ba7f 100644 --- a/packages/core/forms/src/forms/ExitTransformer.vue +++ b/packages/core/forms/src/forms/ExitTransformer.vue @@ -31,7 +31,7 @@ const props = defineProps({ default: () => {}, }, onModelUpdated: { - type: Function as PropType<() => {}>, + type: Function as PropType<() => void>, required: true, }, isEditing: { @@ -44,7 +44,7 @@ const displayForm = computed((): boolean => { return (props.formModel.id && props.isEditing) || !props.isEditing }) -const finalSchema = computed((): Object => { +const finalSchema = computed((): Record => { const final = props.formSchema final.fields.map((f:any) => { diff --git a/packages/core/forms/src/forms/PostFunction.vue b/packages/core/forms/src/forms/PostFunction.vue index 4ab62628f2..d758c2eb1a 100644 --- a/packages/core/forms/src/forms/PostFunction.vue +++ b/packages/core/forms/src/forms/PostFunction.vue @@ -31,7 +31,7 @@ const props = defineProps({ default: () => {}, }, onModelUpdated: { - type: Function as PropType<() => {}>, + type: Function as PropType<() => void>, required: true, }, isEditing: { @@ -44,7 +44,7 @@ const displayForm = computed((): boolean => { return (props.formModel.id && props.isEditing) || !props.isEditing }) -const finalSchema = computed((): Object => { +const finalSchema = computed((): Record => { const final = props.formSchema final.fields.map((f:any) => { diff --git a/packages/core/forms/src/generator/fields/abstractField.ts b/packages/core/forms/src/generator/fields/abstractField.ts index 4337d50762..ee8fbc4ac7 100644 --- a/packages/core/forms/src/generator/fields/abstractField.ts +++ b/packages/core/forms/src/generator/fields/abstractField.ts @@ -1,4 +1,4 @@ -// @ts-nocheck +// @ts-nocheck - Do not typecheck file import debounce from 'lodash-es/debounce' import forEach from 'lodash-es/forEach' @@ -99,6 +99,7 @@ export default { } else { const result = validator(this.value, this.schema, this.model) if (result && isFunction(result.then)) { + // eslint-disable-next-line promise/catch-or-return result.then((err) => { if (err) { this.errors = this.errors.concat(err) diff --git a/packages/core/forms/src/generator/fields/advanced/__tests__/FieldAutoSuggest.spec.js b/packages/core/forms/src/generator/fields/advanced/__tests__/FieldAutoSuggest.spec.js index 4fed235167..a37bfcc079 100644 --- a/packages/core/forms/src/generator/fields/advanced/__tests__/FieldAutoSuggest.spec.js +++ b/packages/core/forms/src/generator/fields/advanced/__tests__/FieldAutoSuggest.spec.js @@ -1,3 +1,4 @@ +/* eslint-disable no-undef */ import sinon from 'sinon' import { shallowMount } from '@vue/test-utils' import FieldAutoSuggest from '@/plugins/vfg/FieldAutoSuggest' @@ -66,11 +67,11 @@ describe('FieldAutoSuggest', function() { schema, }, })) - // eslint-disable-next-line no-undef + const fetchSuggestionsSpy = vi.spyOn(wrapper.vm, 'fetchSuggestions') - // eslint-disable-next-line no-undef + const fetchUntilLimitSpy = vi.spyOn(wrapper.vm, 'fetchUntilLimit') - // eslint-disable-next-line no-undef + const fetchExactSpy = vi.spyOn(wrapper.vm, 'fetchExact') await sleep(100) diff --git a/packages/core/forms/src/generator/fields/core/fieldSubmit.vue b/packages/core/forms/src/generator/fields/core/fieldSubmit.vue index 0894da23bd..8afced910b 100644 --- a/packages/core/forms/src/generator/fields/core/fieldSubmit.vue +++ b/packages/core/forms/src/generator/fields/core/fieldSubmit.vue @@ -30,6 +30,7 @@ export default { } if (errors && isFunction(errors.then)) { + // eslint-disable-next-line promise/catch-or-return errors.then(handleErrors) } else { handleErrors(errors) diff --git a/packages/core/forms/src/generator/fields/optional/fieldGoogleAddress.vue b/packages/core/forms/src/generator/fields/optional/fieldGoogleAddress.vue index cfecddf31b..2287d10ec5 100644 --- a/packages/core/forms/src/generator/fields/optional/fieldGoogleAddress.vue +++ b/packages/core/forms/src/generator/fields/optional/fieldGoogleAddress.vue @@ -75,7 +75,9 @@ export default { } // Call event in schema - if (isFunction(this.schema.onPlaceChanged)) { this.schema.onPlaceChanged(this.value, data, place, this.model, this.schema) } + if (isFunction(this.schema.onPlaceChanged)) { + this.schema.onPlaceChanged(this.value, data, place, this.model, this.schema) + } } }, diff --git a/packages/core/forms/src/generator/fields/optional/fieldRangeSlider.vue b/packages/core/forms/src/generator/fields/optional/fieldRangeSlider.vue index 07f019ccb0..9f57b03675 100644 --- a/packages/core/forms/src/generator/fields/optional/fieldRangeSlider.vue +++ b/packages/core/forms/src/generator/fields/optional/fieldRangeSlider.vue @@ -45,6 +45,7 @@ export default { [valueFrom, valueTo] = this.value } else valueFrom = this.value + // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this $(this.$el).ionRangeSlider( defaults(this.schema.rangeSliderOptions || {}, { diff --git a/packages/core/forms/src/generator/utils/dateFieldHelper.ts b/packages/core/forms/src/generator/utils/dateFieldHelper.ts index b5a98cedf8..e9b7fb1f8c 100644 --- a/packages/core/forms/src/generator/utils/dateFieldHelper.ts +++ b/packages/core/forms/src/generator/utils/dateFieldHelper.ts @@ -1,4 +1,4 @@ -// @ts-nocheck +// @ts-nocheck - do not typecheck file import fecha from 'fecha' export default { diff --git a/packages/core/forms/src/generator/utils/schema.ts b/packages/core/forms/src/generator/utils/schema.ts index 17a315d773..a2376344dd 100644 --- a/packages/core/forms/src/generator/utils/schema.ts +++ b/packages/core/forms/src/generator/utils/schema.ts @@ -6,7 +6,7 @@ import isObject from 'lodash-es/isObject' import set from 'lodash-es/set' // Create a new model by schema default values -export const createDefaultObject = (schema: any, obj: {} = {}) => { +export const createDefaultObject = (schema: any, obj: Record = {}) => { each(schema.fields, (field: any) => { if (get(obj, field.model) === undefined && field.default !== undefined) { if (isFunction(field.default)) { diff --git a/packages/core/forms/src/generator/utils/validators.ts b/packages/core/forms/src/generator/utils/validators.ts index eb94e9ed23..d5d0d17adf 100644 --- a/packages/core/forms/src/generator/utils/validators.ts +++ b/packages/core/forms/src/generator/utils/validators.ts @@ -74,12 +74,10 @@ export const validators: any = { const err = [] if (isFinite(value)) { if (!isNil(field.min) && value < field.min) { - // @ts-ignore err.push(msg(messages.numberTooSmall, field.min)) } if (!isNil(field.max) && value > field.max) { - // @ts-ignore err.push(msg(messages.numberTooBig, field.max)) } } else { @@ -117,12 +115,10 @@ export const validators: any = { const err = [] if (isString(value)) { if (!isNil(field.min) && value.length < field.min) { - // @ts-ignore err.push(msg(messages.textTooSmall, value.length, field.min)) } if (!isNil(field.max) && value.length > field.max) { - // @ts-ignore err.push(msg(messages.textTooBig, value.length, field.max)) } } else { @@ -145,12 +141,10 @@ export const validators: any = { if (!isNil(value)) { if (!isNil(field.min) && value.length < field.min) { - // @ts-ignore return [msg(messages.selectMinItems, field.min)] } if (!isNil(field.max) && value.length > field.max) { - // @ts-ignore return [msg(messages.selectMaxItems, field.max)] } } @@ -170,7 +164,6 @@ export const validators: any = { if (!isNil(field.min)) { const min = new Date(field.min) if (m.valueOf() < min.valueOf()) { - // @ts-ignore err.push(msg(messages.dateIsEarly, fecha.format(m), fecha.format(min))) } } @@ -178,7 +171,6 @@ export const validators: any = { if (!isNil(field.max)) { const max = new Date(field.max) if (m.valueOf() > max.valueOf()) { - // @ts-ignore err.push(msg(messages.dateIsLate, fecha.format(m), fecha.format(max))) } } @@ -279,7 +271,7 @@ export const validators: any = { Object.keys(validators).forEach(name => { const fn = validators[name] if (isFunction(fn)) { - // @ts-ignore + // @ts-ignore: allow custom fn.locale = customMessages => (value, field, model) => fn(value, field, model, defaults(customMessages, resources)) } }) diff --git a/packages/core/i18n/package.json b/packages/core/i18n/package.json index 7541b37cf1..b69bbccbdf 100644 --- a/packages/core/i18n/package.json +++ b/packages/core/i18n/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/i18n/src/Translation.ts b/packages/core/i18n/src/Translation.ts index 1cff4ad662..2331d9de55 100644 --- a/packages/core/i18n/src/Translation.ts +++ b/packages/core/i18n/src/Translation.ts @@ -59,7 +59,7 @@ export const i18nTComponent = >(i18n: if (stripped === '0' && slots.default) { hArray[i] = slots.default() } else if (keys.includes(stripped) && slots[stripped]) { - // @ts-ignore + // @ts-ignore: string is valid key hArray[i] = slots[stripped]() } }) diff --git a/packages/core/i18n/src/i18n.spec.ts b/packages/core/i18n/src/i18n.spec.ts index a3f55ea94a..ee535c1cb4 100644 --- a/packages/core/i18n/src/i18n.spec.ts +++ b/packages/core/i18n/src/i18n.spec.ts @@ -92,7 +92,7 @@ describe('i18n', () => { it('should recognize non-exiting key', () => { const { te } = useI18n() - // @ts-expect-error + // @ts-expect-error: allow invalid key expect(te('global.not.ok')).toBeFalsy() }) }) @@ -112,7 +112,7 @@ describe('i18n', () => { it('should return empty array for non-existing key', () => { const { tm } = useI18n() - // @ts-expect-error + // @ts-expect-error: allow invalid key expect(tm('global.not.ok')).toEqual([]) }) }) @@ -209,7 +209,7 @@ describe('i18n', () => { }, isGlobal: true, }) - // @ts-ignore + // @ts-ignore: allow invalid key t('unknown-key') expect(counter).toEqual(1) }) diff --git a/packages/core/i18n/src/i18n.ts b/packages/core/i18n/src/i18n.ts index 0f7f8405a7..09a7f1f9e5 100644 --- a/packages/core/i18n/src/i18n.ts +++ b/packages/core/i18n/src/i18n.ts @@ -92,7 +92,7 @@ export const createI18n = > } const tm = (translationKey: PathToDotNotation): Array => { - // @ts-ignore + // @ts-ignore: string is valid key return intl.messages[translationKey] || [] } diff --git a/packages/core/misc-widgets/package.json b/packages/core/misc-widgets/package.json index fa1b93e2d7..7c83380138 100644 --- a/packages/core/misc-widgets/package.json +++ b/packages/core/misc-widgets/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/core/sandbox-layout/package.json b/packages/core/sandbox-layout/package.json index 3372b80725..6be4c10864 100644 --- a/packages/core/sandbox-layout/package.json +++ b/packages/core/sandbox-layout/package.json @@ -28,8 +28,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-certificates/package.json b/packages/entities/entities-certificates/package.json index 0531b4cbcf..9564dcfe90 100644 --- a/packages/entities/entities-certificates/package.json +++ b/packages/entities/entities-certificates/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-consumer-credentials/package.json b/packages/entities/entities-consumer-credentials/package.json index d845b8f6b1..00f3f7d2ff 100644 --- a/packages/entities/entities-consumer-credentials/package.json +++ b/packages/entities/entities-consumer-credentials/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-consumer-groups/fixtures/mockData.ts b/packages/entities/entities-consumer-groups/fixtures/mockData.ts index 170b2d2fad..9d55013459 100644 --- a/packages/entities/entities-consumer-groups/fixtures/mockData.ts +++ b/packages/entities/entities-consumer-groups/fixtures/mockData.ts @@ -6,7 +6,7 @@ export type ConsumerGroup = { consumers_count?: number; id: string; tags?: string[]; -}; +} export interface FetcherRawResponse { data: T[]; diff --git a/packages/entities/entities-consumer-groups/package.json b/packages/entities/entities-consumer-groups/package.json index 3db77d7f72..e5205ee721 100644 --- a/packages/entities/entities-consumer-groups/package.json +++ b/packages/entities/entities-consumer-groups/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-consumer-groups/src/types/consumer-group-form.ts b/packages/entities/entities-consumer-groups/src/types/consumer-group-form.ts index a6646e0adf..aab91ca566 100644 --- a/packages/entities/entities-consumer-groups/src/types/consumer-group-form.ts +++ b/packages/entities/entities-consumer-groups/src/types/consumer-group-form.ts @@ -1,7 +1,7 @@ import type { RouteLocationRaw } from 'vue-router' import type { BaseFormConfig, KongManagerBaseFormConfig, KonnectBaseFormConfig } from '@kong-ui-public/entities-shared' -export interface BaseConsumerGroupFormConfig extends Omit{ +export interface BaseConsumerGroupFormConfig extends Omit { /** Route to return to if canceling create/edit a Consumer form */ cancelRoute: RouteLocationRaw } diff --git a/packages/entities/entities-consumers/fixtures/mockData.ts b/packages/entities/entities-consumers/fixtures/mockData.ts index 545c6881bb..a1e6a20ed0 100644 --- a/packages/entities/entities-consumers/fixtures/mockData.ts +++ b/packages/entities/entities-consumers/fixtures/mockData.ts @@ -11,7 +11,7 @@ export type Consumer = ( ) & { id: string; tags?: string[]; -}; +} export interface FetcherRawResponse { data: T[]; diff --git a/packages/entities/entities-consumers/package.json b/packages/entities/entities-consumers/package.json index b45136f0ff..93ea7cac8a 100644 --- a/packages/entities/entities-consumers/package.json +++ b/packages/entities/entities-consumers/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-consumers/src/types/consumer-form.ts b/packages/entities/entities-consumers/src/types/consumer-form.ts index d9ecc4df11..c75a09f3f3 100644 --- a/packages/entities/entities-consumers/src/types/consumer-form.ts +++ b/packages/entities/entities-consumers/src/types/consumer-form.ts @@ -1,7 +1,7 @@ import type { RouteLocationRaw } from 'vue-router' import type { BaseFormConfig, KongManagerBaseFormConfig, KonnectBaseFormConfig } from '@kong-ui-public/entities-shared' -export interface BaseConsumerFormConfig extends Omit{ +export interface BaseConsumerFormConfig extends Omit { /** Route to return to if canceling create/edit a Consumer form */ cancelRoute: RouteLocationRaw } diff --git a/packages/entities/entities-data-plane-nodes/package.json b/packages/entities/entities-data-plane-nodes/package.json index 2c36ea6d75..17ae10d99f 100644 --- a/packages/entities/entities-data-plane-nodes/package.json +++ b/packages/entities/entities-data-plane-nodes/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-data-plane-nodes/src/composables/useAsyncScheduler.ts b/packages/entities/entities-data-plane-nodes/src/composables/useAsyncScheduler.ts index 932d885626..a5f84b28f1 100644 --- a/packages/entities/entities-data-plane-nodes/src/composables/useAsyncScheduler.ts +++ b/packages/entities/entities-data-plane-nodes/src/composables/useAsyncScheduler.ts @@ -5,7 +5,7 @@ type TokenBorrowQueueItem = [ ] class TokenBucket { - private concurrentTokenSet: Set = new Set() + private concurrentTokenSet: Set = new Set() private concurrentTokenBorrowQueue: TokenBorrowQueueItem[] = [] constructor(capacity: number) { @@ -29,7 +29,7 @@ class TokenBucket { throw new Error('BUG: No available token to borrow') } - private returnConcurrentToken(token: Symbol) { + private returnConcurrentToken(token: symbol) { if (this.concurrentTokenSet.has(token)) { throw new Error('Token already returned') } diff --git a/packages/entities/entities-gateway-services/package.json b/packages/entities/entities-gateway-services/package.json index 981ce83d73..1bee245848 100644 --- a/packages/entities/entities-gateway-services/package.json +++ b/packages/entities/entities-gateway-services/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-gateway-services/src/composables/getPortFromProtocol.ts b/packages/entities/entities-gateway-services/src/composables/getPortFromProtocol.ts index dc85302b9b..a7ed16e785 100644 --- a/packages/entities/entities-gateway-services/src/composables/getPortFromProtocol.ts +++ b/packages/entities/entities-gateway-services/src/composables/getPortFromProtocol.ts @@ -3,7 +3,9 @@ export default function usePortFromProtocol() { const defaultPorts: Array = [80, 443] const portValue = Number(port) - if ((portValue || portValue === 0) && !defaultPorts.includes(portValue)) { return portValue } + if ((portValue || portValue === 0) && !defaultPorts.includes(portValue)) { + return portValue + } switch (protocol) { case 'grpcs': diff --git a/packages/entities/entities-key-sets/package.json b/packages/entities/entities-key-sets/package.json index 0d8a1d3a7b..61d5d4008a 100644 --- a/packages/entities/entities-key-sets/package.json +++ b/packages/entities/entities-key-sets/package.json @@ -42,8 +42,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-keys/package.json b/packages/entities/entities-keys/package.json index 1f401d06f9..92800748c2 100644 --- a/packages/entities/entities-keys/package.json +++ b/packages/entities/entities-keys/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-plugins/package.json b/packages/entities/entities-plugins/package.json index 15215cdab5..8600840565 100644 --- a/packages/entities/entities-plugins/package.json +++ b/packages/entities/entities-plugins/package.json @@ -48,8 +48,8 @@ "build:endpoints": "tsc -p './tsconfig.endpoints.json'", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-plugins/src/components/PluginEntityForm.vue b/packages/entities/entities-plugins/src/components/PluginEntityForm.vue index c81edeacdf..4370258912 100644 --- a/packages/entities/entities-plugins/src/components/PluginEntityForm.vue +++ b/packages/entities/entities-plugins/src/components/PluginEntityForm.vue @@ -604,7 +604,9 @@ watch(() => props.schema, (newSchema, oldSchema) => { Object.assign(formModel, form.model) - formSchema.value = { fields: formSchema.value?.fields?.map((r: Record) => { return { ...r, disabled: r.disabled || false } }) } + formSchema.value = { fields: formSchema.value?.fields?.map((r: Record) => { + return { ...r, disabled: r.disabled || false } + }) } Object.assign(originalModel, JSON.parse(JSON.stringify(form.model))) sharedFormName.value = getSharedFormName(form.model.name, { useRLARedesignedForm: props.config.useRLARedesignedForm }) diff --git a/packages/entities/entities-plugins/src/components/PluginSelect.vue b/packages/entities/entities-plugins/src/components/PluginSelect.vue index f133243dde..70b047f6cf 100644 --- a/packages/entities/entities-plugins/src/components/PluginSelect.vue +++ b/packages/entities/entities-plugins/src/components/PluginSelect.vue @@ -212,7 +212,7 @@ const props = defineProps({ * Plugins that should not be displayed */ ignoredPlugins: { - type: Array as PropType, + type: Array as PropType, default: () => [], }, /** diff --git a/packages/entities/entities-plugins/src/composables/useSchemas.ts b/packages/entities/entities-plugins/src/composables/useSchemas.ts index 912ecc84c8..96d69021b4 100644 --- a/packages/entities/entities-plugins/src/composables/useSchemas.ts +++ b/packages/entities/entities-plugins/src/composables/useSchemas.ts @@ -27,7 +27,7 @@ import { type CustomSchemas } from '../types' import useI18n from './useI18n' import usePluginHelpers from './usePluginHelpers' -export interface Field extends Record{ +export interface Field extends Record { model: string required?: boolean styleClasses?: string diff --git a/packages/entities/entities-plugins/src/definitions/schemas/typedefs.ts b/packages/entities/entities-plugins/src/definitions/schemas/typedefs.ts index 55b73cd827..9ca8fad4c6 100644 --- a/packages/entities/entities-plugins/src/definitions/schemas/typedefs.ts +++ b/packages/entities/entities-plugins/src/definitions/schemas/typedefs.ts @@ -35,12 +35,12 @@ export const enabled = { type: 'boolean', } -// eslint-disable-next-line camelcase + export const created_at = { label: 'Created', } -// eslint-disable-next-line camelcase + export const updated_at = { label: 'Last updated', } @@ -73,9 +73,9 @@ export default { tags, id, enabled, - // eslint-disable-next-line camelcase + created_at, - // eslint-disable-next-line camelcase + updated_at, fields, } diff --git a/packages/entities/entities-plugins/src/types/plugin-form.ts b/packages/entities/entities-plugins/src/types/plugin-form.ts index 54b2115912..07a8045606 100644 --- a/packages/entities/entities-plugins/src/types/plugin-form.ts +++ b/packages/entities/entities-plugins/src/types/plugin-form.ts @@ -111,7 +111,7 @@ export interface DefaultPluginsFormSchema { getColumnFields?: (schema: unknown) => object } -export type PartiallyRequired = { [k in K]-?: T[k] } & { [k in keyof T]: T[k] }; +export type PartiallyRequired = { [k in K]-?: T[k] } & { [k in keyof T]: T[k] } export type GetRequiredFieldsByContext = T['type'] extends 'input' ? PartiallyRequired : DefaultPluginsFormSchema diff --git a/packages/entities/entities-plugins/src/types/plugins/acl.d.ts b/packages/entities/entities-plugins/src/types/plugins/acl.d.ts index d360246466..528af6dd40 100644 --- a/packages/entities/entities-plugins/src/types/plugins/acl.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/acl.d.ts @@ -7,7 +7,7 @@ interface ACLFieldSchema { group: { hint: string, } - } + }, ] } diff --git a/packages/entities/entities-plugins/src/types/plugins/basic-auth.d.ts b/packages/entities/entities-plugins/src/types/plugins/basic-auth.d.ts index e69f82b29c..661f7059b1 100644 --- a/packages/entities/entities-plugins/src/types/plugins/basic-auth.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/basic-auth.d.ts @@ -9,7 +9,7 @@ interface BasicAuthFieldSchema { password: { inputType: string } - } + }, ] } diff --git a/packages/entities/entities-plugins/src/types/plugins/graphql-rate-limiting-advanced.d.ts b/packages/entities/entities-plugins/src/types/plugins/graphql-rate-limiting-advanced.d.ts index 6ac5b03c86..1ec0563a0a 100644 --- a/packages/entities/entities-plugins/src/types/plugins/graphql-rate-limiting-advanced.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/graphql-rate-limiting-advanced.d.ts @@ -1,5 +1,5 @@ import type { Field, CommonSchemaFields } from '../../types/plugins/shared' -export interface GraphQLRateLimitingAdvancedSchema extends CommonSchemaFields{ +export interface GraphQLRateLimitingAdvancedSchema extends CommonSchemaFields { 'config-strategy': Field, } diff --git a/packages/entities/entities-plugins/src/types/plugins/hmac-auth.d.ts b/packages/entities/entities-plugins/src/types/plugins/hmac-auth.d.ts index 57f3bab4f1..462a340a2a 100644 --- a/packages/entities/entities-plugins/src/types/plugins/hmac-auth.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/hmac-auth.d.ts @@ -13,7 +13,7 @@ interface HmacAuthFieldSchema { submitWhenNull?: boolean hint: string } - } + }, ] } diff --git a/packages/entities/entities-plugins/src/types/plugins/jwt.d.ts b/packages/entities/entities-plugins/src/types/plugins/jwt.d.ts index 1e47883cd8..48defce225 100644 --- a/packages/entities/entities-plugins/src/types/plugins/jwt.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/jwt.d.ts @@ -1,6 +1,6 @@ import type { CommonSchemaFields, Field, PluginBasicSchema } from '../../types/plugins/shared' -export interface JWTPluginSchema extends CommonSchemaFields{ +export interface JWTPluginSchema extends CommonSchemaFields { 'config-cookie_names': Field, 'config-uri_param_names': Field, } @@ -34,7 +34,7 @@ interface JwtSecretFieldSchema { inputType: string, hint: string } - } + }, ] } diff --git a/packages/entities/entities-plugins/src/types/plugins/key-auth.d.ts b/packages/entities/entities-plugins/src/types/plugins/key-auth.d.ts index 5d764ccc9c..c5c270ea49 100644 --- a/packages/entities/entities-plugins/src/types/plugins/key-auth.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/key-auth.d.ts @@ -7,7 +7,7 @@ interface KeyAuthSFieldSchema { submitWhenNull?: boolean hint: string } - } + }, ] } diff --git a/packages/entities/entities-plugins/src/types/plugins/pre-function.d.ts b/packages/entities/entities-plugins/src/types/plugins/pre-function.d.ts index 4d2c2981d5..aef51e76e8 100644 --- a/packages/entities/entities-plugins/src/types/plugins/pre-function.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/pre-function.d.ts @@ -2,11 +2,11 @@ import type { ReturnArrayItem } from '../../types/plugins/typedefs' import type { CommonSchemaFields } from '../../types/plugins/shared' export interface PreFunctionSchema extends CommonSchemaFields { - 'config-access': ReturnArrayItem | {}, - 'config-body_filter': ReturnArrayItem | {}, - 'config-header_filter': ReturnArrayItem | {}, - 'config-certificate': ReturnArrayItem | {}, - 'config-functions': ReturnArrayItem | {}, - 'config-log': ReturnArrayItem | {}, - 'config-rewrite': ReturnArrayItem | {}, + 'config-access': ReturnArrayItem | object, + 'config-body_filter': ReturnArrayItem | object, + 'config-header_filter': ReturnArrayItem | object, + 'config-certificate': ReturnArrayItem | object, + 'config-functions': ReturnArrayItem | object, + 'config-log': ReturnArrayItem | object, + 'config-rewrite': ReturnArrayItem | object, } diff --git a/packages/entities/entities-plugins/src/types/plugins/request-transformer-advaced.d.ts b/packages/entities/entities-plugins/src/types/plugins/request-transformer-advaced.d.ts index 1514b28b1f..d74bed7211 100644 --- a/packages/entities/entities-plugins/src/types/plugins/request-transformer-advaced.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/request-transformer-advaced.d.ts @@ -2,20 +2,20 @@ import type { ReturnArrayItem } from '../../types/plugins/typedefs' import type { CommonSchemaFields } from '../../types/plugins/shared' export interface RequestTransformerAdvancedSchema extends CommonSchemaFields { - 'config-remove-headers': ReturnArrayItem | {}, - 'config-remove.querystring': ReturnArrayItem | {}, - 'config-remove-body': ReturnArrayItem | {}, - 'config-replace-headers': ReturnArrayItem | {}, - 'config-replace-querystring': ReturnArrayItem | {}, - 'config-replace-body': ReturnArrayItem | {}, - 'config-rename-headers': ReturnArrayItem | {}, - 'config-rename-querystring': ReturnArrayItem | {}, - 'config-rename-body': ReturnArrayItem | {}, - 'config-add-headers': ReturnArrayItem | {}, - 'config-add-querystring': ReturnArrayItem | {}, - 'config-add-body': ReturnArrayItem | {}, - 'config-append-headers': ReturnArrayItem | {}, - 'config-append-querystring': ReturnArrayItem | {}, - 'config-append-body': ReturnArrayItem | {}, - 'config-allow-body': ReturnArrayItem | {}, + 'config-remove-headers': ReturnArrayItem | object, + 'config-remove.querystring': ReturnArrayItem | object, + 'config-remove-body': ReturnArrayItem | object, + 'config-replace-headers': ReturnArrayItem | object, + 'config-replace-querystring': ReturnArrayItem | object, + 'config-replace-body': ReturnArrayItem | object, + 'config-rename-headers': ReturnArrayItem | object, + 'config-rename-querystring': ReturnArrayItem | object, + 'config-rename-body': ReturnArrayItem | object, + 'config-add-headers': ReturnArrayItem | object, + 'config-add-querystring': ReturnArrayItem | object, + 'config-add-body': ReturnArrayItem | object, + 'config-append-headers': ReturnArrayItem | object, + 'config-append-querystring': ReturnArrayItem | object, + 'config-append-body': ReturnArrayItem | object, + 'config-allow-body': ReturnArrayItem | object, } diff --git a/packages/entities/entities-plugins/src/types/plugins/stats-d.d.ts b/packages/entities/entities-plugins/src/types/plugins/stats-d.d.ts index 911d0c5538..7ca3aba4ef 100644 --- a/packages/entities/entities-plugins/src/types/plugins/stats-d.d.ts +++ b/packages/entities/entities-plugins/src/types/plugins/stats-d.d.ts @@ -10,6 +10,7 @@ export interface StatsDSchema extends CommonSchemaFields { items: { type: string, + // eslint-disable-next-line @typescript-eslint/ban-types default: Function, schema: { fields: Field[] diff --git a/packages/entities/entities-routes/package.json b/packages/entities/entities-routes/package.json index 8fdb47ef47..99b81681fa 100644 --- a/packages/entities/entities-routes/package.json +++ b/packages/entities/entities-routes/package.json @@ -45,8 +45,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-routes/src/components/RouteList.vue b/packages/entities/entities-routes/src/components/RouteList.vue index efbd6bc7b7..c132407414 100644 --- a/packages/entities/entities-routes/src/components/RouteList.vue +++ b/packages/entities/entities-routes/src/components/RouteList.vue @@ -365,7 +365,7 @@ const filterConfig = computed['$props']['confi const { fetcher, fetcherState } = useFetcher(props.config, fetcherBaseUrl.value) -const getCellAttrs = (params: Record): Object => { +const getCellAttrs = (params: Record): Record => { if (params.headerKey === 'expression') { return { style: { diff --git a/packages/entities/entities-routes/src/types/method-badge.ts b/packages/entities/entities-routes/src/types/method-badge.ts index 09216e8a7b..c6e3bf4901 100644 --- a/packages/entities/entities-routes/src/types/method-badge.ts +++ b/packages/entities/entities-routes/src/types/method-badge.ts @@ -9,7 +9,7 @@ export enum Methods { HEAD = 'HEAD', CONNECT = 'CONNECT', TRACE = 'TRACE', - CUSTOM = 'CUSTOM' + CUSTOM = 'CUSTOM', } export type Method = keyof typeof Methods diff --git a/packages/entities/entities-routes/src/types/route-form.ts b/packages/entities/entities-routes/src/types/route-form.ts index 8cb6c599e9..bd5ba11ff5 100644 --- a/packages/entities/entities-routes/src/types/route-form.ts +++ b/packages/entities/entities-routes/src/types/route-form.ts @@ -32,13 +32,13 @@ export enum RoutingRulesEntities { HEADERS = 'headers', SOURCES = 'sources', DESTINATIONS = 'destinations', - CUSTOM_METHOD = 'custom-method' + CUSTOM_METHOD = 'custom-method', } export enum ExpressionsEditorState { LOADING = 'loading', ERROR = 'error', - READY = 'ready' + READY = 'ready', } export type RoutingRuleEntity = Exclude<`${RoutingRulesEntities}`, 'custom-method'> diff --git a/packages/entities/entities-shared/package.json b/packages/entities/entities-shared/package.json index 9c3df45ffa..214e5a9175 100644 --- a/packages/entities/entities-shared/package.json +++ b/packages/entities/entities-shared/package.json @@ -43,8 +43,8 @@ "build:types": "vue-tsc -p './tsconfig.build.json' --emitDeclarationOnly", "build:sandbox": "cross-env USE_SANDBOX=true vite build -m production", "preview": "cross-env USE_SANDBOX=true vite preview", - "lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore'", - "lint:fix": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '../../../.eslintignore' --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "stylelint": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}'", "stylelint:fix": "stylelint --allow-empty-input './src/**/*.{css,scss,sass,less,styl,vue}' --fix", "typecheck": "vue-tsc -p './tsconfig.build.json' --noEmit", diff --git a/packages/entities/entities-shared/sandbox/shared/components/SandboxPermissionsControl.vue b/packages/entities/entities-shared/sandbox/shared/components/SandboxPermissionsControl.vue index 9388747476..88e5e152aa 100644 --- a/packages/entities/entities-shared/sandbox/shared/components/SandboxPermissionsControl.vue +++ b/packages/entities/entities-shared/sandbox/shared/components/SandboxPermissionsControl.vue @@ -42,7 +42,6 @@ export interface PermissionsActions {