fix(server): linting issues
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
26573e5a2b
commit
7726223698
4 changed files with 37 additions and 15 deletions
|
@ -16,7 +16,6 @@ module.exports = {
|
||||||
'ignoreDestructuring': false,
|
'ignoreDestructuring': false,
|
||||||
'ignoreImports': false,
|
'ignoreImports': false,
|
||||||
}],
|
}],
|
||||||
// 'capitalized-comments': ['error', 'always'],
|
|
||||||
'comma-dangle': ['error', 'always-multiline'],
|
'comma-dangle': ['error', 'always-multiline'],
|
||||||
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
||||||
'curly': ['error', 'all'],
|
'curly': ['error', 'all'],
|
||||||
|
@ -49,14 +48,14 @@ module.exports = {
|
||||||
'ignoreCase': false,
|
'ignoreCase': false,
|
||||||
'ignoreDeclarationSort': false,
|
'ignoreDeclarationSort': false,
|
||||||
'ignoreMemberSort': false,
|
'ignoreMemberSort': false,
|
||||||
'memberSyntaxSortOrder': ['none', 'all', 'multiple', 'single']
|
'memberSyntaxSortOrder': ['none', 'all', 'multiple', 'single'],
|
||||||
}],
|
}],
|
||||||
'sort-vars': ['error', { 'ignoreCase': true }],
|
'sort-vars': ['error', { 'ignoreCase': true }],
|
||||||
'space-before-blocks': ['error', 'always'],
|
'space-before-blocks': ['error', 'always'],
|
||||||
'space-before-function-paren': ['error', {
|
'space-before-function-paren': ['error', {
|
||||||
'anonymous': 'always',
|
'anonymous': 'always',
|
||||||
'named': 'never',
|
'named': 'never',
|
||||||
'asyncArrow': 'always'
|
'asyncArrow': 'always',
|
||||||
}],
|
}],
|
||||||
'space-in-parens': ['error', 'never'],
|
'space-in-parens': ['error', 'never'],
|
||||||
'spaced-comment': ['error', 'always'],
|
'spaced-comment': ['error', 'always'],
|
||||||
|
@ -76,14 +75,37 @@ module.exports = {
|
||||||
'plugin:@typescript-eslint/recommended',
|
'plugin:@typescript-eslint/recommended',
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
// '@typescript-eslint/array-type': ['error', {
|
'@typescript-eslint/naming-convention': [
|
||||||
// 'default': 'array',
|
'error',
|
||||||
// 'readonly': 'array-simple',
|
{
|
||||||
// }],
|
'selector': 'default',
|
||||||
'@typescript-eslint/interface-name-prefix': ['error', 'always'],
|
'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 }],
|
'@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 }],
|
'@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }],
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
|
@ -7,7 +7,7 @@ export class AppController {
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
@Render('index.hbs')
|
@Render('index.hbs')
|
||||||
async getIndex(): Promise<object> {
|
async getIndex(): Promise<Record<string, unknown>> {
|
||||||
const channels = await this.teamspeakService.getPopulatedChannelList();
|
const channels = await this.teamspeakService.getPopulatedChannelList();
|
||||||
return { title: 'Cliffbreak.de TS-Viewer', channels };
|
return { title: 'Cliffbreak.de TS-Viewer', channels };
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,9 @@ import { TeamSpeakClient } from 'node-ts';
|
||||||
|
|
||||||
const env = process.env;
|
const env = process.env;
|
||||||
|
|
||||||
|
/* eslint-disable camelcase */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* 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
|
// Disable specific ESLint rules because node-ts has no typings
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TeamspeakService {
|
export class TeamspeakService {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { NestFactory } from '@nestjs/core';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
const env = process.env;
|
const env = process.env;
|
||||||
const __webapp = join(__dirname, '..', '..', 'webapp');
|
|
||||||
|
|
||||||
|
|
||||||
async function bootstrap(): Promise<void> {
|
async function bootstrap(): Promise<void> {
|
||||||
|
@ -15,14 +14,14 @@ async function bootstrap(): Promise<void> {
|
||||||
);
|
);
|
||||||
|
|
||||||
app.useStaticAssets({
|
app.useStaticAssets({
|
||||||
root: join(__webapp, 'assets'),
|
root: join(__dirname, '../../webapp/assets'),
|
||||||
prefix: '/assets/',
|
prefix: '/assets/',
|
||||||
});
|
});
|
||||||
app.setViewEngine({
|
app.setViewEngine({
|
||||||
engine: {
|
engine: {
|
||||||
handlebars: require('handlebars'),
|
handlebars: require('handlebars'),
|
||||||
},
|
},
|
||||||
templates: join(__webapp, 'src', 'views'),
|
templates: join(__dirname, '../../webapp/src/views'),
|
||||||
layout: join('layouts', 'main.hbs'),
|
layout: join('layouts', 'main.hbs'),
|
||||||
options: {
|
options: {
|
||||||
partials: {
|
partials: {
|
||||||
|
|
Loading…
Reference in a new issue