jos*_*eph 6 javascript whitespace typescript
我希望从打字稿生成的 JavaScript 代码具有相同的白色间距。长话短说,我们正在从 js 迁移到 ts,并且维护空格将使我们能够将生成的代码与未迁移的代码版本进行比较。
我的输入 ts 看起来像:
id = this.getOrCreate(
entity.uuid,
dao.wrap(utils.trimProxyPrefix(entity.name)),
dao.wrap(entity.type),
dao.wrap(entity.targetName),
dao.wrap(entity.targetType),
dao.wrap(entity.targetIp),
dao.wrap(host),
dao.wrap(version),
dao.wrap(status)
);
Run Code Online (Sandbox Code Playgroud)
输出看起来很丑陋的超长行:
id = this.getOrCreate(entity.uuid, dao.wrap(utils.trimProxyPrefix(entity.name)), dao.wrap(entity.type), dao.wrap(entity.targetName), dao.wrap(entity.targetType), dao.wrap(entity.targetIp), dao.wrap(host), dao.wrap(version), dao.wrap(status));
Run Code Online (Sandbox Code Playgroud)
我的预期输出是:
id = this.getOrCreate(
entity.uuid,
dao.wrap(utils.trimProxyPrefix(entity.name)),
dao.wrap(entity.type),
dao.wrap(entity.targetName),
dao.wrap(entity.targetType),
dao.wrap(entity.targetIp),
dao.wrap(host),
dao.wrap(version),
dao.wrap(status)
);
Run Code Online (Sandbox Code Playgroud)
我的 tsconfig 看起来像:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"outDir": "./dist",
},
"include": ["./src/**/*"],
"exclude": [
"node_modules",
"./src/real/*"
]
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2827 次 |
| 最近记录: |