The TypeScript Compiler - Version 5.2.2,tsc -w无效怎么办?

简介: The TypeScript Compiler - Version 5.2.2,tsc -w无效怎么办?

hello world欢迎来到前端的新世界


😜当前文章系列专栏:Typescript

🐱‍👓博主在前端领域还有很多知识和技术需要掌握,正在不断努力填补技术短板。(如果出现错误,感谢大家指出)🌹

💖感谢大家支持!您的观看就是作者创作的动力

tsc-w无效怎么办?

直接来个初始化

tsc --init

就ok了


Version 5.2.2
tsc: The TypeScript Compiler - Version 5.2.2                                                                            
                                                                                                                     TS 
COMMON COMMANDS
  tsc
  Compiles the current project (tsconfig.json in the working directory.)
  tsc app.ts util.ts
  Ignoring tsconfig.json, compiles the specified files with default compiler options.
  tsc -b
  Build a composite project in the working directory.
  tsc --init
  Creates a tsconfig.json with the recommended settings in the working directory.
  tsc -p ./path/to/tsconfig.json
  Compiles the TypeScript project located at the specified path.
  tsc --help --all
  An expanded version of this information, showing all possible compiler options
  tsc --noEmit
  tsc --target esnext
  Compiles the current project, with additional settings.
COMMAND LINE FLAGS
     --help, -h  Print this message.
    --watch, -w  Watch input files.
          --all  Show all compiler options.
  --version, -v  Print the compiler's version.
         --init  Initializes a TypeScript project and creates a tsconfig.json file.
  --project, -p  Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.
    --build, -b  Build one or more projects and their dependencies, if out of date
   --showConfig  Print the final configuration instead of building.
COMMON COMPILER OPTIONS
               --pretty  Enable color and formatting in TypeScript's output to make compiler errors easier to read.
                  type:  boolean
               default:  true
      --declaration, -d  Generate .d.ts files from TypeScript and JavaScript files in your project.
                  type:  boolean
               default:  `false`, unless `composite` is set
       --declarationMap  Create sourcemaps for d.ts files.
                  type:  boolean
               default:  false
  --emitDeclarationOnly  Only output d.ts files and not JavaScript files.
                  type:  boolean
               default:  false
            --sourceMap  Create source map files for emitted JavaScript files.
                  type:  boolean
               default:  false
           --target, -t  Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
                one of:  es3, es5, es6/es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, esnext
               default:  es5
           --module, -m  Specify what module code is generated.
                one of:  none, commonjs, amd, umd, system, es6/es2015, es2020, es2022, esnext, node16, nodenext
               default:  undefined
                  --lib  Specify a set of bundled library declaration files that describe the target runtime environment.
           one or more:  es5, es6/es2015, es7/es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, esnext, dom, dom.iterable, webworker, webworker.i                         mportscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es201                         5.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.date, es2017.object, es2017.sharedmemory                         , es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable/esnext.asynciterable, es2018.intl, es201                         8.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol/esnext.symbol, es2019.intl, es2020.bigint/esnext.b                         igint, es2020.date, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2020.number, es2021.pr                         omise/esnext.promise, es2021.string, es2021.weakref/esnext.weakref, es2021.intl, es2022.array, es2022.error, es2022.intl, es2022.objec                         t, es2022.sharedmemory, es2022.string/esnext.string, es2022.regexp, es2023.array/esnext.array, es2023.collection/esnext.collection, es                         next.intl, esnext.disposable, esnext.decorators, decorators, decorators.legacy
               default:  undefined
              --allowJs  Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files.
                  type:  boolean
               default:  false
              --checkJs  Enable error reporting in type-checked JavaScript files.
                  type:  boolean
               default:  false
                  --jsx  Specify what JSX code is generated.
                one of:  preserve, react, react-native, react-jsx, react-jsxdev
               default:  undefined
              --outFile  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.
               --outDir  Specify an output folder for all emitted files.
       --removeComments  Disable emitting comments.
               default:  false
               --noEmit  Disable emitting files from a compilation.
                  type:  boolean
               default:  false
               --strict  Enable all strict type-checking options.
                  type:  boolean
               default:  false
                         ibility.
                  type:  boolean
               default:  false
