{"id":12225,"library":"typescript-config-silverwind","title":"TypeScript Configuration by silverwind","description":"The `typescript-config-silverwind` package provides a highly opinionated and actively maintained base TypeScript configuration designed for modern JavaScript and TypeScript projects. Currently at version 17.0.0, this configuration package is typically updated to align with major TypeScript releases and evolving best practices, ensuring projects leverage the latest compiler features and strictness improvements. It serves as a foundational configuration, intended to be extended by project-specific `tsconfig.json` files, simplifying TypeScript setup and promoting consistency across repositories. The package emphasizes strong type checking and modern ECMAScript module patterns. Its key differentiator lies in offering a robust, pre-configured set of `compilerOptions` and `include` directives, aiming to reduce boilerplate and common configuration errors for developers by enforcing a consistent and high-quality TypeScript standard. It's often used as a dependency in other `silverwind` configuration packages, demonstrating its role as a core component in a larger ecosystem of opinionated developer tooling.","status":"active","version":"17.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/silverwind/typescript-config-silverwind","tags":["javascript"],"install":[{"cmd":"npm install typescript-config-silverwind","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-config-silverwind","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-config-silverwind","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This package is an 'extends' configuration for TypeScript and requires `typescript` itself to be installed as a peer dependency for compilation.","package":"typescript","optional":false}],"imports":[{"note":"This package is a TypeScript configuration preset, not a runtime library. It is consumed via the 'extends' property in your project's `tsconfig.json` file, not through JavaScript/TypeScript import statements.","wrong":"import { AnyConfig } from 'typescript-config-silverwind';","symbol":"Configuration Extension","correct":"{ \"extends\": \"typescript-config-silverwind\" } in tsconfig.json"},{"note":"When extending, your local 'include' and 'exclude' arrays *overwrite* the base config's. Explicitly define all desired files or patterns.","symbol":"tsconfig.json 'include' pattern","correct":"{ \"include\": [\"src/**/*\", \"test/**/*\"] } in tsconfig.json"},{"note":"Properties in 'compilerOptions' are merged, with your local `tsconfig.json` taking precedence for conflicting options.","symbol":"Configuration Override","correct":"{ \"extends\": \"typescript-config-silverwind\", \"compilerOptions\": { \"target\": \"es2021\" } } in tsconfig.json"}],"quickstart":{"code":"{\n  \"extends\": \"typescript-config-silverwind\",\n  \"compilerOptions\": {\n    // Override specific compiler options if needed\n    \"outDir\": \"./dist\",\n    \"jsx\": \"react-jsx\"\n  },\n  \"include\": [\n    \"src/**/*\",\n    \"types/**/*\",\n    \"test/**/*\",\n    \"**/.*\",\n    \"**/.*/**/*\",\n    \"**/.*/**/.*\"\n  ],\n  \"exclude\": [\n    \"node_modules\",\n    \"dist\"\n  ]\n}","lang":"typescript","description":"Demonstrates how to extend the `typescript-config-silverwind` preset in your project's `tsconfig.json`, including how to override specific `compilerOptions` and correctly specify `include` and `exclude` paths."},"warnings":[{"fix":"Always explicitly define all required `include` and `exclude` patterns in your project's `tsconfig.json` when extending this configuration to ensure correct file resolution.","message":"When extending `typescript-config-silverwind`, any `include` or `exclude` arrays defined in your project's `tsconfig.json` will *completely replace* those from the base configuration, rather than merging. This can inadvertently omit files from compilation or include unwanted ones, leading to build errors or unexpected type checking behavior.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Review the TypeScript release notes for the corresponding major version and adapt your codebase to meet the new strictness requirements. Gradually introduce the new configuration or fix errors as they appear.","message":"Each major version of `typescript-config-silverwind` likely updates its `compilerOptions` to reflect the latest TypeScript best practices and features. These updates can introduce stricter checks (e.g., `noImplicitAny`, `strictNullChecks`, `noUncheckedIndexedAccess`) that might cause existing code to fail compilation, especially if migrating from a less strict setup.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Do not attempt to import this package into your `.ts` or `.js` files. Its functionality is purely declarative through the `extends` property in `tsconfig.json`.","message":"This package is a `tsconfig.json` extender and does not expose any JavaScript/TypeScript modules for direct `import` or `require` statements in application code. Attempting to import symbols from `typescript-config-silverwind` will result in module resolution errors at compile or runtime, as its sole purpose is to configure the TypeScript compiler itself.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure your `tsconfig.json`'s `include` patterns explicitly cover all your source files, type declaration files, and other assets required for compilation, as they will completely override the base config's settings.","cause":"This error often occurs when the `include` or `exclude` arrays in your project's `tsconfig.json` overwrite the base configuration from `typescript-config-silverwind` and unintentionally omit necessary source files or declaration files.","error":"error TS6053: File '...' not found."},{"fix":"Add explicit type annotations (e.g., `function foo(param: string)`) to resolve these errors. If an `any` type is truly intended, explicitly declare it (e.g., `param: any`) to satisfy the compiler.","cause":"The `typescript-config-silverwind` configuration likely enables `noImplicitAny`, requiring explicit type annotations for function parameters, variables, or properties where TypeScript cannot infer a specific type.","error":"error TS7006: Parameter 'x' implicitly has an 'any' type."},{"fix":"Implement proper null/undefined checks (e.g., `if (obj) { obj.property }`), use optional chaining (`obj?.property`), or the non-null assertion operator (`obj!.property`) with caution if you are certain the value is not null/undefined at runtime.","cause":"This configuration enforces `strictNullChecks`, meaning that `null` and `undefined` are not assignable to types unless explicitly included (e.g., `string | null`). Accessing properties on potentially null or undefined values will result in this error.","error":"error TS2532: Object is possibly 'undefined'."}],"ecosystem":"npm"}