From 2c81d9a052d2f34c67e1ffd72c59e369c7a6a859 Mon Sep 17 00:00:00 2001 From: Mehdi Benadel Date: Sat, 25 May 2024 14:39:45 +0200 Subject: [PATCH] lint update --- .editorconfig | 9 +++++++-- client/tsconfig.json | 3 ++- package.json | 3 +++ server/lib/prosody/config/content.ts | 4 ++-- server/tsconfig.json | 4 ++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.editorconfig b/.editorconfig index e8056df5..1f2bacf1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,11 +5,16 @@ root = true [**.{ts,json,js,css}] -quote_type = single end_of_line = lf charset = utf-8 # Please set your autosave delay to 1 second to avoid getting kicked out of the last line at each input trim_trailing_whitespace = true insert_final_newline = true indent_style = space -indent_size = 2 \ No newline at end of file +indent_size = 2 + +[**.{ts,js,css}] +quote_type = single + +[**.json] +quote_type = double \ No newline at end of file diff --git a/client/tsconfig.json b/client/tsconfig.json index a48ab054..9773353a 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -12,8 +12,9 @@ "noImplicitAny": true, // should already be true because of strict:true "noImplicitThis": true, // should already be true because of strict:true "noImplicitReturns": true, + "noImplicitOverride": true, "strictBindCallApply": true, // should already be true because of strict:true - "noUnusedLocals": true, + "noUnusedLocals": false, // works better as a linter error/warning "allowSyntheticDefaultImports": true, // Seems necessary for peertube types to work "isolatedModules": true, // Needed by esbuild https://esbuild.github.io/content-types/#isolated-modules "esModuleInterop": true, // Needed by esbuild https://esbuild.github.io/content-types/#es-module-interop diff --git a/package.json b/package.json index 8476b013..5e6dac5f 100644 --- a/package.json +++ b/package.json @@ -113,8 +113,11 @@ "build:languages": "node ./build-languages.js", "build": "npm-run-all -s clean:light build:languages check:client:tsc -s build:client build:server build:images build:styles build:avatars build:serverconverse build:prosodymodules build:converse build:prosody", "lint": "npm-run-all -s lint:script lint:styles lint:reuse", + "lint:fix": "npm-run-all -s lint:script:fix lint:styles:fix", "lint:script": "npx eslint --ext .js --ext .ts .", + "lint:script:fix": "npx eslint --ext .js --ext .ts . --fix", "lint:styles": "stylelint 'conversejs/**/*.scss' 'assets/styles/**/*.scss'", + "lint:styles:fix": "stylelint 'conversejs/**/*.scss' 'assets/styles/**/*.scss' --fix", "lint:reuse": "reuse lint", "show:npmfiles": "npx npm-packlist", "doc:translate": "bash doc-translate.sh" diff --git a/server/lib/prosody/config/content.ts b/server/lib/prosody/config/content.ts index 1d639a96..5c3fe317 100644 --- a/server/lib/prosody/config/content.ts +++ b/server/lib/prosody/config/content.ts @@ -114,7 +114,7 @@ class ProsodyConfigVirtualHost extends ProsodyConfigBlock { this.name = name } - write (): string { + override write (): string { return `VirtualHost "${this.name}"\n` + super.write() } } @@ -129,7 +129,7 @@ class ProsodyConfigComponent extends ProsodyConfigBlock { this.name = name } - write (): string { + override write (): string { if (this.type !== undefined) { return `Component "${this.name}" "${this.type}"\n` + super.write() } diff --git a/server/tsconfig.json b/server/tsconfig.json index 5872a594..b679eb99 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -8,9 +8,9 @@ "noImplicitAny": true, // should already be true because of strict:true "noImplicitThis": true, // should already be true because of strict:true "noImplicitReturns": true, + "noImplicitOverride": true, "strictBindCallApply": true, // should already be true because of strict:true - "noUnusedLocals": true, - + "noUnusedLocals": false, // works better as a linter error/warning "removeComments": true, "sourceMap": true,