Skip to content

VS Code cannot use tsconfig.eslint.json #2676

Description

@Anders2303

When type validation runs via npm run typecheck (for example in the github actions pipeline) we're pointing it to tsconfig.eslint.json. However, VS Code will only run Typescript using tsconfig.json, and there is no way (at least from what I could find out) to configure it to use tsconfig.eslint.json instead. This means that the includes/excludes are different, causing unexpected validation errors when you set up a PR.

Most notably, all story files get ignored by VS Code, but this is then overwritten when using tsconfig.eslint.json,

// tsconfig.json
    "exclude": [
        "__mocks__",
        "cypress",
        "coverage",
        "**/*.test.ts",
        "**/*.test.tsx",
        "**/test/*.ts",
        "**/test/*.tsx",
        "**/*.stories.tsx"
    ],
// tsconfig.eslint.json
   "exclude": [
        "coverage",
        "dist",
        "docs",
        "example-data",
        "node_modules",
        "./package-lock.json"
    ]

Is there any particular reason the configs have been set up like this? Do we actually need tsconfig.eslint.json, or can we just merge it into the base config?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions