Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Jan 15, 2024
1 parent 474c8d0 commit 6eb27ec
Show file tree
Hide file tree
Showing 19 changed files with 633,403 additions and 633,405 deletions.
56 changes: 28 additions & 28 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"ignorePatterns": ["**/*.js"],
"rules": {
"prefer-arrow-callback": ["warn", { "allowNamedFunctions": true }], // Disallow arrow functions as expressions
"func-style": ["warn", "declaration", { "allowArrowFunctions": false }], // Disallow the use of function expressions
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "typeLike", "format": ["PascalCase"] },
{ "selector": "variableLike", "format": ["camelCase"] },
{ "selector": "memberLike", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "require" },
{ "selector": "variable", "types": ["boolean"], "format": ["PascalCase"], "prefix": ["is", "should", "has", "can", "did", "will"] },
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{ "selector": "typeParameter", "format": ["PascalCase"], "prefix": ["T"] },
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false } },
{ "selector": ["function", "variable"], "format": ["camelCase"] },
{ "selector": "variable", "modifiers": ["destructured"], "format": null },
{ "selector": "variable", "format": ["camelCase"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{ "selector": "variable", "types": ["boolean"], "format": ["PascalCase"], "prefix": ["is", "has", "should", "can", "did", "will"] }
]
}
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
},
"plugins": ["@typescript-eslint"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"ignorePatterns": ["**/*.js"],
"rules": {
"prefer-arrow-callback": ["warn", { "allowNamedFunctions": true }], // Disallow arrow functions as expressions
"func-style": ["warn", "declaration", { "allowArrowFunctions": false }], // Disallow the use of function expressions
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/naming-convention": [
"error",
{ "selector": "typeLike", "format": ["PascalCase"] },
{ "selector": "variableLike", "format": ["camelCase"] },
{ "selector": "memberLike", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "require" },
{ "selector": "variable", "types": ["boolean"], "format": ["PascalCase"], "prefix": ["is", "should", "has", "can", "did", "will"] },
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{ "selector": "typeParameter", "format": ["PascalCase"], "prefix": ["T"] },
{ "selector": "interface", "format": ["PascalCase"], "custom": { "regex": "^I[A-Z]", "match": false } },
{ "selector": ["function", "variable"], "format": ["camelCase"] },
{ "selector": "variable", "modifiers": ["destructured"], "format": null },
{ "selector": "variable", "format": ["camelCase"], "leadingUnderscore": "allow", "trailingUnderscore": "allow" },
{ "selector": "variable", "types": ["boolean"], "format": ["PascalCase"], "prefix": ["is", "has", "should", "can", "did", "will"] }
]
}
}
16 changes: 8 additions & 8 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"htmlWhitespaceSensitivity": "strict",
"plugins": [],
"printWidth": 140,
"useTabs": false
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"htmlWhitespaceSensitivity": "strict",
"plugins": [],
"printWidth": 140,
"useTabs": false
}
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"recommendations": ["arcanis.vscode-zipfs", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
"recommendations": ["arcanis.vscode-zipfs", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
20 changes: 9 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"cSpell.words": [
"smee"
]
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"cSpell.words": ["smee"]
}
46 changes: 23 additions & 23 deletions build/esbuild-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ import esbuild from "esbuild";
const typescriptEntries = ["src/worker.ts"];
// const cssEntries = ["static/style.css"];
const entries = [
...typescriptEntries,
// ...cssEntries
...typescriptEntries,
// ...cssEntries
];

export const esBuildContext: esbuild.BuildOptions = {
sourcemap: true,
entryPoints: entries,
bundle: true,
minify: false,
loader: {
".png": "dataurl",
".woff": "dataurl",
".woff2": "dataurl",
".eot": "dataurl",
".ttf": "dataurl",
".svg": "dataurl",
},
outdir: "dist",
sourcemap: true,
entryPoints: entries,
bundle: true,
minify: false,
loader: {
".png": "dataurl",
".woff": "dataurl",
".woff2": "dataurl",
".eot": "dataurl",
".ttf": "dataurl",
".svg": "dataurl",
},
outdir: "dist",
};

esbuild
.build(esBuildContext)
.then(() => {
console.log("\tesbuild complete");
})
.catch((err) => {
console.error(err);
process.exit(1);
});
.build(esBuildContext)
.then(() => {
console.log("\tesbuild complete");
})
.catch((err) => {
console.error(err);
process.exit(1);
});
18 changes: 9 additions & 9 deletions build/esbuild-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import esbuild from "esbuild";
import { esBuildContext } from "./esbuild-build";

(async () => {
await server();
await server();
})().catch((error) => {
console.error("Unhandled error:", error);
process.exit(1);
console.error("Unhandled error:", error);
process.exit(1);
});

export async function server() {
const _context = await esbuild.context(esBuildContext);
const { port } = await _context.serve({
servedir: "dist",
port: 8080,
});
console.log(`http://localhost:${port}`);
const _context = await esbuild.context(esBuildContext);
const { port } = await _context.serve({
servedir: "dist",
port: 8080,
});
console.log(`http://localhost:${port}`);
}
142 changes: 71 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,73 @@
{
"name": "ubiquibot-worker",
"version": "0.0.0",
"private": true,
"description": "Template repository with TypeScript support.",
"main": "build/index.ts",
"author": "Ubiquity DAO",
"license": "MIT",
"engines": {
"node": ">=20.10.0"
},
"scripts": {
"format": "run-s format:prettier format:lint",
"format:lint": "eslint --fix .",
"format:prettier": "prettier --write .",
"prepare": "husky install",
"deploy": "wrangler deploy",
"dev": "wrangler dev --port 8787",
"proxy": "tsx src/proxy.ts",
"generate": "node ./generate-ajv-validation-function.js"
},
"keywords": [
"typescript",
"template",
"dao",
"ubiquity",
"open-source"
],
"dependencies": {
"@octokit/webhooks": "^12.0.10",
"@octokit/webhooks-schemas": "^7.3.1",
"@octokit/webhooks-types": "^7.3.1",
"@sinclair/typebox": "^0.32.5",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"create-cloudflare": "^2.8.3",
"octokit": "^3.1.2",
"smee-client": "^2.0.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231121.0",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@types/node": "^20.11.1",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"dotenv": "^16.3.1",
"esbuild": "^0.19.10",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"husky": "^8.0.3",
"knip": "^3.3.0",
"lint-staged": "^15.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.0",
"tsx": "^4.6.2",
"typescript": "^5.0.4",
"wrangler": "^3.22.3"
},
"lint-staged": {
"*.ts": [
"prettier --write",
"eslint --fix"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"packageManager": "yarn@4.0.2"
"name": "ubiquibot-worker",
"version": "0.0.0",
"private": true,
"description": "Template repository with TypeScript support.",
"main": "build/index.ts",
"author": "Ubiquity DAO",
"license": "MIT",
"engines": {
"node": ">=20.10.0"
},
"scripts": {
"format": "run-s format:prettier format:lint",
"format:lint": "eslint --fix .",
"format:prettier": "prettier --write .",
"prepare": "husky install",
"deploy": "wrangler deploy",
"dev": "wrangler dev --port 8787",
"proxy": "tsx src/proxy.ts",
"generate": "node ./generate-ajv-validation-function.js"
},
"keywords": [
"typescript",
"template",
"dao",
"ubiquity",
"open-source"
],
"dependencies": {
"@octokit/webhooks": "^12.0.10",
"@octokit/webhooks-schemas": "^7.3.1",
"@octokit/webhooks-types": "^7.3.1",
"@sinclair/typebox": "^0.32.5",
"ajv": "^8.12.0",
"ajv-formats": "^2.1.1",
"create-cloudflare": "^2.8.3",
"octokit": "^3.1.2",
"smee-client": "^2.0.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231121.0",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@types/node": "^20.11.1",
"@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1",
"dotenv": "^16.3.1",
"esbuild": "^0.19.10",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"husky": "^8.0.3",
"knip": "^3.3.0",
"lint-staged": "^15.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.0",
"tsx": "^4.6.2",
"typescript": "^5.0.4",
"wrangler": "^3.22.3"
},
"lint-staged": {
"*.ts": [
"prettier --write",
"eslint --fix"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"packageManager": "yarn@4.0.2"
}
Loading

0 comments on commit 6eb27ec

Please sign in to comment.