Skip to content

Commit 0f15e2f

Browse files
committed
add eslint & prettier
1 parent 7950e23 commit 0f15e2f

File tree

6 files changed

+805
-13
lines changed

6 files changed

+805
-13
lines changed

.eslintrc.cjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/* eslint-env node */
2+
3+
module.exports = {
4+
root: true,
5+
parser: '@typescript-eslint/parser',
6+
plugins: ['@typescript-eslint'],
7+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8+
};

.prettierrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "es5",
4+
"useTabs": false,
5+
"tabWidth": 2,
6+
"semi": true
7+
}

index.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const client = new Client({
1313
Intents.FLAGS.DIRECT_MESSAGES,
1414
Intents.FLAGS.GUILD_MEMBERS,
1515
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
16+
Intents.FLAGS.GUILD_BANS,
1617
],
1718
});
1819

@@ -22,7 +23,14 @@ client.once('ready', async () => {
2223
console.log(green(bold('Discord bot ready!')));
2324
console.log(
2425
'Invite link:',
25-
blue(underline(client.generateInvite({ scopes: ['bot'] })))
26+
blue(
27+
underline(
28+
client.generateInvite({
29+
scopes: ['bot'],
30+
permissions: ['ADMINISTRATOR'],
31+
})
32+
)
33+
)
2634
);
2735

2836
const POLYMC_GUILD = await client.guilds.fetch(BuildConfig.GUILD_ID);

logParser.ts

-1
This file was deleted.

package.json

+9-2
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,24 @@
44
"license": "MIT",
55
"scripts": {
66
"dev": "nodemon --watch index.ts --exec esno index.ts",
7-
"build": "esbuild index.ts --format=cjs --platform=node --bundle --minify --outfile=index.js"
7+
"build": "esbuild index.ts --format=cjs --platform=node --bundle --minify --outfile=index.js",
8+
"lint": "eslint **/*.ts"
89
},
910
"dependencies": {
11+
"@cliqz/adblocker": "^1.23.8",
1012
"bad-words": "^3.0.4",
1113
"discord.js": "^13.7.0",
1214
"kleur": "^4.1.4"
1315
},
1416
"devDependencies": {
1517
"@types/bad-words": "^3.0.1",
18+
"@typescript-eslint/eslint-plugin": "^5.25.0",
19+
"@typescript-eslint/parser": "^5.25.0",
1620
"esbuild": "^0.14.39",
21+
"eslint": "^8.16.0",
1722
"esno": "^0.16.3",
18-
"nodemon": "^2.0.16"
23+
"nodemon": "^2.0.16",
24+
"prettier": "^2.6.2",
25+
"typescript": "^4.6.4"
1926
}
2027
}

0 commit comments

Comments
 (0)