chore-qa (#4)

Reviewed-on: https://git.t000-n.de/tbehrendt/ts3gotify/pulls/4
This commit is contained in:
2022-12-11 21:11:01 +00:00
parent 1605ad7c96
commit e07373667f
7 changed files with 4714 additions and 3 deletions

15
.drone.yml Normal file
View File

@@ -0,0 +1,15 @@
---
kind: pipeline
name: Testing
steps:
- name: spellcheck
image: node:18.12.1
commands:
- npm install
- npm run check:spell
- name: lint
image: node:18.12.1
commands:
- npm install
- npm run check:code

15
.eslintrc Normal file
View File

@@ -0,0 +1,15 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"no-console": 2
}
}

19
cspell.code.json Normal file
View File

@@ -0,0 +1,19 @@
{
"version": "0.2",
"language": "en-GB",
"dictionaryDefinitions": [
{
"name": "project-words",
"path": "./project-words.txt"
}
],
"dictionaries": [
"project-words",
"typescript"
],
"ignorePaths": [
"node_modules",
"dist",
"/project-words.txt"
]
}

4647
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,15 @@
{
"scripts": {
"build": "npx tsc"
"build": "npx tsc",
"check:code": "eslint src/ --ext .ts",
"check:spell": "cspell --config cspell.code.json **/*.ts"
},
"devDependencies": {
"@types/ts3-nodejs-library": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0",
"cspell": "^6.17.0",
"eslint": "^8.29.0",
"typescript": "^4.9.3"
},
"dependencies": {

9
project-words.txt Normal file
View File

@@ -0,0 +1,9 @@
gotify
teamspeak
clientconnect
textmessage
targetmode
clientmoved
queryport
serverport
clientdisconnect

View File

@@ -34,12 +34,12 @@ TeamSpeak.connect({
title: process.env.GOTIFY_TITLE || "ts3gotify",
message: `${event.client.nickname} connected`,
}).catch((error: Error) => {
console.error(`Error sending message to gotify: ${error.message}`)
logger.error(`Error sending message to gotify: ${error.message}`)
})
})
teamspeak.on("close", async () => {
console.debug("disconnected, trying to reconnect...")
logger.debug("disconnected, trying to reconnect...")
await teamspeak.reconnect(5, 1000)
logger.info("reconnected!")
})