angular - 对字符串而不是文件运行 tslint --fix
问题描述
我想在字符串的脚本中运行 tslint fix。我想象这样的事情:
import { fixer } from 'tslint'
const stringToFormatAndFix = // some typescript file content
const formatted = fixer(tslintJson, 'file/path/to/tslint.json')
背景:我正在使用tsquery查找接口的最后一个 PropertySignature 并向其附加一个字符串。之后我想根据 tslint.json 自动格式化该文件。因为我使用的是角度示意图并且所有更改都是在虚拟文件系统中进行的,所以我不能只通过它的 cli 运行 tslint。
解决方案
推荐阅读
- cross-compiling - 主机 PC 中 u-boot 的依赖关系是什么?
- python - PyAudio -- 如何在单个流中捕获麦克风和系统声音?
- angular - Angular 创建依赖于另一个更高级别组件的组件
- python - 预处理 csv 数据集重建后
- swift - 我如何在 uicollectionView 中获得如何滚动它
- java - 即使分析了主分支,Sonarcloud 也无法分析 PR
- f# - 如何检查 F# 预处理器中的操作系统?
- python - 如何根据其中一列中的唯一值最好地遍历 DataFrame 上的行?
- python - 选择正确的指标来计算损失
- python - 线性回归中的维度不匹配