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

Improve type-compiler handing of extends field in tsconfig #600

Open
lionelhorn opened this issue Jul 11, 2024 · 0 comments
Open

Improve type-compiler handing of extends field in tsconfig #600

lionelhorn opened this issue Jul 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lionelhorn
Copy link
Contributor

TLDR : when "extends" is an array in tsconfig, type-compiler crashes.

While using deepkit vite plugin like that

// vite.config.ts

export default defineConfig({
  [...]
    plugins: [
        deepkitType({
            tsConfig: resolve(__dirname, "tsconfig.json"),
            compilerOptions: {
                "sourceMap": true,
            }
        }),
    // [...]
    ],
})

// tsconfig.json

{
    "include": ["**/*.ts", "**/*.tsx"],
    "extends": ["@epic-web/config/typescript"],
    "compilerOptions": {
        "paths": {
            "#app/*": ["./app/*"],
            "#tests/*": ["./tests/*"],
            "@/icon-name": [
                "./app/components/ui/icons/name.d.ts",
                "./types/icon-name.d.ts"
            ]
        }
    },
    "reflection": "true"
}

const path = join(basePath, currentConfig.extends);

Will crash with TypeError: The "path" argument must be of type string. Received an instance of Array

According to https://www.typescriptlang.org/tsconfig/#extends it's supposed to be a string.
According to the tsconfig-schema.json and the "intellisense" like highlight in my IDE, it can be array | string.

@marcj marcj added the enhancement New feature or request label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants