diff --git a/.eslintrc.json b/.eslintrc.json index 4b738c4..ddf3f86 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,7 +12,13 @@ "parserOptions": { "project": "./tsconfig.json" }, - "plugins": ["react", "import", "unused-imports", "jsx-a11y"], + "plugins": [ + "react", + "import", + "unused-imports", + "jsx-a11y", + "@typescript-eslint" + ], "rules": { // 関数の戻り値の型を明示的に指定する "@typescript-eslint/explicit-function-return-type": "error", @@ -77,17 +83,28 @@ // modelコンポーネントにおいて、pageのimportを禁止する { "target": "./src/components/model", - "from": ["./src/components/page"] + "from": [ + "./src/components/page", + "./node_modules/@radix-ui/", + "./node_modules/react-error-boundary" + ] }, // pageコンポーネントにおいて、他のpageコンポーネントからのimportを禁止する { "target": "./src/components/page/**/index.tsx", - "from": ["./src/components/page/**/index.tsx"] + "from": [ + "./src/components/page/**/index.tsx", + "./node_modules/@radix-ui/" + ] }, // appディレクトリ配下においてmodel,uiのimportを禁止する { "target": "./src/app/**/page.tsx", - "from": ["./src/components/model", "./src/components/ui"] + "from": [ + "./src/components/model", + "./src/components/ui", + "./node_modules/@radix-ui/" + ] } ] } @@ -178,8 +195,13 @@ "@typescript-eslint/consistent-type-imports": [ "error", { - "prefer": "type-imports" + "prefer": "type-imports", + "disallowTypeAnnotations": false, + "fixStyle": "inline-type-imports" } - ] + ], + "import/consistent-type-specifier-style": ["error", "prefer-top-level"], + + "@typescript-eslint/no-import-type-side-effects": ["error"] } } diff --git a/src/components/ui/Tag/index.tsx b/src/components/ui/Tag/index.tsx index ab74890..75f2494 100644 --- a/src/components/ui/Tag/index.tsx +++ b/src/components/ui/Tag/index.tsx @@ -1,8 +1,9 @@ import type { FC, HTMLAttributes, ReactNode } from 'react'; -import { cva, type VariantProps } from 'class-variance-authority'; +import { cva } from 'class-variance-authority'; import Link from 'next/link'; +import type { VariantProps } from 'class-variance-authority'; import type { LinkProps as NextLinkProps } from 'next/link'; import { cn } from '@/libs/utils'; diff --git a/src/libs/utils.ts b/src/libs/utils.ts index 1659b5e..9d7383e 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -1,4 +1,6 @@ -import { type ClassValue, clsx } from 'clsx'; +import { clsx } from 'clsx'; import { twMerge } from 'tailwind-merge'; +import type { ClassValue } from 'clsx'; + export const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));