From 66a32af19878f8fc341c4e74b9324ea3e7c90b84 Mon Sep 17 00:00:00 2001 From: seth Date: Sun, 12 Nov 2023 02:50:19 -0500 Subject: chore: refactor lint/format config --- .editorconfig | 4 +++- .eslintrc.cjs | 8 -------- .prettierrc | 6 ------ build.ts | 6 +++++- package.json | 17 ++++++++++++++++- src/index.ts | 4 +++- 6 files changed, 27 insertions(+), 18 deletions(-) delete mode 100644 .eslintrc.cjs delete mode 100644 .prettierrc diff --git a/.editorconfig b/.editorconfig index 64ab260..d395ba4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,10 +4,12 @@ root = true [*] indent_style = tab tab_width = 2 +indent_size = "tab" end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[*.yml] +[*.{yml,yaml}] indent_style = space +indent_size = 2 diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index eb5dee8..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-env node */ -module.exports = { - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - root: true, - ignorePatterns: ["dist/**"], -}; diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 74e9453..0000000 --- a/.prettierrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "printWidth": 140, - "singleQuote": false, - "semi": true, - "useTabs": true -} diff --git a/build.ts b/build.ts index 3605b42..3c6a66c 100644 --- a/build.ts +++ b/build.ts @@ -27,7 +27,11 @@ const wies = (await readdir(teawieArchiveDir)).filter((wie) => { }); for (const f of wies) { - await copyFile(join(teawieArchiveDir, f), join(contentDir, "teawie", f), constants.COPYFILE_FICLONE); + await copyFile( + join(teawieArchiveDir, f), + join(contentDir, "teawie", f), + constants.COPYFILE_FICLONE, + ); } const define = { diff --git a/package.json b/package.json index 9e8f7c7..84fafed 100644 --- a/package.json +++ b/package.json @@ -28,5 +28,20 @@ "typescript": "^5.2.2", "wrangler": "^3.15.0" }, - "packageManager": "pnpm@8.8.0" + "packageManager": "pnpm@8.8.0", + "eslintConfig": { + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "parser": "@typescript-eslint/parser", + "plugins": [ + "@typescript-eslint" + ], + "root": true, + "ignorePatterns": [ + "dist/**" + ] + } } diff --git a/src/index.ts b/src/index.ts index 5846a97..397dd30 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,9 @@ app.use("*", logger()); app.use("*", prettyJSON()); app.get("/", (c) => { - return c.redirect(c.env.REDIRECT_ROOT ?? "https://github.com/getchoo/teawieAPI"); + return c.redirect( + c.env.REDIRECT_ROOT ?? "https://github.com/getchoo/teawieAPI", + ); }); app.get("/static/*", async (c) => { -- cgit v1.2.3