Skip to content

Commit

Permalink
spx-gui: remove unnecessary defineProps and defineEmits imports
Browse files Browse the repository at this point in the history
  • Loading branch information
aofei committed Jul 22, 2024
1 parent 2da14df commit 9347e12
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 8 deletions.
14 changes: 14 additions & 0 deletions spx-gui/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ module.exports = {
'v-.*' // for Vue Konva components
]
}
],
'no-restricted-imports': [
'warn',
{
paths: [
{
// Workaround for https://github.com/vuejs/eslint-plugin-vue/issues/2437
name: 'vue',
importNames: ['defineProps', 'defineEmits'],
message:
'`defineProps` and `defineEmits` are compiler macros and no longer need to be imported.'
}
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</UIFormModal>
</template>
<script setup lang="ts">
import { defineProps, defineEmits, ref, reactive, computed } from 'vue'
import { ref, reactive, computed } from 'vue'
import { UIButton, UICheckbox, UIEmpty, UIFormModal } from '@/components/ui'
import type { Costume } from '@/models/costume'
import type { Sprite } from '@/models/sprite'
Expand Down
2 changes: 1 addition & 1 deletion spx-gui/src/components/asset/library/AssetLibraryModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</template>

<script lang="ts" setup>
import { computed, defineProps, ref, shallowReactive, watch } from 'vue'
import { computed, ref, shallowReactive, watch } from 'vue'
import {
UITextInput,
UIIcon,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</template>

<script lang="ts" setup>
import { computed, defineProps, ref, shallowReactive, shallowRef, watch } from 'vue'
import { computed, ref, shallowReactive, shallowRef, watch } from 'vue'
import { stripExt } from '@/utils/path'
import type { LocaleMessage } from '@/utils/i18n'
import { Costume } from '@/models/costume'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/>
</template>
<script lang="ts" setup>
import { computed, defineProps, onMounted, ref, watchEffect } from 'vue'
import { computed, onMounted, ref, watchEffect } from 'vue'
import type { KonvaEventObject } from 'konva/lib/Node'
import type { ImageConfig } from 'konva/lib/shapes/Image'
import type { Action } from '@/models/project'
Expand Down
2 changes: 1 addition & 1 deletion spx-gui/src/components/editor/sound/SoundRecorder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
</template>

<script lang="ts" setup>
import { defineEmits, ref } from 'vue'
import { ref } from 'vue'
import { useEditorCtx } from '@/components/editor/EditorContextProvider.vue'
import dayjs from 'dayjs'
import { fromBlob } from '@/models/common/file'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</template>

<script setup lang="ts">
import { ref, defineProps, defineEmits } from 'vue'
import { ref } from 'vue'
const props = defineProps<{ value: { left: number; right: number } }>()
const emit = defineEmits<{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import type { Animation } from '@/models/animation'
import type { Project } from '@/models/project'
import type { Sprite } from '@/models/sprite'
import { defineProps, defineEmits, ref } from 'vue'
import { ref } from 'vue'
const props = defineProps<{
visible: boolean
Expand Down
2 changes: 1 addition & 1 deletion spx-gui/src/widgets/spx-runner/SpxRunner.ce.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</template>
<script setup lang="ts">
import ProjectRunner from '@/components/project/runner/ProjectRunner.vue'
import { ref, defineProps, watch } from 'vue'
import { ref, watch } from 'vue'
import { Project, fullName } from '@/models/project'
import { shallowRef } from 'vue'
const props = defineProps<{ owner?: string; name?: string }>()
Expand Down

0 comments on commit 9347e12

Please sign in to comment.