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

相対import部分を修正 #2417

Draft
wants to merge 3 commits 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
"plugin:@voicevox/all",
"plugin:storybook/recommended",
],
plugins: ["import"],
plugins: ["import", "no-relative-import-paths"],
parser: vueEslintParser,
parserOptions: vueEslintParserOptions,
ignorePatterns: ["dist/**/*", "dist_*/**/*", "node_modules/**/*"],
Expand Down Expand Up @@ -92,6 +92,14 @@ module.exports = {
},
],
"import/order": "error",
"no-relative-import-paths/no-relative-import-paths": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"import/no-relative-parent-imports": "error"の設定だけで確認してみました。
見てくれる範囲を広くする方法がないか考えてみます。

eslint-plugin-importでのESLintエラー
> [email protected] lint
> eslint --ext .js,.vue,.ts,.mts *.config.* src tests build .storybook


/Users/jdkfx/Desktop/workspace/voicevox/src/components/Dialog/EngineManageDialog.vue
  270:29  error  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move `EngineManageDialog.vue` to same directory as `../Base/BaseToggleGroup.vue` or consider making `../Base/BaseToggleGroup.vue` a package          import/no-relative-parent-imports
  271:33  error  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move `EngineManageDialog.vue` to same directory as `../Base/BaseToggleGroupItem.vue` or consider making `../Base/BaseToggleGroupItem.vue` a package  import/no-relative-parent-imports

/Users/jdkfx/Desktop/workspace/voicevox/src/components/Menu/ContextMenu/Presentation.vue
  31:22  error  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move `Presentation.vue` to same directory as `../MenuItem.vue` or consider making `../MenuItem.vue` a package  import/no-relative-parent-imports

/Users/jdkfx/Desktop/workspace/voicevox/src/components/Menu/MenuBar/MenuBar.vue
  33:24  error  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move `MenuBar.vue` to same directory as `../MenuButton.vue` or consider making `../MenuButton.vue` a package  import/no-relative-parent-imports

/Users/jdkfx/Desktop/workspace/voicevox/src/components/Sing/ToolBar/ToolBar.vue
  163:37  error  Relative imports from parent directories are not allowed. Please either pass what you're importing through at runtime (dependency injection), move `ToolBar.vue` to same directory as `../PlayheadPositionDisplay.vue` or consider making `../PlayheadPositionDisplay.vue` a package  import/no-relative-parent-imports

✖ 5 problems (5 errors, 0 warnings)

"error",
{
allowSameFolder: true,
rootDir: "src",
prefix: "@",
},
],
},
overrides: [
{
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-no-relative-import-paths": "1.5.5",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-vue": "9.26.0",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/electron/manager/engineInfoManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { dialog } from "electron"; // FIXME: ここでelectronをimportするの

import log from "electron-log/main";

import { getConfigManager } from "../electronConfig";
import { getConfigManager } from "@/backend/electron/electronConfig";
import {
EngineInfo,
EngineDirValidationResult,
Expand Down
6 changes: 3 additions & 3 deletions src/backend/electron/manager/engineProcessManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import treeKill from "tree-kill";
import { app, dialog } from "electron"; // FIXME: ここでelectronをimportするのは良くない

import log from "electron-log/main";
import { getEngineInfoManager } from "./engineInfoManager";
import {
findAltPort,
getPidFromPort,
getProcessNameFromPid,
type HostInfo,
isAssignablePort,
} from "../portHelper";
} from "@/backend/electron/portHelper";

import { getConfigManager } from "../electronConfig";
import { getEngineInfoManager } from "./engineInfoManager";
import { getConfigManager } from "@/backend/electron/electronConfig";
import { EngineId, EngineInfo } from "@/type/preload";

type EngineProcessContainer = {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dialog/EngineManageDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@

<script setup lang="ts">
import { computed, ref, watch } from "vue";
import BaseToggleGroup from "../Base/BaseToggleGroup.vue";
import BaseToggleGroupItem from "../Base/BaseToggleGroupItem.vue";
import BaseToggleGroup from "@/components/Base/BaseToggleGroup.vue";
import BaseToggleGroupItem from "@/components/Base/BaseToggleGroupItem.vue";
import BaseButton from "@/components/Base/BaseButton.vue";
import BaseListItem from "@/components/Base/BaseListItem.vue";
import BaseNavigationView from "@/components/Base/BaseNavigationView.vue";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
</template>

<script setup lang="ts">
import { notifyResult } from "../Dialog";
import Presentation, { ExportTarget } from "./Presentation.vue";
import { notifyResult } from "@/components/Dialog/Dialog";
import { useStore } from "@/store";
import { SaveResultObject, SongExportSetting } from "@/store/type";

Expand Down
4 changes: 2 additions & 2 deletions src/components/Menu/ContextMenu/Presentation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<script setup lang="ts">
import { onMounted, onUnmounted, ref } from "vue";
import { QMenu } from "quasar";
import MenuItem from "../MenuItem.vue";
import { MenuItemButton, MenuItemSeparator } from "../type";
import MenuItem from "@/components/Menu/MenuItem.vue";
import { MenuItemButton, MenuItemSeparator } from "@/components/Menu/type";

defineProps<{
header?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Menu/MenuBar/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
<script setup lang="ts">
import { ref, computed, watch } from "vue";
import { useQuasar } from "quasar";
import { MenuItemData, MenuItemRoot } from "../type";
import MenuButton from "../MenuButton.vue";
import TitleBarButtons from "./TitleBarButtons.vue";
import TitleBarEditorSwitcher from "./TitleBarEditorSwitcher.vue";
import { MenuItemData, MenuItemRoot } from "@/components/Menu/type";
import MenuButton from "@/components/Menu/MenuButton.vue";
import { useStore } from "@/store";
import { HotkeyAction, useHotkeyManager } from "@/plugins/hotkeyPlugin";
import { useEngineIcons } from "@/composables/useEngineIcons";
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sing/ToolBar/ToolBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@

<script setup lang="ts">
import { computed, watch, ref } from "vue";
import PlayheadPositionDisplay from "../PlayheadPositionDisplay.vue";
import EditTargetSwicher from "./EditTargetSwicher.vue";
import PlayheadPositionDisplay from "@/components/Sing/PlayheadPositionDisplay.vue";
import { useStore } from "@/store";

import {
Expand Down
Loading