diff --git a/.github/config/dprint.json b/.github/config/dprint.json
new file mode 100644
index 00000000..034516f2
--- /dev/null
+++ b/.github/config/dprint.json
@@ -0,0 +1,25 @@
+{
+ "$schema": "https://dprint.dev/schemas/v0.json",
+ "projectType": "openSource",
+ "incremental": true,
+ "indentWidth": 2,
+ "typescript": {
+ "lineWidth": 280,
+ "semiColons": "asi",
+ "quoteStyle": "preferDouble",
+ "useBraces": "preferNone",
+ "singleBodyPosition": "nextLine",
+ "arrowFunction.useParentheses": "preferNone",
+ "commentLine.forceSpaceAfterSlashes": false,
+ "taggedTemplate.spaceBeforeLiteral": false,
+ "nextControlFlowPosition": "nextLine"
+ },
+ "includes": ["**/*.{js,mjs}"],
+ "excludes": [
+ "**/node_modules",
+ "**/.github"
+ ],
+ "plugins": [
+ "https://plugins.dprint.dev/typescript-0.42.0.wasm"
+ ]
+}
diff --git a/package.json b/package.json
index fbfd9208..2306e6fc 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,8 @@
"preview": "node .github/preview.mjs",
"linter": "eslint source/**/*.mjs",
"dev": "nodemon source/app/web/index.mjs -e mjs,css,ejs,json",
- "postinstall": "node node_modules/puppeteer/install.js"
+ "postinstall": "node node_modules/puppeteer/install.js",
+ "fmt": "dprint fmt --config .github/config/dprint.json && eslint source/**/*.mjs --fix"
},
"repository": {
"type": "git",
diff --git a/source/.eslintrc.yml b/source/.eslintrc.yml
index 04f525a7..07fb0281 100644
--- a/source/.eslintrc.yml
+++ b/source/.eslintrc.yml
@@ -89,7 +89,6 @@ rules:
# Prefer using new syntax and features
prefer-regex-literals: error
- prefer-named-capture-group: error
prefer-arrow-callback: error
prefer-destructuring: error
prefer-numeric-literals: error
@@ -103,15 +102,15 @@ rules:
no-unsafe-finally: off
# =========================================================================
- # Rules below are really motivated by
# Code style (general rules)
no-tabs: error
no-trailing-spaces: error
brace-style: [error, stroustrup]
- comma-dangle: [error, always-multiline]
comma-style: error
sort-vars: error
+ no-async-promise-executor: off
+ no-misleading-character-class: off
# Coding style (quoting rules)
quote-props: [error, as-needed, {numbers: true}]
@@ -120,7 +119,6 @@ rules:
# Coding style (comments rules)
line-comment-position: error
- capitalized-comments: error
# Coding style (spacing rules)
block-spacing: [error, always]
@@ -128,14 +126,10 @@ rules:
func-call-spacing: error
arrow-spacing: error
generator-star-spacing: error
- object-curly-spacing: [error, never]
rest-spread-spacing: error
- key-spacing: [error, {afterColon: false}]
computed-property-spacing: error
- switch-colon-spacing: [error, {after: false}]
array-bracket-spacing: [error, never]
no-whitespace-before-property: error
- space-before-function-paren: [error, never]
space-in-parens: error
spaced-comment: [error, never]
lines-between-class-members: error
@@ -148,8 +142,6 @@ rules:
no-new-func: error
no-new-wrappers: error
func-names: [error, never]
- function-call-argument-newline: [error, never]
- function-paren-newline: [error, never]
no-extra-parens: [error, functions]
arrow-body-style: [error, as-needed]
arrow-parens: [error, as-needed]
diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs
index 12ada790..f54fcbaf 100644
--- a/source/app/action/index.mjs
+++ b/source/app/action/index.mjs
@@ -8,7 +8,9 @@
import fs from "fs/promises"
import paths from "path"
import sgit from "simple-git"
- process.on("unhandledRejection", error => { throw error }) //eslint-disable-line max-statements-per-line, brace-style
+ process.on("unhandledRejection", error => {
+ throw error
+ })
//Debug message buffer
let DEBUG = true
diff --git a/source/app/metrics/utils.mjs b/source/app/metrics/utils.mjs
index 749c0dd3..b5c652ab 100644
--- a/source/app/metrics/utils.mjs
+++ b/source/app/metrics/utils.mjs
@@ -344,7 +344,7 @@
//Apply replacements
for (const [emoji, twemoji] of emojis) {
if (custom)
- rendered = rendered.replace(new RegExp(`[^>]*)>${emoji}`, "g"), twemoji.replace(/(