Docs review === # TSConfig Oneliners ## Questions to answer - What are the best one-liners to describe each tsconfig options? - Can the schema JSON be generated from the website? > - **Date:** Aug 25th, Sept 2nd, Sept 23rd, Nov 4th 2020 > - **Agenda** > 1. Review the places where we show TS Config one-liners (schema, playground, tsconfig hovers in the site) `5min` > 2. Go over gist one by one: ~~15min~~ ~2 hours > 5. Open discussion: `~` ## Sources of info Website: - `baseUrl`: [en](https://github.com/microsoft/TypeScript-website/blob/1ea2f12148009280e2686449d9c1cdbb0e23beac/packages/tsconfig-reference/copy/en/options/baseUrl.md#L1) [pt](https://github.com/microsoft/TypeScript-website/blob/1ea2f12148009280e2686449d9c1cdbb0e23beac/packages/tsconfig-reference/copy/pt/options/baseUrl.md#L3) - Schema Store: https://json.schemastore.org/tsconfig [Consolidated into a CSV in a gist](https://gist.github.com/orta/264947f311321a9cd122fa3f74b78a1e) ## Action Items - Remove version references ## Notes - `allowJs` - Allow JS files` to be a part of your program. Use checkJS to get errors from these files. - `allowUmdGlobalAccess` accessing UMD globals from modules - `allowUnreachableCode` Do not report errors on unreachable code. - `allowUnusedLabels` Do not report errors on unused labels. - `assumeChangesOnlyAffectDirectDependencies` - Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. - `baseUrl` - Base directory to resolve non-relative module names. - `charset` - Manually set the text encoding for reading files - `checkJS` - Report errors in type-checked JavaScript files. - `composite` - Enables constraints to allow the project, to be used building for with project references. - `declarations` - Generates .d.ts files from TypeScript and JavaScript files in your project. - Specify output directory for generated declaration files - Create sourcemaps for d.ts files - `diagnostic` - Output compiler performance information after building - `disableReferencedProjectLoad` - Reduces the number of projects loaded automatically by TypeScript - `disableSizeLimit` - Remove the 20mb memory cap on the TypeScript language server for JavaScript files - `disableSolutionSearching` - Opt a project out of multi-project reference checking when editing - `disableSourceOfProjectReferenceRedirect` - Use d.ts files as the source of truth for tooling between composite project boundries - `eimtBOM` Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. - `emitDeclarationOnly` - Only output d.ts files and not .js files - Emit design-type metadata for decorated declarations in source - Emit additional JS to ease support for importing commonjs modules, and enables '--allowSyntheticDefaultImports' for typesystem compatibility. - `excludes`: Filters results from the `include` option. - `experimentalDecorators` - Enable experimental support for TC39 stage 2 draft decorators based on the - `extendedDiagnostics` - Output more detailed compiler performance information after building - `extends` - Path, node module reference, or an array of either, to base configuration files to inherit from. - `files` - Include a list of files. Use includes for pattern support. - `forceConsistentCasingInFileNames` - Ensure that casing is correct in imports. - Emit a v8 CPU profile of the compiler run for debugging - Allow importing helper functions from tslib once per project, instead of including them per-file - `importsNotUsedAsValues` - Specify emit/checking behavior for imports that are only used for types - Specifies a list of glob patterns that match files to be included in compilation - Save .tsbuildinfo files to allow for incremental compilation of projects - `inlinesourcemap` Include sourcemap files inside the emitted JavaScript - `inlinesources` Include source code in the sourcemap files inside the emitted JavaScript - `isolagedModules` Ensure that each file can be safely transpiled without relying on other imports - `jsx` - JSX code generation - `jsxFactory` - The JSX factory function to use when targeting React JSX emit, e.g. 'React.createElement' or 'h' - `jsxFragmentFactory` Specify the JSX Fragment reference to use for fragements when targeting React JSX emit, e.g. 'React.Fragment' or 'Fragment'. - `keyofStringsOnly` - Make keyof only return strings instead of string, numbers or symbols. Legacy option. - `lib` - A list of bundled library declaration files which describe the target runtime environment. - `listEmittedFiles` - Print the names of emitted files after a compilation -`listFiles` - Print all of the files read during the compilation - `locale` - Set the language of the messaging from TypeScript, does not affect emit - `mapRoot` - Specifies the location where debugger should locate map files instead of generated locations - - `maxNodeModuleJsDepth` - The maximum number of JS files to look search under node_modules and load JavaScript files without declaration files. Only applicable with --allowJs. (Write a sample app to look, also maybe update reference) -`module` - Module code generation ( OK ) -`moduleResolution` - How TypeScript looks up a file based from a module specifier -`newLine` - Set the newline character for emitting files -`noEmit` - Do not emit files from a compilation -`noHelpers` - Do not generate custom helper functions like __extends in compiled output. -`noEmitErrors` - Do not emit files if any type checking errors were reported. -`noErrorTruncation` - Do not truncate types in error messages -`noFallthroughCasesInSwitch` - Report errors for fallthrough cases in switch statements. -`noImplicitAny` - Error on expressions and declarations with an implied 'any' type. -`noImplicitReturns` - Ensure that all codepaths explicitly return in a function -`noImplicitThis` - Error when 'this' would be any -`noImplicitUseStrict` - Do not add 'use strict' directives in emitted JS. -`noLib` - Do not include any library files, including the default lib.d.ts. --- Sept 23rd -`noResolve` - Do not use `import`s, `require`s or `<reference`s to expand the number of files TypeScript should add to a project. -`noStrictGenericChecks` - Disable strict checking of generic signatures in function types. -`noUnusedLocals` - Raise an error when a local variable isn't read -`noUnusedParameters` - Raise an error when a function parameter isn't read -`out` - Do not use this, use `outFile` instead -`outDir` - Set an output folder for all emitted files -`outFile` - Bundle all outputs into one .js file, and optionally one .d.ts file if `declaration` is true. -`path` - A series of entries which re-maps imports to additional lookup locations -`plugins` - A list of language service plugins to include -`preserveConstEnums` - Do not erase `const enum` declarations in generated code -`preserveSymlinks` - Correlates to the same flag in node. Do not resolve symlinks to their realpath. -`preserveWatchOutput` - Do not wipe the console in watch mode -`pretty` - Use color and formatting to make compiler errors easier to read -`reactNamespace` - Specifies the object invoked for `createElement` only when targeting 'react' JSX emit -`references` - An array of objects that specifies paths for projects. Used in project references. -`removeComments` - Do not emit comments -`resolveJsonModule` - Allow importing .json files -`rootDir`- Sets the root directory for your source files, to be reflected in your `outDir`. -`rootDirs` - Treat multiple folders as one when resolving modules. --- Oct 7th - `skipDefaultLibCheck` - Skips type checking .d.ts files which are included with TypeScript. The original notes for this were wrong, there's a good [writeup here](https://github.com/microsoft/TypeScript/issues/25658) but we think the deprecation isn't necessarily valid. There's a good point for using this flag. - `skipLibCheck` Skip type checking all .d.ts files - `sourceMaps` Creates source map files for emitted JavaScript files --- Oct 21st - `sourceRoot` Sets the root path for debuggers to find the reference source code - `strict` - Enable all strict type checking options - `strictBindCallApply` Checks that the arguments for `bind`, `call`, and `apply` methods match the original function - `strictFunctionTypes` Checks when assigning functions to ensure parameters and the return values are subtype-compatible - `strictNullChecks` When type checking take into account `null` and `undefined` - `strictPropertyInitialization` Checks for class properties which are declared but not set in the constructor - `stripInternal` Do not emit declarations which have '@internal' in their JSDoc comments. - `suppressExcessPropertyErrors` This disables reporting of excess property errors during the creation of object literals. - `suppressImplicitAnyIndexErrors` - Suppress `noImplicitAny` errors for indexing objects lacking index signatures ( relates to noImplicitAny, find when it was introduced too ) - `target` Sets the JavaScript language version for emitted JavaScript and includes compatible library declarations - `traceResolution` Log paths when using the `moduleResolution` process - `tsBuildInfoFile` Set the folder for .tsbuildinfo incremental compilation files ( TODO: try make an example where this is setting a file specifically ) - `typeAcquisition` Provides options for automatic acquisition of declaration files Nov 4th - `typeRoots` - Specifies multiple folders which act like `./node_modules/@types` - `types` - List type package names to be included without being referenced in a source file - `useDefineForClassFields` - Emit ECMAScript standard class fields - `watchDirectory` - Controls how directories are watched on systems that lack recursive file-watching functionality - `watchFile` - Controls how the TypeScript watch mode works. - `charset` - Does nothing. Used to allow for changing how files were read from disk. - `composite` - Enables constraints which allow a TypeScript project to be used with project references. - `declaration` - Generates .d.ts files from TypeScript and JavaScript files in your project. - `disableSizeLimit` - Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server - `inlineSourceMap` - Include sourcemaps inside the emitted JavaScript - `inlineSources` - Include source code in the sourcemaps inside the emitted JavaScript - `jsxImportSource` - The module specifier for importing the jsx factory functions when using `jsx`: `react-jsx*` - `maxNodeModuleJsDepth` - The maximum folder depth to check .js files from `node_modules`. Only applicable with `allowJs`. ### TODO: Ask Sheetal about: - `disableSourceOfProjectReferenceRedirect` Ask Ron about: - `downlevelIteration`