diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index bddf1af1a..f1fc3d9c8 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -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'
@@ -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': [
{
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts
index 157314205..840fd92f9 100644
--- a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts
+++ b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_ctrl.ts
@@ -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();
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts
index 73c0d83df..2021bbd47 100644
--- a/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts
+++ b/banners/desktop/C24_WMDE_Desktop_DE_00/banner_var.ts
@@ -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();
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/components/BannerCtrl.vue b/banners/desktop/C24_WMDE_Desktop_DE_00/components/BannerCtrl.vue
index add3da97f..b8cb63a24 100644
--- a/banners/desktop/C24_WMDE_Desktop_DE_00/components/BannerCtrl.vue
+++ b/banners/desktop/C24_WMDE_Desktop_DE_00/components/BannerCtrl.vue
@@ -83,35 +83,35 @@
diff --git a/banners/desktop/C24_WMDE_Desktop_DE_00/content/BannerSlides.vue b/banners/desktop/C24_WMDE_Desktop_DE_00/content/BannerSlides.vue
index 84fc90e15..647efe8cc 100644
--- a/banners/desktop/C24_WMDE_Desktop_DE_00/content/BannerSlides.vue
+++ b/banners/desktop/C24_WMDE_Desktop_DE_00/content/BannerSlides.vue
@@ -30,12 +30,12 @@
diff --git a/banners/thank_you/content/lose/MiniBannerSlides.de.vue b/banners/thank_you/content/lose/MiniBannerSlides.de.vue
index 116118ef3..edff908bc 100644
--- a/banners/thank_you/content/lose/MiniBannerSlides.de.vue
+++ b/banners/thank_you/content/lose/MiniBannerSlides.de.vue
@@ -13,8 +13,8 @@