Skip to content

Commit 366194d

Browse files
committed
feat: add import sorting rule in eslint
1 parent 7423f8e commit 366194d

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

eslint.config.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ export default defineConfigWithVueTs(
4141
"rules": {
4242

4343
/* Disabled rules */
44-
"vue/multi-word-component-names" : ["off"], // why do I need to use multiple words for a 'Layout' component, for example?
45-
"vue/no-multiple-template-root" : ["off"], // no need for this rule since Vue 3.x
46-
"unicorn/no-null" : ["off"], // the second argument of 'JSON#stringify' doesn't accept 'undefined' to save formatting
47-
"unicorn/prefer-global-this" : ["off"], // no need for this rule since this app is fully CSR, and Web Workers are not going to be used
48-
"unicorn/prefer-top-level-await" : ["off"], // top level await is broken somehow
44+
"vue/multi-word-component-names" : ["off"], // Why do I need to use multiple words for a 'Layout' component, for example?
45+
"vue/no-multiple-template-root" : ["off"], // No need for this rule since Vue 3.x
46+
"unicorn/no-null" : ["off"], // The second argument of 'JSON#stringify' doesn't accept 'undefined' to save formatting
47+
"unicorn/prefer-global-this" : ["off"], // No need for this rule since this app is fully CSR, and Web Workers are not going to be used
48+
"unicorn/prefer-top-level-await" : ["off"], // Top level await is broken somehow
4949
"unicorn/prefer-query-selector" : ["off"], // 'getElementById' is a lot easier to use
50-
"unicorn/prefer-at" : ["off"], // requires a different lib version
51-
"@stylistic/no-multi-spaces" : ["off"], // conflicts with 'eslint@stylistic/key-spacing'
50+
"unicorn/prefer-at" : ["off"], // Requires a different lib version
51+
"@stylistic/no-multi-spaces" : ["off"], // Conflicts with 'eslint@stylistic/key-spacing'
5252
"@stylistic/line-comment-position": ["off"], // I don't see any problems using both above and beside comments
53-
"@stylistic/linebreak-style" : ["off"], // conflicts with git
54-
"@stylistic/eol-last" : ["off"], // conflicts with git
53+
"@stylistic/linebreak-style" : ["off"], // Conflicts with git
54+
"@stylistic/eol-last" : ["off"], // Conflicts with git
5555

5656
/* Important */
5757
"@stylistic/semi" : ["error", "always"],
@@ -65,6 +65,13 @@ export default defineConfigWithVueTs(
6565

6666
/* ESLint */
6767
"capitalized-comments": ["warn", "always"],
68+
"sort-imports" : ["warn", {
69+
"allowSeparatedGroups" : false,
70+
"ignoreCase" : false,
71+
"ignoreDeclarationSort": false,
72+
"ignoreMemberSort" : false,
73+
"memberSyntaxSortOrder": ["multiple", "single", "all", "none"],
74+
}],
6875

6976
// Element IDs simplify styling for plugins
7077
"@vue-require-id/require-id": ["warn", {

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ErrorBoundary from "@/components/handlers/ErrorBoundary.vue";
55
import GlobalError from "@/components/statuses/GlobalError.vue";
66
import ExtensionsError from "@/components/statuses/ExtensionsError.vue";
77
import NonBundledClasses from "@/components/misc/NonBundledClasses.vue";
8-
import { provide, shallowReactive, nextTick, defineAsyncComponent } from "vue";
8+
import { defineAsyncComponent, nextTick, provide, shallowReactive } from "vue";
99
import {
1010
ApplicationNamespace, ContextMenuItems,
1111
GlobalStatesChangerContextKey,

src/main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1+
import App from "@/App.vue";
12
import { ApplicationRootID } from "@/constants/application";
23
import { createApp } from "vue";
3-
import { initializeLauncher } from "@/lib/main/initialize-launcher.ts";
44
import { declareWindow } from "@/lib/main/declare-window.ts";
5+
import { initializeLauncher } from "@/lib/main/initialize-launcher.ts";
56
import { log } from "@/lib/handlers/log.ts";
67
import { prepareLogFile } from "@/lib/main/prepare-log-file.ts";
7-
import App from "@/App.vue";
88
// Import UnoCSS essentials
99
import "virtual:uno.css";
1010
// Reset all CSS styles in a Tailwind style
1111
import "@unocss/reset/tailwind.css";
1212
import "@/globals.css";
1313
// Import styles that are necessary for Material You ripple effect
1414
import "m3ripple-vue/style.css";
15-
// import "core-js/actual";
16-
// asdf.
1715

1816
await prepareLogFile().catch((error: unknown) => {
1917
log.error("Failed to prepare a log file:", JSON.stringify(error));

0 commit comments

Comments
 (0)