Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 199ab3d

Browse files
committedMay 14, 2024
chore: switch to dprint and oxlint
1 parent e95e407 commit 199ab3d

31 files changed

+1199
-1404
lines changed
 

‎.eslintrc.json

-78
This file was deleted.

‎.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Run Linter
3535
run: ./.yarn/yarn.cjs test:lint
3636
- name: Run Prettier Check
37-
run: ./.yarn/yarn.cjs test:prettier
37+
run: ./.yarn/yarn.cjs test:fmt
3838
- name: Run Unit Test
3939
run: ./.yarn/yarn.cjs test:unit
4040
- name: Attempt Build

‎.prettierignore

-2
This file was deleted.

‎.prettierrc.mjs

-15
This file was deleted.

‎.vscode/settings.json

+23-13
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,36 @@
66
},
77
"json.schemas": [
88
{
9-
"fileMatch": [
10-
"git-hook-tasks.config.json"
11-
],
9+
"fileMatch": ["git-hook-tasks.config.json"],
1210
"url": "./node_modules/git-hook-tasks/dist/config/json-schema.json"
1311
},
1412
{
15-
"fileMatch": [
16-
"react-gnome.config.json"
17-
],
13+
"fileMatch": ["react-gnome.config.json"],
1814
"url": "./dist/config-schema.json"
1915
},
2016
{
21-
"fileMatch": [
22-
"react-gtk.config.json"
23-
],
17+
"fileMatch": ["react-gtk.config.json"],
2418
"url": "./dist/config-schema.json"
2519
}
2620
],
27-
"cSpell.words": [
28-
"esbuild"
29-
],
30-
"gest.verboseArg": true
21+
"cSpell.words": ["esbuild"],
22+
"gest.verboseArg": true,
23+
"[typescript]": {
24+
"editor.defaultFormatter": "dprint.dprint"
25+
},
26+
"[typescriptreact]": {
27+
"editor.defaultFormatter": "dprint.dprint"
28+
},
29+
"[javascript]": {
30+
"editor.defaultFormatter": "dprint.dprint"
31+
},
32+
"[javascriptreact]": {
33+
"editor.defaultFormatter": "dprint.dprint"
34+
},
35+
"[markdown]": {
36+
"editor.defaultFormatter": "dprint.dprint"
37+
},
38+
"[json]": {
39+
"editor.defaultFormatter": "dprint.dprint"
40+
}
3141
}

‎__tests__/utils/sleep.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
export const sleep = (ms: number) =>
2-
new Promise((resolve) => setTimeout(resolve, ms));
1+
export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));

‎dprint.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"typescript": {
3+
},
4+
"json": {
5+
},
6+
"markdown": {
7+
},
8+
"toml": {
9+
},
10+
"excludes": [
11+
"**/node_modules",
12+
"**/*-lock.json"
13+
],
14+
"plugins": [
15+
"https://plugins.dprint.dev/typescript-0.90.5.wasm",
16+
"https://plugins.dprint.dev/json-0.19.2.wasm",
17+
"https://plugins.dprint.dev/markdown-0.17.0.wasm",
18+
"https://plugins.dprint.dev/toml-0.6.1.wasm"
19+
]
20+
}

