diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 4a5f255..4230b95 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -22,7 +22,7 @@ module.exports = { plugins: ["import"], rules: { "import/exports-last": "error", - "import/extensions": ["error", "always"], + "import/extensions": ["error", "ignorePackages"], "import/first": "error", "import/newline-after-import": "error", "import/no-default-export": "error", diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 16552da..52ce328 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -38,6 +38,7 @@ class Kernel extends HttpKernel \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, + \Illuminate\Http\Middleware\AddLinkHeadersForPreloadedAssets::class, ], 'api' => [ diff --git a/tsconfig.app.json b/tsconfig.app.json index ce4560d..0710531 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -1,4 +1,5 @@ { + "extends": "./tsconfig.json", "include": ["resources/js"], "exclude": ["resources/js/**/__tests__/*"], "compilerOptions": { @@ -19,11 +20,6 @@ "isolatedModules": true, "noEmit": true, - /* Absolute imports */ - "paths": { - "@/*": ["./resources/js/*"] - }, - /* Linting */ "strict": true, "noUnusedLocals": true, diff --git a/tsconfig.json b/tsconfig.json index 4b55668..d5cab78 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,12 @@ { "files": [], + "compilerOptions": { + // Absolute imports. Define here instead of tsconfig.app.json because e.g. eslint-import-resolver-typescript + // and shadcn-ui don't support project references and only read directly from this file + "paths": { + "@/*": ["./resources/js/*"] + } + }, "references": [ { "path": "./tsconfig.app.json" diff --git a/vite.config.ts b/vite.config.ts index 7847686..d1108b1 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,6 +1,6 @@ import laravel from "laravel-vite-plugin"; import { defineConfig } from "vite"; -import { configDefaults } from "vitest/config"; // eslint-disable-line import/extensions +import { configDefaults } from "vitest/config"; // Exclude everything except resources/js/ const projectExcludes = [