Skip to content

Commit

Permalink
Remove import for defineProps defineEmits and fix lint (snapshot-labs…
Browse files Browse the repository at this point in the history
…#581)

* Fix lint script

* Remove imports defineProps and defineEmits
  • Loading branch information
bonustrack authored Aug 26, 2021
1 parent 4ad9981 commit 4fbdba6
Show file tree
Hide file tree
Showing 63 changed files with 54 additions and 89 deletions.
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module.exports = {
'vue/script-setup-uses-vars': 'error'
},
globals: {
$ref: 'readonly'
$ref: 'readonly',
defineProps: 'readonly',
defineEmits: 'readonly'
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint src/*.ts --fix",
"lint": "eslint './src/*/**/*.{ts,vue,json}' --fix",
"postinstall": "patch-package"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Badges.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';
const props = defineProps({ address: String, members: Object });
Expand Down
2 changes: 0 additions & 2 deletions src/components/Block.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps, defineEmits } from 'vue';
defineProps({
title: String,
counter: Number,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Block/CastVote.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps, defineEmits } from 'vue';
import { computed } from 'vue';
import { useWeb3 } from '@/composables/useWeb3';
const props = defineProps({
Expand Down
2 changes: 0 additions & 2 deletions src/components/Block/Network.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps } from 'vue';
defineProps(['network']);
function getLogoUrl(key) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/Block/Plugin.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps } from 'vue';
defineProps(['plugin']);
function getLogoUrl(key) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Block/Results.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';
import jsonexport from 'jsonexport/dist';
import pkg from '@/../package.json';
import { useMediaQuery } from '@/composables/useMediaQuery';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Block/Space.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps, ref } from 'vue';
import { computed, ref } from 'vue';
import { getInstance } from '@snapshot-labs/lock/plugins/vue3';
import { useFollowSpace } from '@/composables/useFollowSpace';
import { useWeb3 } from '@/composables/useWeb3';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Block/Votes.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, watch, toRefs, defineProps } from 'vue';
import { ref, computed, watch, toRefs } from 'vue';
import { getChoiceString } from '@/helpers/utils';
import { useProfiles } from '@/composables/useProfiles';
import { useWeb3 } from '@/composables/useWeb3';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Checkbox.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, defineProps, defineEmits } from 'vue';
import { ref } from 'vue';
const props = defineProps({
modelValue: Boolean
Expand Down
2 changes: 0 additions & 2 deletions src/components/Container.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps } from 'vue';
defineProps({
slim: Boolean
});
Expand Down
2 changes: 0 additions & 2 deletions src/components/Icon.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps } from 'vue';
defineProps({
name: String,
size: String
Expand Down
2 changes: 1 addition & 1 deletion src/components/InputNumber.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, defineProps, defineEmits } from 'vue';
import { ref } from 'vue';
const props = defineProps({
modelValue: Number
Expand Down
1 change: 0 additions & 1 deletion src/components/Modal/About.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup>
import { defineEmits, defineProps } from 'vue';
import pkg from '@/../package.json';
import languages from '@/locales/languages.json';
import gateways from '@snapshot-labs/snapshot.js/src/gateways.json';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Account.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { toRefs, ref, watch, computed, defineProps, defineEmits } from 'vue';
import { toRefs, ref, watch, computed } from 'vue';
import { getInjected } from '@snapshot-labs/lock/src/utils';
import connectors from '@/helpers/connectors.json';
import { useWeb3 } from '@/composables/useWeb3';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/ClearDelegate.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, watchEffect, defineEmits, defineProps } from 'vue';
import { ref, watchEffect } from 'vue';
import { useI18n } from 'vue-i18n';
import { useUsername } from '@/composables/useUsername';
import { useNotifications } from '@/composables/useNotifications';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Confirm.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, defineProps, defineEmits } from 'vue';
import { ref, computed } from 'vue';
import { getChoiceString } from '@/helpers/utils';
import { useClient } from '@/composables/useClient';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Networks.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, defineProps, defineEmits } from 'vue';
import { ref, computed } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Plugins.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, watch, toRefs, defineProps, defineEmits } from 'vue';
import { ref, computed, watch, toRefs } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
import { clone } from '@/helpers/utils';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/ProposalPlugins.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, watch, toRefs, defineProps, defineEmits } from 'vue';
import { ref, watch, toRefs } from 'vue';
import { clone } from '@/helpers/utils';
import pluginsObj from '@snapshot-labs/snapshot.js/src/plugins';
import pluginsConfig from '@/components/Plugin/config.json';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/SelectDate.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, toRefs, watch, defineProps, defineEmits } from 'vue';
import { ref, toRefs, watch } from 'vue';
const props = defineProps({
open: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/SelectLanguage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps, defineEmits } from 'vue';
import { computed } from 'vue';
import languages from '@/locales/languages.json';
import { useI18n } from '@/composables/useI18n';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Skins.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, defineProps, defineEmits } from 'vue';
import { ref, computed } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
defineProps({
Expand Down
1 change: 0 additions & 1 deletion src/components/Modal/Strategies.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup>
import { defineProps, defineEmits } from 'vue';
import { isAddress } from '@ethersproject/address';
defineProps({ open: Boolean, strategies: Object, space: Object });
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Strategy.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, toRefs, watch, defineProps, defineEmits } from 'vue';
import { ref, computed, toRefs, watch } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
import { clone } from '@/helpers/utils';
Expand Down
1 change: 0 additions & 1 deletion src/components/Modal/Terms.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup>
import { defineProps, defineEmits } from 'vue';
import { getUrl } from '@snapshot-labs/snapshot.js/src/utils.ts';
const props = defineProps({ open: Boolean, space: Object });
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Validation.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, toRefs, watch, defineProps, defineEmits } from 'vue';
import { ref, computed, toRefs, watch } from 'vue';
import { useSearchFilters } from '@/composables/useSearchFilters';
import { clone } from '@/helpers/utils';
Expand Down
2 changes: 0 additions & 2 deletions src/components/Modal/VotingType.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps, defineEmits } from 'vue';
defineProps({
open: {
type: Boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/components/NoResults.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProposalPluginsContent.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps, defineEmits } from 'vue';
import { computed } from 'vue';
const props = defineProps({
id: String,
Expand Down
2 changes: 0 additions & 2 deletions src/components/ProposalPluginsSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps } from 'vue';
defineProps({
id: String,
space: Object,
Expand Down
1 change: 0 additions & 1 deletion src/components/Search.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup>
import { defineProps, defineEmits } from 'vue';
import { useRouter } from 'vue-router';
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchWithFilters.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineEmits } from 'vue';
import { computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
Expand Down
2 changes: 1 addition & 1 deletion src/components/State.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/StatefulIcon.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps, defineEmits } from 'vue';
import { computed } from 'vue';
const props = defineProps({
onName: String,
Expand Down
2 changes: 1 addition & 1 deletion src/components/TextareaArray.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, watch, defineProps, defineEmits } from 'vue';
import { ref, watch } from 'vue';
const props = defineProps({
modelValue: Array
Expand Down
11 changes: 1 addition & 10 deletions src/components/TextareaAutosize.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
<script setup>
import {
ref,
computed,
nextTick,
toRefs,
watch,
onMounted,
defineProps,
defineEmits
} from 'vue';
import { ref, computed, nextTick, toRefs, watch, onMounted } from 'vue';
const props = defineProps({
modelValue: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/TimelineProposal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { watchEffect, computed, defineProps } from 'vue';
import { watchEffect, computed } from 'vue';
import { useUsername } from '@/composables/useUsername';
import removeMd from 'remove-markdown';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Token.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';
import { formatBytes32String } from '@ethersproject/strings';
import { getUrl } from '@snapshot-labs/snapshot.js/src/utils.ts';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Avatar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, defineProps } from 'vue';
import { ref } from 'vue';
defineProps({
address: String,
Expand Down
2 changes: 0 additions & 2 deletions src/components/Ui/Button.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps } from 'vue';
defineProps({
loading: Boolean,
type: String,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Calendar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, computed, defineProps, defineEmits } from 'vue';
import { ref, computed } from 'vue';
import { useI18n } from 'vue-i18n';
const props = defineProps({ modelValue: String });
Expand Down
2 changes: 0 additions & 2 deletions src/components/Ui/Collapsible.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps, defineEmits } from 'vue';
defineProps({
open: Boolean,
title: String,
Expand Down
2 changes: 0 additions & 2 deletions src/components/Ui/Counter.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps } from 'vue';
defineProps({
counter: [Number, String]
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Dropdown.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, onBeforeUnmount, computed, defineProps, defineEmits } from 'vue';
import { ref, onBeforeUnmount, computed } from 'vue';
const props = defineProps({
items: Array,
Expand Down
2 changes: 0 additions & 2 deletions src/components/Ui/Input.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineProps, defineEmits } from 'vue';
const props = defineProps({
modelValue: [String, Number],
placeholder: String,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Markdown.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';
import { Remarkable } from 'remarkable';
import { linkify } from 'remarkable/linkify';
// import sanitizeHtml from 'sanitize-html';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Modal.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { watch, toRefs, defineProps } from 'vue';
import { watch, toRefs } from 'vue';
import { useModal } from '@/composables/useModal';
const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Popover.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { onMounted, ref, watch, defineProps } from 'vue';
import { onMounted, ref, watch } from 'vue';
import { createPopper } from '@popperjs/core';
import { useDebounce } from '@/composables/useDebounce';
import { useDetectInput } from '@/composables/useDetectInput';
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Progress.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';

const props = defineProps({ value: { Number, Array }, max: Number });

Expand Down
2 changes: 0 additions & 2 deletions src/components/Ui/Select.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup>
import { defineEmits, defineProps } from 'vue';

defineProps({ modelValue: [String, Number], disabled: Boolean });

const emit = defineEmits(['update:modelValue', 'change']);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/State.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';

const props = defineProps({
state: String
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Text.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, defineProps } from 'vue';
import { computed } from 'vue';
import Autolinker from 'autolinker';

const props = defineProps({
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ui/Textarea.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { ref, onMounted, toRefs, watch, defineProps, defineEmits } from 'vue';
import { ref, onMounted, toRefs, watch } from 'vue';

const props = defineProps({
modelValue: String,
Expand Down
Loading

0 comments on commit 4fbdba6

Please sign in to comment.