Add prettier config

This commit is contained in:
Luc Perkins 2024-04-21 14:17:24 -03:00
parent 6718417fb9
commit 79316a7a03
No known key found for this signature in database
GPG key ID: 16DB1108FB591835
4 changed files with 20 additions and 8 deletions

View file

@ -1,2 +1,2 @@
dist
pnpm-lock.yaml pnpm-lock.yaml

View file

@ -8,6 +8,7 @@
"scripts": { "scripts": {
"build": "tsup", "build": "tsup",
"format": "prettier --write .", "format": "prettier --write .",
"check-fmt": "prettier --check .",
"lint": "eslint src/**/*.ts", "lint": "eslint src/**/*.ts",
"package": "ncc build", "package": "ncc build",
"all": "pnpm run format && pnpm run lint && pnpm run build && pnpm run package" "all": "pnpm run format && pnpm run lint && pnpm run build && pnpm run package"

12
prettier.config.cjs Normal file
View file

@ -0,0 +1,12 @@
/** @type {import('prettier').Config} */
module.exports = {
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")],
semi: true,
singleQuote: false,
tabWidth: 2,
trailingComma: "all",
useTabs: false,
// Import sorting
importOrderSeparation: true,
importOrderSortSpecifiers: true,
};

View file

@ -1,15 +1,14 @@
import * as core from "@actions/core";
import { IdsToolbox } from "detsys-ts";
import got from "got";
import * as http from "http";
import { SpawnOptions, exec, spawn } from "node:child_process";
import { openSync, readFileSync } from "node:fs";
import * as fs from "node:fs/promises"; import * as fs from "node:fs/promises";
import * as os from "node:os"; import * as os from "node:os";
import * as path from "node:path"; import * as path from "node:path";
import { spawn, exec, SpawnOptions } from "node:child_process";
import { openSync, readFileSync } from "node:fs";
import { inspect, promisify } from "node:util"; import { inspect, promisify } from "node:util";
import * as http from "http";
import * as core from "@actions/core";
import { Tail } from "tail"; import { Tail } from "tail";
import got from "got";
import { IdsToolbox } from "detsys-ts";
const ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR"; const ENV_CACHE_DAEMONDIR = "MAGIC_NIX_CACHE_DAEMONDIR";