You can learn about all of the compiler options at https://aka.ms/tsc


目录
相关文章
|
5月前
|
JavaScript 前端开发 编译器
TypeScript 详解之 tsc 命令行编译器
TypeScript 详解之 tsc 命令行编译器
|
JavaScript 前端开发 编译器
🎖️使用 esbuild 简化 TypeScript 构建并跳过 tsc/tsx
JavaScript 生态系统一直在不断创新,最近的一位游戏规则改变者是 esbuild,这是一个极速的 JavaScript 和 TypeScript 打包器。
1150 0
|
机器学习/深度学习 JSON 资源调度
使用TypeScript命令行工具 tsc CLI
本文介绍TypeScript命令行工具 tsc CLI 常用命令的使用
395 0
|
15天前
|
存储 安全 JavaScript
TypeScript-内置应用程序类型-Recode
通过使用 `Record` 类型,开发者可以显著提升代码的安全性和可维护性。无论是配置对象、字典结构还是动态表单,`Record` 类型都提供了一个简洁、类型安全的解决方案。
187 82
|
3月前
|
开发框架 JavaScript 前端开发
TypeScript 是一种静态类型的编程语言,它扩展了 JavaScript,为 Web 开发带来了强大的类型系统、组件化开发支持、与主流框架的无缝集成、大型项目管理能力和提升开发体验等多方面优势
TypeScript 是一种静态类型的编程语言,它扩展了 JavaScript,为 Web 开发带来了强大的类型系统、组件化开发支持、与主流框架的无缝集成、大型项目管理能力和提升开发体验等多方面优势。通过明确的类型定义,TypeScript 能够在编码阶段发现潜在错误,提高代码质量;支持组件的清晰定义与复用,增强代码的可维护性;与 React、Vue 等框架结合,提供更佳的开发体验;适用于大型项目,优化代码结构和性能。随着 Web 技术的发展,TypeScript 的应用前景广阔,将继续引领 Web 开发的新趋势。
66 2
|
3月前
|
设计模式 JavaScript 安全
TypeScript性能优化及代码质量提升的重要性、方法与策略,包括合理使用类型注解、减少类型断言、优化模块导入导出、遵循编码规范、加强代码注释等
本文深入探讨了TypeScript性能优化及代码质量提升的重要性、方法与策略,包括合理使用类型注解、减少类型断言、优化模块导入导出、遵循编码规范、加强代码注释等,旨在帮助开发者在保证代码质量的同时,实现高效的性能优化,提升用户体验和项目稳定性。
71 6
|
3月前
|
JavaScript 安全 前端开发
TypeScript类型声明:基础与进阶
通过本文的介绍,我们详细探讨了TypeScript的基础与进阶类型声明。从基本数据类型到复杂的泛型和高级类型,TypeScript提供了丰富的工具来确保代码的类型安全和可维护性。掌握这些类型声明能够帮助开发者编写更加健壮和高效的代码,提高开发效率和代码质量。希望本文能为您在使用TypeScript时提供实用的参考和指导。
63 2
|
3月前
|
JavaScript 前端开发 安全
TypeScript进阶:类型系统与高级类型的应用
【10月更文挑战第25天】TypeScript作为JavaScript的超集,其类型系统是其核心特性之一。本文通过代码示例介绍了TypeScript的基本数据类型、联合类型、交叉类型、泛型和条件类型等高级类型的应用。这些特性不仅提高了代码的可读性和可维护性,还帮助开发者构建更健壮的应用程序。
49 0
|
3月前
|
JavaScript 开发者
在 Babel 插件中使用 TypeScript 类型
【10月更文挑战第23天】可以在 Babel 插件中更有效地使用 TypeScript 类型,提高插件的开发效率和质量,减少潜在的类型错误。同时,也有助于提升代码的可理解性和可维护性,使插件的功能更易于扩展和升级。
|
4月前
|
JavaScript 前端开发
TypeScript【类型别名、泛型】超简洁教程!再也不用看臭又长的TypeScript文档了!
【10月更文挑战第11天】TypeScript【类型别名、泛型】超简洁教程!再也不用看臭又长的TypeScript文档了!