Skip to content

Commit

Permalink
chore: new deno fmt rules (#4)
Browse files Browse the repository at this point in the history
* chore: change deno fmt rules
* chore: run deno fmt with new rules
  • Loading branch information
roziscoding authored Oct 16, 2023
1 parent 47a17e7 commit 416734d
Show file tree
Hide file tree
Showing 14 changed files with 1,089 additions and 830 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ const bot = new Bot("<telegram token>");
const myCommands = new Commands();

myCommands.command("start", "Initializes bot configuration")
.localize("pt", "start", "Inicializa as configurações do bot")
.addToScope({ type: "all_private_chats" }, (ctx) => ctx.reply(`Hello, ${ctx.chat.first_name}!`))
.addToScope({ type: "all_group_chats" }, (ctx) => ctx.reply(`Hello, members of ${ctx.chat.title}!`));
.localize("pt", "start", "Inicializa as configurações do bot")
.addToScope(
{ type: "all_private_chats" },
(ctx) => ctx.reply(`Hello, ${ctx.chat.first_name}!`),
)
.addToScope(
{ type: "all_group_chats" },
(ctx) => ctx.reply(`Hello, members of ${ctx.chat.title}!`),
);

// Calls `setMyCommands`
await myCommands.setCommands(bot);
Expand Down Expand Up @@ -54,14 +60,14 @@ const bot = new Bot<BotContext>("<telegram_token>");
bot.use(commands());

bot.on("message", async (ctx) => {
const cmds = new Commands();
const cmds = new Commands();

cmds.command("start", "Initializes bot configuration")
.localize("pt", "start", "Inicializa as configurações do bot");
cmds.command("start", "Initializes bot configuration")
.localize("pt", "start", "Inicializa as configurações do bot");

await ctx.setMyCommands(cmds);
await ctx.setMyCommands(cmds);

return ctx.reply("Commands set!");
return ctx.reply("Commands set!");
});

bot.start();
Expand Down
35 changes: 21 additions & 14 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
{
"fmt": {
"lineWidth": 120,
"exclude": ["node_modules"]
},
"lint": {
"include": ["src"]
},
"lock": false,
"tasks": {
"backport": "rm -rf out && deno run --no-prompt --allow-read=. --allow-write=. https://deno.land/x/deno2node@v1.9.0/src/cli.ts",
"dev": "deno lint && deno fmt --check && deno check src/mod.ts",
"test": "deno test --seed=123456 --parallel ./test/",
"coverage": "rm -rf ./test/cov_profile && deno task test --coverage=./test/cov_profile && deno coverage --lcov --output=./coverage.lcov ./test/cov_profile"
}
"fmt": {
"indentWidth": 4,
"exclude": [
"node_modules",
"test/cov_profile",
".vscode",
"coverage.lcov",
"out"
],
"proseWrap": "preserve"
},
"lint": {
"include": ["src"]
},
"lock": false,
"tasks": {
"backport": "rm -rf out && deno run --no-prompt --allow-read=. --allow-write=. https://deno.land/x/deno2node@v1.9.0/src/cli.ts",
"dev": "deno lint && deno fmt --check && deno check src/mod.ts",
"test": "deno test --seed=123456 --parallel ./test/",
"coverage": "rm -rf ./test/cov_profile && deno task test --coverage=./test/cov_profile && deno coverage --lcov --output=./coverage.lcov ./test/cov_profile"
}
}
262 changes: 131 additions & 131 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"name": "@grammyjs/commands",
"version": "0.3.1",
"description": "grammY Commands Plugin",
"main": "out/mod.js",
"scripts": {
"backport": "deno task backport",
"prepare": "deno task backport"
},
"keywords": [
"grammY",
"telegram",
"bot",
"commands"
],
"author": "Roz <roz@rjmunhoz.me>",
"license": "MIT",
"dependencies": {
"grammy": "^1.17.1",
"ts-pattern": "^5.0.1"
},
"devDependencies": {
"typescript": "^5.1.6"
},
"files": [
"out"
]
"name": "@grammyjs/commands",
"version": "0.3.1",
"description": "grammY Commands Plugin",
"main": "out/mod.js",
"scripts": {
"backport": "deno task backport",
"prepare": "deno task backport"
},
"keywords": [
"grammY",
"telegram",
"bot",
"commands"
],
"author": "Roz <roz@rjmunhoz.me>",
"license": "MIT",
"dependencies": {
"grammy": "^1.17.1",
"ts-pattern": "^5.0.1"
},
"devDependencies": {
"typescript": "^5.1.6"
},
"files": [
"out"
]
}
Loading

0 comments on commit 416734d

Please sign in to comment.