Skip to main content
Version: 5.x

Custom TypeScript Configuration

Overview

The tsconfig.json file is a configuration file in a TypeScript project that instructs the TypeScript compiler on how to compile the project. It specifies which files to include and provides various settings that control the compilation process.

Lens Studio allows you to customize the compilerOptions in tsconfig.json. The compilerOptions section contains various settings that affect TypeScript compilation.

Lens Studio provides a template to extend the tsconfig.json:

Generated tsconfig.json

{
"compilerOptions": {
"module": "commonjs",
"target": "es2019",
"isolatedModules": true,
"noEmit": true,
"skipDefaultLibCheck": true,
"experimentalDecorators": true,
"allowJs": true,
"lib": ["es2019"],
"types": [],
"baseUrl": "../Cache/TypeScript/Src"
},
"exclude": ["node_modules/typescript/lib/lib.dom.d.ts"],
"include": [
"../Cache/TypeScript/lib/LensifyTS/Declarations/**/*.d.ts",
"./**/*.ts"
]
}

This file must be placed in the root directory of your Asset Browser. None of the settings in the template tsconfig.json should be modified; they should only be extended. Review the avaliable list of compiler options that can be modified to customize your TypeScript compilation process.

If the file is renamed or moved outside of the root directory of the Asset Browser, it will no longer have any effect, and the TypeScript compiler will fall back to the default configuration file.

Compiler Options

Below is a structured list of configurations available for the compilerOptions in JSON format:

  • allowUnreachableCode
  • allowUnusedLabels
  • alwaysStrict
  • exactOptionalPropertyTypes
  • noFallthroughCasesInSwitch
  • noImplicitAny
  • noImplicitOverride
  • noImplicitReturns
  • noImplicitThis
  • noPropertyAccessFromIndexSignature
  • noUncheckedIndexedAccess
  • noUnusedLocals
  • noUnusedParameters
  • strict
  • strictBindCallApply
  • strictBuiltinIteratorReturn
  • strictFunctionTypes
  • strictNullChecks
  • strictPropertyInitialization
  • useUnknownInCatchVariables

tsconfig.json Example

{
"compilerOptions": {
"module": "commonjs",
"target": "es2019",
"isolatedModules": true,
"noEmit": true,
"skipDefaultLibCheck": true,
"experimentalDecorators": true,
"allowJs": true,
"lib": ["es2019"],
"types": [],
"baseUrl": "../Cache/TypeScript/Src",
"strict": true,
"strictBindCallApply": false
},
"exclude": ["node_modules/typescript/lib/lib.dom.d.ts"],
"include": [
"../Cache/TypeScript/lib/LensifyTS/Declarations/**/*.d.ts",
"./**/*.ts"
]
}

Comments are not supported in tsconfig.json at this time.

Was this page helpful?
Yes
No

AI-Powered Search