‎git-hook-tasks.config.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
"hooks": {
66
"pre-push": [
77
{
8-
"name": "TypeScript",
8+
"name": "Type Check",
99
"script": "test:tsc"
1010
},
1111
{
12-
"name": "ESLint",
12+
"name": "Lint",
1313
"script": "test:lint"
1414
},
1515
{
16-
"name": "Prettier",
17-
"script": "test:prettier"
16+
"name": "Formatting",
17+
"script": "test:fmt"
1818
},
1919
{
2020
"name": "Unit Tests",

‎package.json

+8-13
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
},
2121
"version": "1.0.0",
2222
"scripts": {
23-
"fix:lint": "eslint --fix .",
24-
"fix:prettier": "prettier -w ./src .",
23+
"fix:lint": "oxlint --fix .",
24+
"fix:fmt": "dprint fmt ./src/**/* && dprint fmt ./__tests__/**/*",
2525
"test:unit": "gest --verbose",
26-
"test:lint": "eslint .",
27-
"test:prettier": "prettier -c ./src && prettier -c ./__tests__",
26+
"test:lint": "oxlint .",
27+
"test:fmt": "dprint check ./src/**/* && dprint check ./__tests__/**/*",
2828
"test:tsc": "tsc --noEmit",
2929
"build": "node ./scripts/build.cjs",
3030
"postinstall": "bash -c \"if [ ! -e .no-postinstall ]; then node ./dist/legacy/add-config-schema.js; fi\""
@@ -44,28 +44,23 @@
4444
"buffer": "^6.0.3",
4545
"clify.js": "^1.0.0-beta.1",
4646
"dilswer": "2.1.1",
47-
"esbuild": "^0.19.3",
47+
"esbuild": "^0.21.2",
4848
"fs-gjs": "^1.0.1",
4949
"rimraf": "^4.4.1",
5050
"tar": "^6.2.0",
5151
"termx-markup": "~2.0.2",
5252
"whatwg-url-without-unicode": "^8.0.0-3"
5353
},
5454
"devDependencies": {
55-
"@ncpa0cpl/nodepack": "^2.3.0",
55+
"@ncpa0cpl/nodepack": "^2.3.3",
5656
"@reactgjs/gest": "^0.5.0",
5757
"@swc/core": "^1.5.5",
5858
"@types/tar": "^6.1.6",
59-
"@typescript-eslint/eslint-plugin": "latest",
60-
"@typescript-eslint/parser": "latest",
61-
"eslint": "latest",
62-
"eslint-config-prettier": "latest",
63-
"eslint-plugin-prettier": "latest",
59+
"dprint": "^0.45.1",
6460
"git-hook-tasks": "ncpa0cpl/git-hook-tasks",
6561
"gjs-esm-types": "^0.0.4",
6662
"husky": "latest",
67-
"prettier": "^3.0.3",
68-
"prettier-plugin-jsdoc": "^1.0.2",
63+
"oxlint": "^0.3.4",
6964
"ts-node": "^10.9.2",
7065
"typescript": "latest",
7166
"ws": "^8.14.1"

‎src/config/config-schema.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { DataType, OptionalField } from "dilswer";
22
import type { Plugin as EsbuildPlugin } from "esbuild";
33

44
export const EsbuildPluginDataType = DataType.Custom(
5-
(v): v is EsbuildPlugin =>
6-
typeof v === "object" && v !== null && "name" in v && "setup" in v,
5+
(v): v is EsbuildPlugin => typeof v === "object" && v !== null && "name" in v && "setup" in v,
76
)
87
.setTitle("EsbuildPlugin")
98
.setExtra({

‎src/polyfills/fetch.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ registerPolyfills("fetch")(() => {
9090
const abortReason = options.signal?.reason;
9191
const error = wasAborted
9292
? () =>
93-
abortReason ??
94-
new Error("Request was aborted. Cannot read the response body.")
93+
abortReason
94+
?? new Error("Request was aborted. Cannot read the response body.")
9595
: () =>
96-
new Error(
97-
"HTTP Request has failed, cannot read the response body.",
98-
);
96+
new Error(
97+
"HTTP Request has failed, cannot read the response body.",
98+
);
9999

100100
return {
101101
status: status_code,

‎src/polyfills/form-data.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ registerPolyfills("FormData")(() => {
5656
entries(): IterableIterator<[string, FormDataEntryValue]> {
5757
const entries = this._entries;
5858

59-
const generator = function* (): Generator<[string, string]> {
59+
const generator = function*(): Generator<[string, string]> {
6060
for (const [key, value] of entries) {
6161
for (const v of value) {
6262
yield [key, v];
@@ -80,7 +80,7 @@ registerPolyfills("FormData")(() => {
8080
values(): IterableIterator<FormDataEntryValue> {
8181
const entries = this._entries;
8282

83-
const generator = function* (): Generator<string> {
83+
const generator = function*(): Generator<string> {
8484
for (const [, value] of entries) {
8585
for (const v of value) {
8686
yield v;

0 commit comments

Comments
 (0)
Please sign in to comment.