Skip to content

Enhance TypeScript configuration with recommended options #744

Description

@andi1984

Priority: LOW

Problem

The tsconfig.json is missing several recommended compiler options for VSCode extensions.

Solution

Add the following enhancements to tsconfig.json:

{
    "compilerOptions": {
        "module": "Node16",
        "target": "ES2022",  // Bump from ES2019 to ES2022
        "lib": ["ES2022"],
        "outDir": "out",
        "sourceMap": true,
        "skipLibCheck": true,
        "moduleResolution": "Node16",
        "esModuleInterop": true,
        "strict": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,  // Enable this
        "noImplicitReturns": true,   // Enable this
        "noFallthroughCasesInSwitch": true,  // Enable this
        "forceConsistentCasingInFileNames": true,  // Add this
        "resolveJsonModule": true,  // Add this for JSON imports
        "declaration": true,  // Generate .d.ts files
        "declarationMap": true  // Generate declaration source maps
    },
    "include": ["src/**/*", "test/**/*"],
    "exclude": ["node_modules", ".vscode-test", "out", "dist"]
}

Also add to package.json:

{
  "type": "commonjs",
  "engines": {
    "node": ">=18.0.0"
  }
}

Why These Matter

  • target: ES2022: VSCode engine supports modern JavaScript
  • noUnusedParameters: Prevents unused function parameters
  • noImplicitReturns: Ensures all code paths return values
  • forceConsistentCasingInFileNames: Prevents cross-platform issues
  • resolveJsonModule: Allows importing package.json for metadata

Priority

LOW - Configuration enhancement

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions