dprint-plugin-typescript 0.93.2

TypeScript and JavaScript code formatter.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// @ts-check
const fs = require("fs");
const path = require("path");
const args = process.argv.slice(2);
const wasmPath = path.join(__dirname, "../../target/wasm32-unknown-unknown/release/dprint_plugin_typescript.wasm");
fs.copyFileSync(wasmPath, path.join(__dirname, "plugin.wasm"));

if (args.length > 0) {
  // update the version based on the first argument
  const packageJsonPath = path.join(__dirname, "package.json");
  const packageJsonText = fs.readFileSync(packageJsonPath, "utf8");
  const packageJson = JSON.parse(packageJsonText);
  packageJson.version = args[0];
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, undefined, 2) + "\n");
}