diff --git a/server/.eslintrc.js b/server/.eslintrc.js index c9ea8d3..30d1d43 100644 --- a/server/.eslintrc.js +++ b/server/.eslintrc.js @@ -16,7 +16,6 @@ module.exports = { 'ignoreDestructuring': false, 'ignoreImports': false, }], - // 'capitalized-comments': ['error', 'always'], 'comma-dangle': ['error', 'always-multiline'], 'comma-spacing': ['error', { 'before': false, 'after': true }], 'curly': ['error', 'all'], @@ -49,14 +48,14 @@ module.exports = { 'ignoreCase': false, 'ignoreDeclarationSort': false, 'ignoreMemberSort': false, - 'memberSyntaxSortOrder': ['none', 'all', 'multiple', 'single'] + 'memberSyntaxSortOrder': ['none', 'all', 'multiple', 'single'], }], 'sort-vars': ['error', { 'ignoreCase': true }], 'space-before-blocks': ['error', 'always'], 'space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'never', - 'asyncArrow': 'always' + 'asyncArrow': 'always', }], 'space-in-parens': ['error', 'never'], 'spaced-comment': ['error', 'always'], @@ -76,14 +75,37 @@ module.exports = { 'plugin:@typescript-eslint/recommended', ], rules: { - // '@typescript-eslint/array-type': ['error', { - // 'default': 'array', - // 'readonly': 'array-simple', - // }], - '@typescript-eslint/interface-name-prefix': ['error', 'always'], + '@typescript-eslint/naming-convention': [ + 'error', + { + 'selector': 'default', + 'format': ['camelCase'], + }, + { + 'selector': 'variable', + 'modifiers': ['const'], + 'format': ['PascalCase', 'camelCase'], + }, + { + 'selector': 'parameter', + 'format': ['camelCase'], + 'leadingUnderscore': 'allow', + }, + { + 'selector': 'typeLike', + 'format': ['PascalCase'], + }, + { + 'selector': 'interface', + 'format': ['PascalCase'], + 'prefix': ['I'], + }, + ], '@typescript-eslint/no-empty-interface': ['error', { 'allowSingleExtends': false }], + 'quotes': 'off', + '@typescript-eslint/quotes': ['error', 'single'], '@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }], - } - } + }, + }, ], }; \ No newline at end of file diff --git a/server/src/app/controllers/app.controller.ts b/server/src/app/controllers/app.controller.ts index 42057fa..c91d19a 100644 --- a/server/src/app/controllers/app.controller.ts +++ b/server/src/app/controllers/app.controller.ts @@ -7,7 +7,7 @@ export class AppController { @Get() @Render('index.hbs') - async getIndex(): Promise { + async getIndex(): Promise> { const channels = await this.teamspeakService.getPopulatedChannelList(); return { title: 'Cliffbreak.de TS-Viewer', channels }; } diff --git a/server/src/app/services/teamspeak.service.ts b/server/src/app/services/teamspeak.service.ts index a6847a8..6ae5f9e 100644 --- a/server/src/app/services/teamspeak.service.ts +++ b/server/src/app/services/teamspeak.service.ts @@ -6,8 +6,9 @@ import { TeamSpeakClient } from 'node-ts'; const env = process.env; +/* eslint-disable camelcase */ /* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/camelcase */ +/* eslint-disable @typescript-eslint/naming-convention */ // Disable specific ESLint rules because node-ts has no typings @Injectable() export class TeamspeakService { diff --git a/server/src/server.ts b/server/src/server.ts index 76362cc..f67af92 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -5,7 +5,6 @@ import { NestFactory } from '@nestjs/core'; import { join } from 'path'; const env = process.env; -const __webapp = join(__dirname, '..', '..', 'webapp'); async function bootstrap(): Promise { @@ -15,14 +14,14 @@ async function bootstrap(): Promise { ); app.useStaticAssets({ - root: join(__webapp, 'assets'), + root: join(__dirname, '../../webapp/assets'), prefix: '/assets/', }); app.setViewEngine({ engine: { handlebars: require('handlebars'), }, - templates: join(__webapp, 'src', 'views'), + templates: join(__dirname, '../../webapp/src/views'), layout: join('layouts', 'main.hbs'), options: { partials: {