typescript 配置小计 发表于 2018-08-26 更新于 2023-04-02 本文字数: 95 阅读时长 ≈ 1 分钟 tsconfig.json 配置下面对 tsconfig.json 配置文件中常用配置做相关说明 若想使用下面语法导入 React 1import React, { Component } from 'react'; 而不是使用 1import * as React from 'react'; 需要在 tsconfig.json 配置文件中添加: 12345{ "compilerOptions": { "allowSyntheticDefaultImports": true }} tslint.json 配置允许成员函数不加 public 说明: 12345{ "rules": { "member-access": [true, "no-public"] // Or false. Read the rule and see what you want. }}