Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add import sorting #612

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 28 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ module.exports = {
'wikimedia',
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript'
'@vue/eslint-config-typescript',
'plugin:import/recommended',
'plugin:import/typescript'
],
'settings': {
'import/resolver': {
typescript: true,
node: true
}
},
'parserOptions': {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser'
Expand Down Expand Up @@ -98,7 +106,25 @@ module.exports = {
format: [ 'camelCase' ],
leadingUnderscore: 'forbid'
}
]
],
'sort-imports': [ 'error', {
ignoreCase: true,
ignoreDeclarationSort: true
} ],
'import/order': [ 1, {
groups: [ 'external', 'builtin', 'internal', 'sibling', 'parent', 'index' ],
pathGroups: [
{ pattern: '@src/createVueApp', group: 'external' },
{ pattern: '@banners/*', group: 'internal' },
{ pattern: '@src/*', group: 'internal' },
{ pattern: '@test/*', group: 'internal' },
{ pattern: '@environment/**', group: 'internal' }
],
alphabetize: {
order: 'asc',
caseInsensitive: true
}
} ]
},
'overrides': [
{
Expand Down
28 changes: 14 additions & 14 deletions banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ import { createVueApp } from '@src/createVueApp';
import './styles/styles.scss';

import BannerConductor from '@src/components/BannerConductor/FallbackBannerConductor.vue';
import Banner from './components/BannerCtrl.vue';
import FallbackBanner from './components/FallbackBanner.vue';
import { UrlRuntimeEnvironment } from '@src/utils/RuntimeEnvironment';
import { WindowResizeHandler } from '@src/utils/ResizeHandler';
import PageWPORG from '@src/page/PageWPORG';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';
import { createFormActions } from '@src/createFormActions';
import DynamicTextPlugin from '@src/DynamicTextPlugin';
import { WindowMediaWiki } from '@src/page/MediaWiki/WindowMediaWiki';
import PageWPORG from '@src/page/PageWPORG';
import { SkinFactory } from '@src/page/skin/SkinFactory';
import { WindowSizeIssueChecker } from '@src/utils/SizeIssueChecker/WindowSizeIssueChecker';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import TranslationPlugin from '@src/TranslationPlugin';
import { Translator } from '@src/Translator';
import DynamicTextPlugin from '@src/DynamicTextPlugin';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import { WindowResizeHandler } from '@src/utils/ResizeHandler';
import { UrlRuntimeEnvironment } from '@src/utils/RuntimeEnvironment';
import { WindowSizeIssueChecker } from '@src/utils/SizeIssueChecker/WindowSizeIssueChecker';
import { WindowTimer } from '@src/utils/Timer';
import Banner from './components/BannerCtrl.vue';
import FallbackBanner from './components/FallbackBanner.vue';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';
import messages from './messages';

const date = new Date();
const localeFactory = new LocaleFactoryDe();
Expand Down
28 changes: 14 additions & 14 deletions banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@ import { createVueApp } from '@src/createVueApp';
import './styles/styles_var.scss';

import BannerConductor from '@src/components/BannerConductor/FallbackBannerConductor.vue';
import Banner from './components/BannerVar.vue';
import FallbackBanner from './components/FallbackBanner.vue';
import { UrlRuntimeEnvironment } from '@src/utils/RuntimeEnvironment';
import { WindowResizeHandler } from '@src/utils/ResizeHandler';
import PageWPORG from '@src/page/PageWPORG';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';
import { createFormActions } from '@src/createFormActions';
import DynamicTextPlugin from '@src/DynamicTextPlugin';
import { WindowMediaWiki } from '@src/page/MediaWiki/WindowMediaWiki';
import PageWPORG from '@src/page/PageWPORG';
import { SkinFactory } from '@src/page/skin/SkinFactory';
import { WindowSizeIssueChecker } from '@src/utils/SizeIssueChecker/WindowSizeIssueChecker';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import TranslationPlugin from '@src/TranslationPlugin';
import { Translator } from '@src/Translator';
import DynamicTextPlugin from '@src/DynamicTextPlugin';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
import { LocalImpressionCount } from '@src/utils/LocalImpressionCount';
import { LegacyTrackerWPORG } from '@src/tracking/LegacyTrackerWPORG';
import { WindowResizeHandler } from '@src/utils/ResizeHandler';
import { UrlRuntimeEnvironment } from '@src/utils/RuntimeEnvironment';
import { WindowSizeIssueChecker } from '@src/utils/SizeIssueChecker/WindowSizeIssueChecker';
import { WindowTimer } from '@src/utils/Timer';
import Banner from './components/BannerVar.vue';
import FallbackBanner from './components/FallbackBanner.vue';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import eventMappings from './event_map';
import { createFallbackDonationURL } from '@src/createFallbackDonationURL';
import messages from './messages';
import { LocaleFactoryDe } from '@src/utils/LocaleFactory/LocaleFactoryDe';
import { createFormItems } from './form_items';
import { createFormActions } from '@src/createFormActions';
import { currentCampaignTimePercentage } from './currentCampaignTimePercentage';
import { WindowTimer } from '@src/utils/Timer';
import messages from './messages';

const date = new Date();
const localeFactory = new LocaleFactoryDe();
Expand Down
34 changes: 17 additions & 17 deletions banners/desktop/C24_WMDE_Desktop_DE_00/components/BannerCtrl.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,35 +83,35 @@
</template>

<script setup lang="ts">
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import { ref, watch } from 'vue';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import SoftClose from '@src/components/SoftClose/SoftClose.vue';
import MainBanner from './MainBanner.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import BannerText from '../content/BannerText.vue';
import BannerSlides from '../content/BannerSlides.vue';
import AlreadyDonatedContent from '../content/AlreadyDonatedContent.vue';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
import AlreadyDonatedModal from '@src/components/AlreadyDonatedModal/AlreadyDonatedModal.vue';
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import { useAnonymousAddressTypeSetter } from '@src/components/composables/useAnonymousAddressTypeSetter';
import { useFormModel } from '@src/components/composables/useFormModel';
import MainDonationForm from '@src/components/DonationForm/Forms/MainDonationForm.vue';
import UpgradeToYearlyButtonForm from '@src/components/DonationForm/Forms/UpgradeToYearlyButtonForm.vue';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import { useFormModel } from '@src/components/composables/useFormModel';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
import {
createSubmittableMainDonationForm
} from '@src/components/DonationForm/StepControllers/SubmittableMainDonationForm';
import {
createSubmittableUpgradeToYearly
} from '@src/components/DonationForm/StepControllers/SubmittableUpgradeToYearly';
import FooterAlreadyDonated from '@src/components/Footer/FooterAlreadyDonated.vue';
import ProgressBar from '@src/components/ProgressBar/DoubleProgressBar.vue';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import SoftClose from '@src/components/SoftClose/SoftClose.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import WMDEFundsForwardingDE from '@src/components/UseOfFunds/Infographics/WMDEFundsForwardingDE.vue';
import { CloseChoices } from '@src/domain/CloseChoices';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import { CloseEvent } from '@src/tracking/events/CloseEvent';
import { TrackingFeatureName } from '@src/tracking/TrackingEvent';
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import ProgressBar from '@src/components/ProgressBar/DoubleProgressBar.vue';
import FooterAlreadyDonated from '@src/components/Footer/FooterAlreadyDonated.vue';
import AlreadyDonatedModal from '@src/components/AlreadyDonatedModal/AlreadyDonatedModal.vue';
import { useAnonymousAddressTypeSetter } from '@src/components/composables/useAnonymousAddressTypeSetter';
import WMDEFundsForwardingDE from '@src/components/UseOfFunds/Infographics/WMDEFundsForwardingDE.vue';
import MainBanner from './MainBanner.vue';
import AlreadyDonatedContent from '../content/AlreadyDonatedContent.vue';
import BannerSlides from '../content/BannerSlides.vue';
import BannerText from '../content/BannerText.vue';

enum ContentStates {
Main = 'wmde-banner-wrapper--main',
Expand Down
42 changes: 21 additions & 21 deletions banners/desktop/C24_WMDE_Desktop_DE_00/components/BannerVar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,41 +97,41 @@
</template>

<script setup lang="ts">
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import { inject, ref, watch } from 'vue';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import SoftClose from '@src/components/SoftClose/SoftClose.vue';
import MainBanner from './MainBanner.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import BannerText from '../content/BannerText.vue';
import BannerSlides from '../content/BannerSlides.vue';
import AlreadyDonatedContent from '../content/AlreadyDonatedContent.vue';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
import AlreadyDonatedModal from '@src/components/AlreadyDonatedModal/AlreadyDonatedModal.vue';
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import { useAnonymousAddressTypeSetter } from '@src/components/composables/useAnonymousAddressTypeSetter';
import { useFormModel } from '@src/components/composables/useFormModel';
import MainDonationForm from '@src/components/DonationForm/Forms/MainDonationForm.vue';
import UpgradeToYearlyButtonForm from '@src/components/DonationForm/Forms/UpgradeToYearlyButtonForm.vue';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import { useFormModel } from '@src/components/composables/useFormModel';
import MultiStepDonation from '@src/components/DonationForm/MultiStepDonation.vue';
import {
createSubmittableMainDonationForm
} from '@src/components/DonationForm/StepControllers/SubmittableMainDonationForm';
import {
createSubmittableUpgradeToYearly
} from '@src/components/DonationForm/StepControllers/SubmittableUpgradeToYearly';
import BannerFooter from '@src/components/Footer/BannerFooter.vue';
import FooterAlreadyDonated from '@src/components/Footer/FooterAlreadyDonated.vue';
import ChevronDownIcon from '@src/components/Icons/ChevronDownIcon.vue';
import ProgressBar from '@src/components/ProgressBar/DoubleProgressBar.vue';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import SoftClose from '@src/components/SoftClose/SoftClose.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import WMDEFundsForwardingDE from '@src/components/UseOfFunds/Infographics/WMDEFundsForwardingDE.vue';
import { CloseChoices } from '@src/domain/CloseChoices';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import { CloseEvent } from '@src/tracking/events/CloseEvent';
import { TrackingFeatureName } from '@src/tracking/TrackingEvent';
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import ProgressBar from '@src/components/ProgressBar/DoubleProgressBar.vue';
import FooterAlreadyDonated from '@src/components/Footer/FooterAlreadyDonated.vue';
import AlreadyDonatedModal from '@src/components/AlreadyDonatedModal/AlreadyDonatedModal.vue';
import { Tracker } from '@src/tracking/Tracker';
import ChevronDownIcon from '@src/components/Icons/ChevronDownIcon.vue';
import BannerFooter from '@src/components/Footer/BannerFooter.vue';
import { TrackingFeatureName } from '@src/tracking/TrackingEvent';
import MainBanner from './MainBanner.vue';
import MinimisedBanner from './MinimisedBanner.vue';
import { BannerMinimisedEvent } from '../events/BannerMinimisedEvent';
import AlreadyDonatedContent from '../content/AlreadyDonatedContent.vue';
import BannerSlides from '../content/BannerSlides.vue';
import BannerText from '../content/BannerText.vue';
import { BannerMaximisedEvent } from '../events/BannerMaximisedEvent';
import { useAnonymousAddressTypeSetter } from '@src/components/composables/useAnonymousAddressTypeSetter';
import WMDEFundsForwardingDE from '@src/components/UseOfFunds/Infographics/WMDEFundsForwardingDE.vue';
import { BannerMinimisedEvent } from '../events/BannerMinimisedEvent';

enum ContentStates {
Main = 'wmde-banner-wrapper--main',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,26 @@

<script setup lang="ts">

import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import { CloseChoices } from '@src/domain/CloseChoices';
import { CloseEvent } from '@src/tracking/events/CloseEvent';
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import { computed, inject, ref } from 'vue';
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import { useDisplaySwitch } from '@src/components/composables/useDisplaySwitch';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import FallbackSlides from '../content/FallbackSlides.vue';
import FallbackButton from '@src/components/FallbackBanner/FallbackButton.vue';
import LargeFooter from '@src/components/FallbackBanner/LargeFooter.vue';
import SmallFooter from '@src/components/FallbackBanner/SmallFooter.vue';
import ChevronLeftIcon from '@src/components/Icons/ChevronLeftIcon.vue';
import ChevronRightIcon from '@src/components/Icons/ChevronRightIcon.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import FallbackText from '../content/FallbackText.vue';
import ProgressBar from '@src/components/ProgressBar/ProgressBarAlternative.vue';
import FallbackButton from '@src/components/FallbackBanner/FallbackButton.vue';
import SmallFooter from '@src/components/FallbackBanner/SmallFooter.vue';
import LargeFooter from '@src/components/FallbackBanner/LargeFooter.vue';
import { Tracker } from '@src/tracking/Tracker';
import { FallbackBannerSubmitEvent } from '@src/tracking/events/FallbackBannerSubmitEvent';
import KeenSlider from '@src/components/Slider/KeenSlider.vue';
import FundsModal from '@src/components/UseOfFunds/FundsModal.vue';
import WMDEFundsForwardingDE from '@src/components/UseOfFunds/Infographics/WMDEFundsForwardingDE.vue';
import { CloseChoices } from '@src/domain/CloseChoices';
import { UseOfFundsContent as useOfFundsContentInterface } from '@src/domain/UseOfFunds/UseOfFundsContent';
import { CloseEvent } from '@src/tracking/events/CloseEvent';
import { FallbackBannerSubmitEvent } from '@src/tracking/events/FallbackBannerSubmitEvent';
import { Tracker } from '@src/tracking/Tracker';
import FallbackSlides from '../content/FallbackSlides.vue';
import FallbackText from '../content/FallbackText.vue';

interface Props {
bannerState: BannerStates;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ tart<template>

<script setup lang="ts">

import { useDisplaySwitch } from '@src/components/composables/useDisplaySwitch';
import { computed, nextTick, ref } from 'vue';
import { BannerStates } from '@src/components/BannerConductor/StateMachine/BannerStates';
import { useDisplaySwitch } from '@src/components/composables/useDisplaySwitch';

interface Props {
bannerState: BannerStates;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
</template>

<script setup lang="ts">
import MinimisedText from '../content/MinimisedText.vue';
import ButtonClose from '@src/components/ButtonClose/ButtonClose.vue';
import ChevronDownIcon from '@src/components/Icons/ChevronDownIcon.vue';
import MinimisedText from '../content/MinimisedText.vue';
defineEmits( [ 'close', 'maximise', 'maximise-cta' ] );
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
</template>

<script setup lang="ts">
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';
import { inject, onMounted, onUnmounted } from 'vue';
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import KeenSliderSlide from '@src/components/Slider/KeenSliderSlide.vue';
import AnimatedText from '@src/components/AnimatedText/AnimatedText.vue';
import { useLiveDateAndTime } from '@src/components/composables/useLiveDateAndTime';
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import KeenSliderSlide from '@src/components/Slider/KeenSliderSlide.vue';
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';

interface Props {
currentSlide: number
Expand Down
4 changes: 2 additions & 2 deletions banners/desktop/C24_WMDE_Desktop_DE_00/content/BannerText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

<script setup lang="ts">
import { inject, onMounted, onUnmounted } from 'vue';
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import AnimatedText from '@src/components/AnimatedText/AnimatedText.vue';
import { useLiveDateAndTime } from '@src/components/composables/useLiveDateAndTime';
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';

const {
currentDayName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
</template>

<script setup lang="ts">
import KeenSliderSlide from '@src/components/Slider/KeenSliderSlide.vue';
import ProgressBar from '@src/components/ProgressBar/ProgressBarAlternative.vue';
import FallbackBank from '@src/components/FallbackBanner/FallbackBank.vue';
import ProgressBar from '@src/components/ProgressBar/ProgressBarAlternative.vue';
import KeenSliderSlide from '@src/components/Slider/KeenSliderSlide.vue';

interface Props {
currentSlide: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

<script setup lang="ts">
import { inject } from 'vue';
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import AnimatedText from '@src/components/AnimatedText/AnimatedText.vue';
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';

const {
campaignDaySentence,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
</div>
</template>
<script setup lang="ts">
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import { inject, onMounted, onUnmounted } from 'vue';
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';
import { useLiveDateAndTime } from '@src/components/composables/useLiveDateAndTime';
import InfoIcon from '@src/components/Icons/InfoIcon.vue';
import { DynamicContent } from '@src/utils/DynamicContent/DynamicContent';

const {
getCurrentDateAndTime
Expand Down
Loading
Loading