본문 바로가기
Typescript

typescript의 변경 규칙을 위한 환경설정파일(tsconfig.json)

by 루에 2021. 12. 29.
반응형

typescript 그대로는 브라우저가 읽지 못하기 때문에 js로 변환이 되어야 한다.

변환될 때 어떤 규칙에 따라서 할 것인지를 설정하기 위한 파일이 tsconfig.json이며, package.json과 같은 root에 위치한다.

 

기본적으로는 아래처럼 작성한다.(intellij 기준 자동으로 아래처럼 채워진다)

target은 어떤 버젼의 js로 변환할지 결정한다. 더 신버젼을 원할 경우 es2016, esnext 등으로 기입한다.

module은 import export 규칙을 결정한다. commonjs는 require문법, es2016, esnext는 import 문법

 

브라우저 호환성을 위한다면 아래 기본형태가 낫겠고,

일렉트론 같이 특정 브라우저 한정으로 돌아가는 애플리케이션이라면 가능한 최신 문법을 사용함이 나을 것으로 생각된다.

{
  "compilerOptions": {
    "module": "commonjs",	// import 를 require문법으로 사용
    "target": "es5",		// es5에 맞춰 js로 변경
    "sourceMap": true		// js의 .map 파일 생성
  },
  "exclude": [
    "node_modules"
  ]
}

 

강의에서 추천하는 쓸모있어 보이는 옵션들 리스트

{
 "compilerOptions": {

  "target": "es5", // 'es3', 'es5', 'es2015', 'es2016', 'es2017','es2018', 'esnext' 가능
  "module": "commonjs", //무슨 import 문법 쓸건지 'commonjs', 'amd', 'es2015', 'esnext'
  "allowJs": true, // js 파일들 ts에서 import해서 쓸 수 있는지 
  "checkJs": true, // 일반 js 파일에서도 에러체크 여부 
  "jsx": "preserve", // tsx 파일을 jsx로 어떻게 컴파일할 것인지 'preserve', 'react-native', 'react'
  "declaration": true, //컴파일시 .d.ts 파일도 자동으로 함께생성 (현재쓰는 모든 타입이 정의된 파일)
  "outFile": "./", //모든 ts파일을 js파일 하나로 컴파일해줌 (module이 none, amd, system일 때만 가능)
  "outDir": "./", //js파일 아웃풋 경로바꾸기
  "rootDir": "./", //루트경로 바꾸기 (js 파일 아웃풋 경로에 영향줌)
  "removeComments": true, //컴파일시 주석제거 

  "strict": true, //strict 관련, noimplicit 어쩌구 관련 모드 전부 켜기
  "noImplicitAny": true, //any타입 금지 여부
  "strictNullChecks": true, //null, undefined 타입에 이상한 짓 할시 에러내기 
  "strictFunctionTypes": true, //함수파라미터 타입체크 강하게 
  "strictPropertyInitialization": true, //class constructor 작성시 타입체크 강하게
  "noImplicitThis": true, //this 키워드가 any 타입일 경우 에러내기
  "alwaysStrict": true, //자바스크립트 "use strict" 모드 켜기

  "noUnusedLocals": true, //쓰지않는 지역변수 있으면 에러내기
  "noUnusedParameters": true, //쓰지않는 파라미터 있으면 에러내기
  "noImplicitReturns": true, //함수에서 return 빼먹으면 에러내기 
  "noFallthroughCasesInSwitch": true, //switch문 이상하면 에러내기 
 }
}

 

설정할 수 있는 compilerOptions의 모든 내용은 아래와 같다.

필요할 경우 커스터마이징 하면 되겠지만, 너무 많기 때문에 보통은 공통적으로 사용할 것만 사용하는게 정신건강에 나아보인다.

