Goddamn Javascript Babel 一个零配置包,为您提供最新的Javascript,最新建议包括管道运算符foo |> bar ,可选的链接foo?.bar ,null合并foo ?? bar foo ?? bar等等。 快速开始 以下是如何使用最新最出色的Babel提案创建项目的方法: $ yarn init -y $ yarn add --dev goddamn-javascript-babel $ yarn goddamn-javascript-babel $ yarn add --dev goddamn-javascript-eslint $ yarn goddamn-javascript-eslint $ yarn babel -w src/* --out-dir dist 请注意,我们还安装了推荐的eslint软件包,其中包括Airbnb的规则+ Prettier。 为什么? 我已经受够了Javascript配置的破坏。 您需要大量的模块来获取最新的检测和格式化,它们都会更改版本并最终以各种不同的方式中断。 这只是一个安装模块,可锁定所有部门并带您到
2021-02-01 19:06:39 51KB javascript babel BabelJavaScript
1
TypeScript + Babel 7 基于Babel 7新功能构建的示例TypeScript项目。 包括React 16,Jest和Enzyme(用于测试)。 由于不再需要使用TypeScript编译器来编译源代码,因此您可以保留现有的Babel管道,而是依靠基于编辑器的类型检查或tsc 。 安装 git clone https://github.com/damassi/babel-7-typescript-example && cd babel-7-typescript-example yarn install yarn start yarn test:watch yarn typecheck 有关使用Webpack的更完整的示例,请参见此-感谢@flobacher。 如果使用VSCode,请确保安装推荐的扩展。 例 // App.tsx import React , { Component } from ' react ' interface Props { name : string } export const App extends Component < Pr
1