Skip to content
Extraits de code Groupes Projets
Valider 7343832f rédigé par Christian Paul's avatar Christian Paul
Parcourir les fichiers

Include test/**/* in the TypeScript project for linting; fix remaining errors

parent 388d3605
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -42,5 +42,16 @@
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/interface-name-prefix": "off"
},
"overrides": [
{
"files": [
"test/**/*"
],
"rules": {
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}
]
}
......@@ -25,7 +25,7 @@ const pgp: pgPromise.IMain = pgPromise({
export class Postgres implements IDatabaseConnector {
public static ParameterizeSql(sql: string): string {
return sql.replace(/\$((\w|\d|_)+)+/g, (k) => {
return sql.replace(/\$((\w|\d|_)+)+/g, (k: string) => {
return `\${${k.substr("$".length)}}`;
});
}
......@@ -35,7 +35,8 @@ export class Postgres implements IDatabaseConnector {
constructor(private connectionString: string) {
}
public Open() {
public Open(): void {
// Hide username:password
const logConnString = this.connectionString.substr(
this.connectionString.indexOf("@") || 0,
......@@ -63,7 +64,7 @@ export class Postgres implements IDatabaseConnector {
public async Run(sql: string, parameters?: ISqlCommandParameters): Promise<void> {
log.silly("Run:", sql);
return this.db.oneOrNone(Postgres.ParameterizeSql(sql), parameters).then(() => {});
await this.db.oneOrNone(Postgres.ParameterizeSql(sql), parameters);
}
public async Close(): Promise<void> {
......@@ -73,6 +74,5 @@ export class Postgres implements IDatabaseConnector {
public async Exec(sql: string): Promise<void> {
log.silly("Exec:", sql);
await this.db.none(sql);
return;
}
}
......@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/* eslint-disable @typescript-eslint/camelcase */
import * as Chai from "chai";
import { DiscordStore, CURRENT_SCHEMA } from "../../src/store";
......
......@@ -240,7 +240,7 @@ class MatrixClientMock extends AppserviceMockBase {
public async uploadContent(data: Buffer, contentType: string, filename: string = "noname") {
this.funcCalled("uploadContent", data, contentType, filename);
return "mxc://" + filename;
return `mxc://${filename}`;
}
public mxcToHttp(mxcUrl: string) {
......
......@@ -13,6 +13,7 @@
"compileOnSave": true,
"include": [
"src/**/*",
"test/**/*",
"tools/**/*",
]
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter