Skip to content

Commit

Permalink
Remove Prettier and ESLint configurations, switch to Biome for lintin…
Browse files Browse the repository at this point in the history
…g and formatting
  • Loading branch information
kamiazya committed Feb 5, 2024
1 parent d30e381 commit bd75fc3
Show file tree
Hide file tree
Showing 10 changed files with 217 additions and 1,548 deletions.
16 changes: 0 additions & 16 deletions .eslintrc.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc.yaml

This file was deleted.

29 changes: 29 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://biomejs.dev/schemas/1.4.1/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true,
"include": ["src/**/*"]
},
"organizeImports": {
"enabled": true
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noExplicitAny": "off"
}
}
}
}
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"setup"
],
"scripts": {
"lint": "eslint src && prettier --check src/**/*.ts",
"format": "prettier --write src/**/*.ts",
"lint": "biome check src",
"format": "biome check --apply src",
"build": "tsc",
"test": "vitest"
},
Expand All @@ -21,14 +21,8 @@
"@actions/tool-cache": "^2.0.1"
},
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@types/node": "^20.11.13",
"@typescript-eslint/eslint-plugin": "^5.33.1",
"@typescript-eslint/parser": "^5.33.1",
"eslint": "^8.22.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.8.3",
"prettier": "^2.7.1",
"typescript": "^5.3.2",
"vitest": "^1.2.2"
}
Expand Down
53 changes: 26 additions & 27 deletions src/GraphvizInstaller.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { getBooleanInput, getInput } from '@actions/core';
import { exec } from '@actions/exec';
import { getBooleanInput, getInput } from "@actions/core";
import { exec } from "@actions/exec";

export class GraphvizInstaller {
public async get() {
await this.install();
}
private async install() {
switch (process.platform) {
case 'darwin':
case "darwin":
await this.brewInstall();
break;
case 'linux':
case "linux":
await this.getAptInstall();
break;
case 'win32':
case "win32":
await this.chocoInstall();
break;
default:
Expand All @@ -22,40 +22,39 @@ export class GraphvizInstaller {
}

private async brewInstall() {
const skipBrewUpdate = getBooleanInput('macos-skip-brew-update');
const skipBrewUpdate = getBooleanInput("macos-skip-brew-update");
if (skipBrewUpdate === false) {
await exec('brew', ['update']);
await exec("brew", ["update"]);
}
await exec('brew', [
'install',
'graphviz',
]);
await exec("brew", ["install", "graphviz"]);
}

private async getAptInstall() {
const skipAptUpdate = getBooleanInput('ubuntu-skip-apt-update');
const graphvizVersion = getInput('ubuntu-graphviz-version');
const libgraphvizdevVersion = getInput('ubuntu-libgraphvizdev-version');
const skipAptUpdate = getBooleanInput("ubuntu-skip-apt-update");
const graphvizVersion = getInput("ubuntu-graphviz-version");
const libgraphvizdevVersion = getInput("ubuntu-libgraphvizdev-version");
if (skipAptUpdate === false) {
await exec('sudo', ['apt-get', 'update']);
await exec("sudo", ["apt-get", "update"]);
}
await exec('sudo', [
'apt-get',
'install',
'-y',
graphvizVersion ? `graphviz=${graphvizVersion}` : 'graphviz',
await exec("sudo", [
"apt-get",
"install",
"-y",
graphvizVersion ? `graphviz=${graphvizVersion}` : "graphviz",
// https://github.com/pygraphviz/pygraphviz/issues/163#issuecomment-570770201
libgraphvizdevVersion ? `libgraphviz-dev=${libgraphvizdevVersion}` : 'libgraphviz-dev',
'pkg-config',
libgraphvizdevVersion
? `libgraphviz-dev=${libgraphvizdevVersion}`
: "libgraphviz-dev",
"pkg-config",
]);
}

private async chocoInstall() {
const graphvizVersion = getInput('windows-graphviz-version');
await exec('choco', [
'install',
'graphviz',
...(graphvizVersion ? [`--version=${graphvizVersion}`]: [])
const graphvizVersion = getInput("windows-graphviz-version");
await exec("choco", [
"install",
"graphviz",
...(graphvizVersion ? [`--version=${graphvizVersion}`] : []),
]);
}
}
Loading

0 comments on commit bd75fc3

Please sign in to comment.