Skip to content

Commit

Permalink
fix: vue tsconfig (#1262)
Browse files Browse the repository at this point in the history
* fix: extend vue tsconfig

* fix: type exports

* fix: lockfile
  • Loading branch information
adamdehaven authored Aug 22, 2023
1 parent 505dab4 commit a9874dc
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 102 deletions.
6 changes: 5 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = {
indent: 'off',
camelcase: 'off',
'space-before-function-paren': 'off',
quotes: ['error', 'single', { avoidEscape: true }],
quotes: ['error', 'single', {avoidEscape: true}],
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'comma-dangle': ['error', 'always-multiline'],
Expand All @@ -41,6 +41,10 @@ module.exports = {
'vue/attributes-order': ['error', {
alphabetical: true,
}],
'@typescript-eslint/consistent-type-imports': ['error', {
prefer: 'type-imports',
fixStyle: 'separate-type-imports',
}],
},
overrides: [
{
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/git": "^10.0.1",
"@types/node": "^16.18.41",
"@typescript-eslint/eslint-plugin": "^4.18.0",
"@typescript-eslint/parser": "^4.18.0",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"@vitejs/plugin-vue": "^4.3.2",
"@vue/eslint-config-standard": "^6.1.0",
"@vue/eslint-config-typescript": "^10.0.0",
"@vue/tsconfig": "^0.4.0",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"cypress": "^12.17.4",
Expand All @@ -82,7 +83,7 @@
"stylelint-config-recommended-scss": "^8.0.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-order": "^6.0.3",
"typescript": "~4.9.5",
"typescript": "^5.1.6",
"vite": "^4.4.9",
"vue-router": "^4.2.4",
"vue-tsc": "^1.8.8"
Expand Down
3 changes: 2 additions & 1 deletion sandbox/shared/SharedLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
</template>

<script setup lang="ts">
import { computed, PropType } from 'vue'
import type { PropType } from 'vue'
import { computed } from 'vue'
import AppNav from '../shared/AppNav.vue'
const props = defineProps({
Expand Down
3 changes: 2 additions & 1 deletion sandbox/shared/router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import { createRouter, createWebHistory } from 'vue-router'
import PageView from './PageView.vue'

const pageRoutes = [
Expand Down
5 changes: 3 additions & 2 deletions src/components/AcceptInvitationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@
</template>

<script setup lang="ts">
import { inject, ref, Ref, reactive, computed, onMounted } from 'vue'
import type { Ref } from 'vue'
import { inject, ref, reactive, computed, onMounted } from 'vue'
import { createMachine } from 'xstate'
import { useMachine } from '@xstate/vue'
import { win } from '@/utils'
import useConfigOptions from '@/composables/useConfigOptions'
import useI18n from '@/composables/useI18n'
import useAxios from '@/composables/useAxios'
import { acceptInvitationEmits } from '@/components/emits'
import { AxiosResponse } from 'axios'
import type { AxiosResponse } from 'axios'
import { ProgressIcon } from '@kong/icons'
import { KUI_ICON_SIZE_40 } from '@kong/design-tokens'
// Components
Expand Down
3 changes: 2 additions & 1 deletion src/components/ChangePasswordForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
</template>

<script setup lang="ts">
import { inject, ref, Ref, reactive, computed, watch } from 'vue'
import type { Ref } from 'vue'
import { inject, ref, reactive, computed, watch } from 'vue'
import { createMachine } from 'xstate'
import { useMachine } from '@xstate/vue'
import useConfigOptions from '@/composables/useConfigOptions'
Expand Down
5 changes: 3 additions & 2 deletions src/components/ForgotPasswordForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@
</template>

<script setup lang="ts">
import { inject, ref, Ref, reactive, computed } from 'vue'
import type { Ref } from 'vue'
import { inject, ref, reactive, computed } from 'vue'
import { createMachine } from 'xstate'
import { useMachine } from '@xstate/vue'
import useConfigOptions from '@/composables/useConfigOptions'
import useAxios from '@/composables/useAxios'
import useI18n from '@/composables/useI18n'
import { forgotPasswordEmits } from '@/components/emits'
import { AxiosResponse } from 'axios'
import type { AxiosResponse } from 'axios'
import { ProgressIcon } from '@kong/icons'
import { KUI_ICON_SIZE_40 } from '@kong/design-tokens'
// Components
Expand Down
5 changes: 3 additions & 2 deletions src/components/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@
</template>

<script setup lang="ts">
import { inject, reactive, ref, Ref, computed, onMounted, watch } from 'vue'
import type { Ref } from 'vue'
import { inject, reactive, ref, computed, onMounted, watch } from 'vue'
import { useMachine } from '@xstate/vue'
import { createMachine } from 'xstate'
import { AxiosResponse } from 'axios'
import type { AxiosResponse } from 'axios'
import { win } from '@/utils'
import useConfigOptions from '@/composables/useConfigOptions'
import useIdentityProvider from '@/composables/useIdentityProvider'
Expand Down
5 changes: 3 additions & 2 deletions src/components/RegisterForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,15 @@
</template>

<script setup lang="ts">
import { inject, ref, reactive, Ref, computed, onMounted } from 'vue'
import type { Ref } from 'vue'
import { inject, ref, reactive, computed, onMounted } from 'vue'
import { createMachine } from 'xstate'
import { useMachine } from '@xstate/vue'
import useConfigOptions from '@/composables/useConfigOptions'
import useAxios from '@/composables/useAxios'
import useI18n from '@/composables/useI18n'
import { registerEmits } from '@/components/emits'
import { AxiosResponse } from 'axios'
import type { AxiosResponse } from 'axios'
import { win } from '@/utils'
import { VueRecaptcha } from 'vue-recaptcha'
import { ProgressIcon } from '@kong/icons'
Expand Down
5 changes: 3 additions & 2 deletions src/components/ResetPasswordForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@
</template>

<script setup lang="ts">
import { inject, ref, Ref, reactive, computed, onMounted } from 'vue'
import type { Ref } from 'vue'
import { inject, ref, reactive, computed, onMounted } from 'vue'
import { createMachine } from 'xstate'
import { useMachine } from '@xstate/vue'
import { win } from '@/utils'
import useConfigOptions from '@/composables/useConfigOptions'
import useAxios from '@/composables/useAxios'
import useI18n from '@/composables/useI18n'
import { resetPasswordEmits } from '@/components/emits'
import { AxiosResponse } from 'axios'
import type { AxiosResponse } from 'axios'
import { ProgressIcon } from '@kong/icons'
import { KUI_ICON_SIZE_40 } from '@kong/design-tokens'
// Components
Expand Down
3 changes: 2 additions & 1 deletion src/composables/useIdentityProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { onMounted, ref, Ref, watch } from 'vue'
import type { Ref } from 'vue'
import { onMounted, ref, watch } from 'vue'
import useConfigOptions from '@/composables/useConfigOptions'
import { win } from '@/utils'

Expand Down
3 changes: 2 additions & 1 deletion src/composables/useInjectStyles.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { computed, ref, ComputedRef, onMounted, onUnmounted } from 'vue'
import type { ComputedRef } from 'vue'
import { computed, ref, onMounted, onUnmounted } from 'vue'
import useConfigOptions from '@/composables/useConfigOptions'
interface InjectStylesComposable {
injectedStyles: ComputedRef<string>
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App } from 'vue'
import type { App } from 'vue'
// Do not use '@' alias in utils paths here so that imports within a consuming project resolve properly.
import { registerCustomElement } from './utils'
import type {
Expand Down Expand Up @@ -49,7 +49,7 @@ export default function registerKongAuthNativeElements(options?: KongAuthElement
registerCustomElement('kong-auth-change-password', elements.KongAuthChangePassword, userOptions)
}

export {
export type {
CustomEndpointElement,
CustomEndpointErrorEvent,
CustomEndpointRequest,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Do not use '@' alias in paths here so that imports within a consuming project resolve properly.
import { AxiosError } from 'axios'
import type { AxiosError } from 'axios'
export { default as convertToTitleCase } from './convertToTitleCase'
export { default as registerCustomElement } from './registerCustomElement'
export { default as kebabize } from './kebabize'
Expand Down
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
{
"extends": "@vue/tsconfig/tsconfig.json",
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"sourceMap": false,
"resolveJsonModule": true,
"esModuleInterop": true,
"baseUrl": ".",
"lib": [
"esnext",
Expand Down
Loading

0 comments on commit a9874dc

Please sign in to comment.