"properties": {
            "charset": {
              "description": "No longer supported. In early versions, manually set the text encoding for reading files.",
              "type": "string",
              "markdownDescription": "No longer supported. In early versions, manually set the text encoding for reading files.\n\nSee more: https://www.typescriptlang.org/tsconfig#charset"
            },
            "composite": {
              "description": "Enable constraints that allow a TypeScript project to be used with project references.",
              "type": "boolean",
              "default": true,
              "markdownDescription": "Enable constraints that allow a TypeScript project to be used with project references.\n\nSee more: https://www.typescriptlang.org/tsconfig#composite"
            },
            "declaration": {
              "description": "Generate .d.ts files from TypeScript and JavaScript files in your project.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Generate .d.ts files from TypeScript and JavaScript files in your project.\n\nSee more: https://www.typescriptlang.org/tsconfig#declaration"
            },
            "declarationDir": {
              "description": "Specify the output directory for generated declaration files.",
              "type": ["string", "null"],
              "markdownDescription": "Specify the output directory for generated declaration files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationDir"
            },
            "diagnostics": {
              "description": "Output compiler performance information after building.",
              "type": "boolean",
              "markdownDescription": "Output compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#diagnostics"
            },
            "disableReferencedProjectLoad": {
              "description": "Reduce the number of projects loaded automatically by TypeScript.",
              "type": "boolean",
              "markdownDescription": "Reduce the number of projects loaded automatically by TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableReferencedProjectLoad"
            },
            "noPropertyAccessFromIndexSignature": {
              "description": "Enforces using indexed accessors for keys declared using an indexed type",
              "type": "boolean",
              "markdownDescription": "Enforces using indexed accessors for keys declared using an indexed type\n\nSee more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature"
            },
            "emitBOM": {
              "description": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitBOM"
            },
            "emitDeclarationOnly": {
              "description": "Only output d.ts files and not JavaScript files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Only output d.ts files and not JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDeclarationOnly"
            },
            "exactOptionalPropertyTypes": {
              "description": "Differentiate between undefined and not present when type checking",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Differentiate between undefined and not present when type checking\n\nSee more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes"
            },
            "incremental": {
              "description": "Enable incremental compilation. Requires TypeScript version 3.4 or later.",
              "type": "boolean"
            },
            "tsBuildInfoFile": {
              "description": "Specify the folder for .tsbuildinfo incremental compilation files.",
              "default": ".tsbuildinfo",
              "type": "string",
              "markdownDescription": "Specify the folder for .tsbuildinfo incremental compilation files.\n\nSee more: https://www.typescriptlang.org/tsconfig#tsBuildInfoFile"
            },
            "inlineSourceMap": {
              "description": "Include sourcemap files inside the emitted JavaScript.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Include sourcemap files inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSourceMap"
            },
            "inlineSources": {
              "description": "Include source code in the sourcemaps inside the emitted JavaScript.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Include source code in the sourcemaps inside the emitted JavaScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#inlineSources"
            },
            "jsx": {
              "description": "Specify what JSX code is generated.",
              "enum": ["preserve", "react", "react-jsx", "react-jsxdev", "react-native"]
            },
            "reactNamespace": {
              "description": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.",
              "type": "string",
              "default": "React",
              "markdownDescription": "Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.\n\nSee more: https://www.typescriptlang.org/tsconfig#reactNamespace"
            },
            "jsxFactory": {
              "description": "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'",
              "type": "string",
              "default": "React.createElement",
              "markdownDescription": "Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFactory"
            },
            "jsxFragmentFactory": {
              "description": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.",
              "type": "string",
              "default": "React.Fragment",
              "markdownDescription": "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxFragmentFactory"
            },
            "jsxImportSource": {
              "description": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx`.",
              "type": "string",
              "default": "react",
              "markdownDescription": "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx`.\n\nSee more: https://www.typescriptlang.org/tsconfig#jsxImportSource"
            },
            "listFiles": {
              "description": "Print all of the files read during the compilation.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Print all of the files read during the compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listFiles"
            },
            "mapRoot": {
              "description": "Specify the location where debugger should locate map files instead of generated locations.",
              "type": "string",
              "markdownDescription": "Specify the location where debugger should locate map files instead of generated locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#mapRoot"
            },
            "module": {
              "description": "Specify what module code is generated.",
              "type": "string",
              "anyOf": [
                {
                  "enum": [
                    "CommonJS",
                    "AMD",
                    "System",
                    "UMD",
                    "ES6",
                    "ES2015",
                    "ES2020",
                    "ESNext",
                    "None",
                    "es2022",
                    "node12",
                    "nodenext"
                  ]
                },
                {
                  "pattern": "^([Cc][Oo][Mm][Mm][Oo][Nn][Jj][Ss]|[AaUu][Mm][Dd]|[Ss][Yy][Ss][Tt][Ee][Mm]|[Ee][Ss]([356]|201[567]|2020|[Nn][Ee][Xx][Tt])|[Nn][Oo][Nn][Ee])$"
                }
              ],
              "markdownDescription": "Specify what module code is generated.\n\nSee more: https://www.typescriptlang.org/tsconfig#module"
            },
            "moduleResolution": {
              "description": "Specify how TypeScript looks up a file from a given module specifier.",
              "type": "string",
              "anyOf": [
                {
                  "enum": ["Classic", "Node"]
                },
                {
                  "pattern": "^(([Nn]ode)|([Cc]lassic))$"
                }
              ],
              "default": "classic",
              "markdownDescription": "Specify how TypeScript looks up a file from a given module specifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#moduleResolution"
            },
            "newLine": {
              "description": "Set the newline character for emitting files.",
              "type": "string",
              "anyOf": [
                {
                  "enum": ["crlf", "lf"]
                },
                {
                  "pattern": "^(CRLF|LF|crlf|lf)$"
                }
              ],
              "markdownDescription": "Set the newline character for emitting files.\n\nSee more: https://www.typescriptlang.org/tsconfig#newLine"
            },
            "noEmit": {
              "description": "Disable emitting file from a compilation.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable emitting file from a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmit"
            },
            "noEmitHelpers": {
              "description": "Disable generating custom helper functions like `__extends` in compiled output.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable generating custom helper functions like `__extends` in compiled output.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitHelpers"
            },
            "noEmitOnError": {
              "description": "Disable emitting files if any type checking errors are reported.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable emitting files if any type checking errors are reported.\n\nSee more: https://www.typescriptlang.org/tsconfig#noEmitOnError"
            },
            "noImplicitAny": {
              "description": "Enable error reporting for expressions and declarations with an implied `any` type..",
              "type": "boolean",
              "markdownDescription": "Enable error reporting for expressions and declarations with an implied `any` type..\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitAny"
            },
            "noImplicitThis": {
              "description": "Enable error reporting when `this` is given the type `any`.",
              "type": "boolean",
              "markdownDescription": "Enable error reporting when `this` is given the type `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitThis"
            },
            "noUnusedLocals": {
              "description": "Enable error reporting when a local variables aren't read.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Enable error reporting when a local variables aren't read.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedLocals"
            },
            "noUnusedParameters": {
              "description": "Raise an error when a function parameter isn't read",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Raise an error when a function parameter isn't read\n\nSee more: https://www.typescriptlang.org/tsconfig#noUnusedParameters"
            },
            "noLib": {
              "description": "Disable including any library files, including the default lib.d.ts.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable including any library files, including the default lib.d.ts.\n\nSee more: https://www.typescriptlang.org/tsconfig#noLib"
            },
            "noResolve": {
              "description": "Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project.\n\nSee more: https://www.typescriptlang.org/tsconfig#noResolve"
            },
            "noStrictGenericChecks": {
              "description": "Disable strict checking of generic signatures in function types.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable strict checking of generic signatures in function types.\n\nSee more: https://www.typescriptlang.org/tsconfig#noStrictGenericChecks"
            },
            "skipDefaultLibCheck": {
              "description": "Skip type checking .d.ts files that are included with TypeScript.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Skip type checking .d.ts files that are included with TypeScript.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipDefaultLibCheck"
            },
            "skipLibCheck": {
              "description": "Skip type checking all .d.ts files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Skip type checking all .d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#skipLibCheck"
            },
            "outFile": {
              "description": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.",
              "type": "string",
              "markdownDescription": "Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.\n\nSee more: https://www.typescriptlang.org/tsconfig#outFile"
            },
            "outDir": {
              "description": "Specify an output folder for all emitted files.",
              "type": "string",
              "markdownDescription": "Specify an output folder for all emitted files.\n\nSee more: https://www.typescriptlang.org/tsconfig#outDir"
            },
            "preserveConstEnums": {
              "description": "Disable erasing `const enum` declarations in generated code.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable erasing `const enum` declarations in generated code.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveConstEnums"
            },
            "preserveSymlinks": {
              "description": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable resolving symlinks to their realpath. This correlates to the same flag in node.\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveSymlinks"
            },
            "preserveValueImports": {
              "description": "Preserve unused imported values in the JavaScript output that would otherwise be removed",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Preserve unused imported values in the JavaScript output that would otherwise be removed\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveValueImports"
            },
            "preserveWatchOutput": {
              "description": "Disable wiping the console in watch mode",
              "type": "boolean",
              "markdownDescription": "Disable wiping the console in watch mode\n\nSee more: https://www.typescriptlang.org/tsconfig#preserveWatchOutput"
            },
            "pretty": {
              "description": "Enable color and formatting in output to make compiler errors easier to read",
              "type": "boolean",
              "default": true,
              "markdownDescription": "Enable color and formatting in output to make compiler errors easier to read\n\nSee more: https://www.typescriptlang.org/tsconfig#pretty"
            },
            "removeComments": {
              "description": "Disable emitting comments.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable emitting comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#removeComments"
            },
            "rootDir": {
              "description": "Specify the root folder within your source files.",
              "type": "string",
              "markdownDescription": "Specify the root folder within your source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDir"
            },
            "isolatedModules": {
              "description": "Ensure that each file can be safely transpiled without relying on other imports.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Ensure that each file can be safely transpiled without relying on other imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#isolatedModules"
            },
            "sourceMap": {
              "description": "Create source map files for emitted JavaScript files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Create source map files for emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceMap"
            },
            "sourceRoot": {
              "description": "Specify the root path for debuggers to find the reference source code.",
              "type": "string",
              "markdownDescription": "Specify the root path for debuggers to find the reference source code.\n\nSee more: https://www.typescriptlang.org/tsconfig#sourceRoot"
            },
            "suppressExcessPropertyErrors": {
              "description": "Disable reporting of excess property errors during the creation of object literals.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable reporting of excess property errors during the creation of object literals.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressExcessPropertyErrors"
            },
            "suppressImplicitAnyIndexErrors": {
              "description": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Suppress `noImplicitAny` errors when indexing objects that lack index signatures.\n\nSee more: https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors"
            },
            "stripInternal": {
              "description": "Disable emitting declarations that have `@internal` in their JSDoc comments.",
              "type": "boolean",
              "markdownDescription": "Disable emitting declarations that have `@internal` in their JSDoc comments.\n\nSee more: https://www.typescriptlang.org/tsconfig#stripInternal"
            },
            "target": {
              "description": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.",
              "type": "string",
              "default": "ES3",
              "anyOf": [
                {
                  "enum": [
                    "ES3",
                    "ES5",
                    "ES6",
                    "ES2015",
                    "ES2016",
                    "ES2017",
                    "ES2018",
                    "ES2019",
                    "ES2020",
                    "ES2021",
                    "ESNext"
                  ]
                },
                {
                  "pattern": "^([Ee][Ss]([356]|(20(1[56789]|2[01]))|[Nn][Ee][Xx][Tt]))$"
                }
              ],
              "markdownDescription": "Set the JavaScript language version for emitted JavaScript and include compatible library declarations.\n\nSee more: https://www.typescriptlang.org/tsconfig#target"
            },
            "useUnknownInCatchVariables": {
              "description": "Default catch clause variables as `unknown` instead of `any`.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Default catch clause variables as `unknown` instead of `any`.\n\nSee more: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables"
            },
            "watch": {
              "description": "Watch input files.",
              "type": "boolean"
            },
            "fallbackPolling": {
              "description": "Specify the polling strategy to use when the system runs out of or doesn't support native file watchers. Requires TypeScript version 3.8 or later.",
              "enum": [
                "fixedPollingInterval",
                "priorityPollingInterval",
                "dynamicPriorityPolling",
                "fixedInterval",
                "priorityInterval",
                "dynamicPriority",
                "fixedChunkSize"
              ]
            },
            "watchDirectory": {
              "description": "Specify the strategy for watching directories under systems that lack recursive file-watching functionality. Requires TypeScript version 3.8 or later.",
              "enum": [
                "useFsEvents",
                "fixedPollingInterval",
                "dynamicPriorityPolling",
                "fixedChunkSizePolling"
              ],
              "default": "useFsEvents"
            },
            "watchFile": {
              "description": "Specify the strategy for watching individual files. Requires TypeScript version 3.8 or later.",
              "enum": [
                "fixedPollingInterval",
                "priorityPollingInterval",
                "dynamicPriorityPolling",
                "useFsEvents",
                "useFsEventsOnParentDirectory",
                "fixedChunkSizePolling"
              ],
              "default": "useFsEvents"
            },
            "experimentalDecorators": {
              "description": "Enable experimental support for TC39 stage 2 draft decorators.",
              "type": "boolean",
              "markdownDescription": "Enable experimental support for TC39 stage 2 draft decorators.\n\nSee more: https://www.typescriptlang.org/tsconfig#experimentalDecorators"
            },
            "emitDecoratorMetadata": {
              "description": "Emit design-type metadata for decorated declarations in source files.",
              "type": "boolean",
              "markdownDescription": "Emit design-type metadata for decorated declarations in source files.\n\nSee more: https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata"
            },
            "allowUnusedLabels": {
              "description": "Disable error reporting for unused labels.",
              "type": "boolean",
              "markdownDescription": "Disable error reporting for unused labels.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnusedLabels"
            },
            "noImplicitReturns": {
              "description": "Enable error reporting for codepaths that do not explicitly return in a function.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Enable error reporting for codepaths that do not explicitly return in a function.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitReturns"
            },
            "noUncheckedIndexedAccess": {
              "description": "Add `undefined` to a type when accessed using an index.",
              "type": "boolean",
              "markdownDescription": "Add `undefined` to a type when accessed using an index.\n\nSee more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess"
            },
            "noFallthroughCasesInSwitch": {
              "description": "Enable error reporting for fallthrough cases in switch statements.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Enable error reporting for fallthrough cases in switch statements.\n\nSee more: https://www.typescriptlang.org/tsconfig#noFallthroughCasesInSwitch"
            },
            "noImplicitOverride": {
              "description": "Ensure overriding members in derived classes are marked with an override modifier.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Ensure overriding members in derived classes are marked with an override modifier.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitOverride"
            },
            "allowUnreachableCode": {
              "description": "Disable error reporting for unreachable code.",
              "type": "boolean",
              "markdownDescription": "Disable error reporting for unreachable code.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUnreachableCode"
            },
            "forceConsistentCasingInFileNames": {
              "description": "Ensure that casing is correct in imports.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Ensure that casing is correct in imports.\n\nSee more: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames"
            },
            "generateCpuProfile": {
              "description": "Emit a v8 CPU profile of the compiler run for debugging.",
              "type": "string",
              "default": "profile.cpuprofile",
              "markdownDescription": "Emit a v8 CPU profile of the compiler run for debugging.\n\nSee more: https://www.typescriptlang.org/tsconfig#generateCpuProfile"
            },
            "baseUrl": {
              "description": "Specify the base directory to resolve non-relative module names.",
              "type": "string",
              "markdownDescription": "Specify the base directory to resolve non-relative module names.\n\nSee more: https://www.typescriptlang.org/tsconfig#baseUrl"
            },
            "paths": {
              "description": "Specify a set of entries that re-map imports to additional lookup locations.",
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "description": "Path mapping to be computed relative to baseUrl option."
                }
              },
              "markdownDescription": "Specify a set of entries that re-map imports to additional lookup locations.\n\nSee more: https://www.typescriptlang.org/tsconfig#paths"
            },
            "plugins": {
              "description": "Specify a list of language service plugins to include.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Plugin name.",
                    "type": "string"
                  }
                }
              },
              "markdownDescription": "Specify a list of language service plugins to include.\n\nSee more: https://www.typescriptlang.org/tsconfig#plugins"
            },
            "rootDirs": {
              "description": "Allow multiple folders to be treated as one when resolving modules.",
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              },
              "markdownDescription": "Allow multiple folders to be treated as one when resolving modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#rootDirs"
            },
            "typeRoots": {
              "description": "Specify multiple folders that act like `./node_modules/@types`.",
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              },
              "markdownDescription": "Specify multiple folders that act like `./node_modules/@types`.\n\nSee more: https://www.typescriptlang.org/tsconfig#typeRoots"
            },
            "types": {
              "description": "Specify type package names to be included without being referenced in a source file.",
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string"
              },
              "markdownDescription": "Specify type package names to be included without being referenced in a source file.\n\nSee more: https://www.typescriptlang.org/tsconfig#types"
            },
            "traceResolution": {
              "description": "Enable tracing of the name resolution process. Requires TypeScript version 2.0 or later.",
              "type": "boolean",
              "default": false
            },
            "allowJs": {
              "description": "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowJs"
            },
            "noErrorTruncation": {
              "description": "Disable truncating types in error messages.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable truncating types in error messages.\n\nSee more: https://www.typescriptlang.org/tsconfig#noErrorTruncation"
            },
            "allowSyntheticDefaultImports": {
              "description": "Allow 'import x from y' when a module doesn't have a default export.",
              "type": "boolean",
              "markdownDescription": "Allow 'import x from y' when a module doesn't have a default export.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowSyntheticDefaultImports"
            },
            "noImplicitUseStrict": {
              "description": "Disable adding 'use strict' directives in emitted JavaScript files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Disable adding 'use strict' directives in emitted JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#noImplicitUseStrict"
            },
            "listEmittedFiles": {
              "description": "Print the names of emitted files after a compilation.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Print the names of emitted files after a compilation.\n\nSee more: https://www.typescriptlang.org/tsconfig#listEmittedFiles"
            },
            "disableSizeLimit": {
              "description": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSizeLimit"
            },
            "lib": {
              "description": "Specify a set of bundled library declaration files that describe the target runtime environment.",
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "anyOf": [
                  {
                    "enum": [
                      "ES5",
                      "ES6",
                      "ES2015",
                      "ES2015.Collection",
                      "ES2015.Core",
                      "ES2015.Generator",
                      "ES2015.Iterable",
                      "ES2015.Promise",
                      "ES2015.Proxy",
                      "ES2015.Reflect",
                      "ES2015.Symbol.WellKnown",
                      "ES2015.Symbol",
                      "ES2016",
                      "ES2016.Array.Include",
                      "ES2017",
                      "ES2017.Intl",
                      "ES2017.Object",
                      "ES2017.SharedMemory",
                      "ES2017.String",
                      "ES2017.TypedArrays",
                      "ES2018",
                      "ES2018.AsyncGenerator",
                      "ES2018.AsyncIterable",
                      "ES2018.Intl",
                      "ES2018.Promise",
                      "ES2018.Regexp",
                      "ES2019",
                      "ES2019.Array",
                      "ES2019.Object",
                      "ES2019.String",
                      "ES2019.Symbol",
                      "ES2020",
                      "ES2020.BigInt",
                      "ES2020.Promise",
                      "ES2020.String",
                      "ES2020.Symbol.WellKnown",
                      "ESNext",
                      "ESNext.Array",
                      "ESNext.AsyncIterable",
                      "ESNext.BigInt",
                      "ESNext.Intl",
                      "ESNext.Promise",
                      "ESNext.String",
                      "ESNext.Symbol",
                      "DOM",
                      "DOM.Iterable",
                      "ScriptHost",
                      "WebWorker",
                      "WebWorker.ImportScripts",
                      "Webworker.Iterable",
                      "ES7",
                      "ES2021",
                      "ES2020.SharedMemory",
                      "ES2020.Intl",
                      "ES2021.Promise",
                      "ES2021.String",
                      "ES2021.WeakRef",
                      "ESNext.WeakRef",
                      "es2021.intl"
                    ]
                  },
                  {
                    "pattern": "^[Ee][Ss]5|[Ee][Ss]6|[Ee][Ss]7$"
                  },
                  {
                    "pattern": "^[Ee][Ss]2015(\\.([Cc][Oo][Ll][Ll][Ee][Cc][Tt][Ii][Oo][Nn]|[Cc][Oo][Rr][Ee]|[Gg][Ee][Nn][Ee][Rr][Aa][Tt][Oo][Rr]|[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Pp][Rr][Oo][Xx][Yy]|[Rr][Ee][Ff][Ll][Ee][Cc][Tt]|[Ss][Yy][Mm][Bb][Oo][Ll].[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$"
                  },
                  {
                    "pattern": "^[Ee][Ss]2016(\\.[Aa][Rr][Rr][Aa][Yy].[Ii][Nn][Cc][Ll][Uu][Dd][Ee])?$"
                  },
                  {
                    "pattern": "^[Ee][Ss]2017(\\.([Ii][Nn][Tt][Ll]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Hh][Aa][Rr][Ee][Dd][Mm][Ee][Mm][Oo][Rr][Yy]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Tt][Yy][Pp][Ee][Dd][Aa][Rr][Rr][Aa][Yy][Ss]))?$"
                  },
                  {
                    "pattern": "^[Ee][Ss]2018(\\.([Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Rr][Ee][Gg][Ee][Xx][Pp]))?$"
                  },
                  {
                    "pattern": "^[Ee][Ss]2019(\\.([Aa][Rr][Rr][Aa][Yy]|[Oo][Bb][Jj][Ee][Cc][Tt]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]))?$"
                  },
                  {
                    "pattern": "^[Ee][Ss]2020(\\.([Bb][Ii][Gg][Ii][Nn][Tt]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll].[Ww][Ee][Ll][Ll][Kk][Nn][Oo][Ww][Nn]))?$"
                  },
                  {
                    "pattern": "^[Ee][Ss]2021(\\.([Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]))?$"
                  },
                  {
                    "pattern": "^[Ee][Ss][Nn][Ee][Xx][Tt](\\.([Aa][Rr][Rr][Aa][Yy]|[Aa][Ss][Yy][Nn][Cc][Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee]|[Bb][Ii][Gg][Ii][Nn][Tt]|[Ii][Nn][Tt][Ll]|[Pp][Rr][Oo][Mm][Ii][Ss][Ee]|[Ss][Tt][Rr][Ii][Nn][Gg]|[Ss][Yy][Mm][Bb][Oo][Ll]|[Ww][Ee][Aa][Kk][Rr][Ee][Ff]))?$"
                  },
                  {
                    "pattern": "^[Dd][Oo][Mm](\\.[Ii][Tt][Ee][Rr][Aa][Bb][Ll][Ee])?$"
                  },
                  {
                    "pattern": "^[Ss][Cc][Rr][Ii][Pp][Tt][Hh][Oo][Ss][Tt]$"
                  },
                  {
                    "pattern": "^[Ww][Ee][Bb][Ww][Oo][Rr][Kk][Ee][Rr](\\.[Ii][Mm][Pp][Oo][Rr][Tt][Ss][Cc][Rr][Ii][Pp][Tt][Ss])?$"
                  }
                ]
              },
              "markdownDescription": "Specify a set of bundled library declaration files that describe the target runtime environment.\n\nSee more: https://www.typescriptlang.org/tsconfig#lib"
            },
            "strictNullChecks": {
              "description": "When type checking, take into account `null` and `undefined`.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "When type checking, take into account `null` and `undefined`.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictNullChecks"
            },
            "maxNodeModuleJsDepth": {
              "description": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.",
              "type": "number",
              "default": 0,
              "markdownDescription": "Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.\n\nSee more: https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth"
            },
            "importHelpers": {
              "description": "Allow importing helper functions from tslib once per project, instead of including them per-file.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Allow importing helper functions from tslib once per project, instead of including them per-file.\n\nSee more: https://www.typescriptlang.org/tsconfig#importHelpers"
            },
            "importsNotUsedAsValues": {
              "description": "Specify emit/checking behavior for imports that are only used for types.",
              "default": "remove",
              "enum": ["remove", "preserve", "error"]
            },
            "alwaysStrict": {
              "description": "Ensure 'use strict' is always emitted.",
              "type": "boolean",
              "markdownDescription": "Ensure 'use strict' is always emitted.\n\nSee more: https://www.typescriptlang.org/tsconfig#alwaysStrict"
            },
            "strict": {
              "description": "Enable all strict type checking options.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Enable all strict type checking options.\n\nSee more: https://www.typescriptlang.org/tsconfig#strict"
            },
            "strictBindCallApply": {
              "description": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Check that the arguments for `bind`, `call`, and `apply` methods match the original function.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictBindCallApply"
            },
            "downlevelIteration": {
              "description": "Emit more compliant, but verbose and less performant JavaScript for iteration.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Emit more compliant, but verbose and less performant JavaScript for iteration.\n\nSee more: https://www.typescriptlang.org/tsconfig#downlevelIteration"
            },
            "checkJs": {
              "description": "Enable error reporting in type-checked JavaScript files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Enable error reporting in type-checked JavaScript files.\n\nSee more: https://www.typescriptlang.org/tsconfig#checkJs"
            },
            "strictFunctionTypes": {
              "description": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "When assigning functions, check to ensure parameters and the return values are subtype-compatible.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictFunctionTypes"
            },
            "strictPropertyInitialization": {
              "description": "Check for class properties that are declared but not set in the constructor.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Check for class properties that are declared but not set in the constructor.\n\nSee more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization"
            },
            "esModuleInterop": {
              "description": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.\n\nSee more: https://www.typescriptlang.org/tsconfig#esModuleInterop"
            },
            "allowUmdGlobalAccess": {
              "description": "Allow accessing UMD globals from modules.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Allow accessing UMD globals from modules.\n\nSee more: https://www.typescriptlang.org/tsconfig#allowUmdGlobalAccess"
            },
            "keyofStringsOnly": {
              "description": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Make keyof only return strings instead of string, numbers or symbols. Legacy option.\n\nSee more: https://www.typescriptlang.org/tsconfig#keyofStringsOnly"
            },
            "useDefineForClassFields": {
              "description": "Emit ECMAScript-standard-compliant class fields.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Emit ECMAScript-standard-compliant class fields.\n\nSee more: https://www.typescriptlang.org/tsconfig#useDefineForClassFields"
            },
            "declarationMap": {
              "description": "Create sourcemaps for d.ts files.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Create sourcemaps for d.ts files.\n\nSee more: https://www.typescriptlang.org/tsconfig#declarationMap"
            },
            "resolveJsonModule": {
              "description": "Enable importing .json files",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Enable importing .json files\n\nSee more: https://www.typescriptlang.org/tsconfig#resolveJsonModule"
            },
            "assumeChangesOnlyAffectDirectDependencies": {
              "description": "Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. Requires TypeScript version 3.8 or later.",
              "type": "boolean"
            },
            "extendedDiagnostics": {
              "description": "Output more detailed compiler performance information after building.",
              "type": "boolean",
              "default": false,
              "markdownDescription": "Output more detailed compiler performance information after building.\n\nSee more: https://www.typescriptlang.org/tsconfig#extendedDiagnostics"
            },
            "listFilesOnly": {
              "description": "Print names of files that are part of the compilation and then stop processing.",
              "type": "boolean"
            },
            "disableSourceOfProjectReferenceRedirect": {
              "description": "Disable preferring source files instead of declaration files when referencing composite projects",
              "type": "boolean",
              "markdownDescription": "Disable preferring source files instead of declaration files when referencing composite projects\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSourceOfProjectReferenceRedirect"
            },
            "disableSolutionSearching": {
              "description": "Opt a project out of multi-project reference checking when editing.",
              "type": "boolean",
              "markdownDescription": "Opt a project out of multi-project reference checking when editing.\n\nSee more: https://www.typescriptlang.org/tsconfig#disableSolutionSearching"
            }
          }
반응형

댓글