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

Migrate tslint:disable no-console

parent 5d5e99ca
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -33,6 +33,7 @@
"@typescript-eslint/array-type": "error",
"@typescript-eslint/promise-function-async": "error",
"no-bitwise": "error",
"no-console": "error",
"no-debugger": "error",
"prefer-template": "error",
// Disable these as they were introduced by @typescript-eslint/recommended
......
......@@ -106,7 +106,7 @@ function setupLogging(): void {
async function run(): Promise<void> {
const opts = cliArgs(commandOptions);
if (opts.help) {
/* tslint:disable:no-console */
// eslint-disable-next-line no-console
console.log(usage([
{
content: "The matrix appservice for discord",
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
/* tslint:disable:no-console */
/* eslint-disable no-console */
/**
* Allows you to become an admin for a room the bot is in control of.
*/
......@@ -53,7 +53,7 @@ const optionDefinitions = [
const options = args(optionDefinitions);
if (options.help) {
/* tslint:disable:no-console */
/* eslint-disable no-console */
console.log(usage([
{
content: "A tool to set all the bridged rooms to visible in the directory.",
......@@ -69,14 +69,16 @@ if (options.help) {
const {store, appservice} = ToolsHelper.getToolDependencies(options.config, options.registration);
async function run() {
async function run(): Promise<void> {
try {
await store!.init();
} catch (e) {
log.error(`Failed to load database`, e);
}
let rooms = await store!.roomStore.getEntriesByRemoteRoomData({
/* eslint-disable @typescript-eslint/camelcase */
discord_type: "text",
/* eslint-disable @typescript-eslint/camelcase */
});
rooms = rooms.filter((r) => r.remote && r.remote.get("plumbed") !== true );
log.info(`Got ${rooms.length} rooms to set`);
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
/* tslint:disable:no-bitwise no-console no-var-requires */
/* eslint-disable no-bitwise, no-console */
/**
* Generates a URL you can use to authorize a bot with a guild.
*/
......@@ -45,7 +45,7 @@ const optionDefinitions = [
const options = args(optionDefinitions);
if (options.help) {
/* tslint:disable:no-console */
// eslint-disable-next-line no-console
console.log(usage([
{
content: "A tool to obtain the Discord bot invitation URL.",
......
......@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
/* tslint:disable:no-console */
/* eslint-disable no-console */
/**
* Allows you to become an admin for a room that the bot is in control of.
*/
......@@ -71,7 +71,7 @@ const optionDefinitions = [
const options = args(optionDefinitions);
if (options.help) {
/* tslint:disable:no-console */
/* eslint-disable no-console */
console.log(usage([
{
content: "A tool to give a user a power level in a bot user controlled room.",
......
......@@ -51,7 +51,7 @@ const optionDefinitions = [
const options = args(optionDefinitions);
if (options.help) {
/* tslint:disable:no-console */
/* eslint-disable no-console */
console.log(usage([
{
content: "A tool to fix channels of rooms already bridged " +
......
......@@ -60,7 +60,7 @@ const optionDefinitions = [
const options = args(optionDefinitions);
if (options.help) {
/* tslint:disable:no-console */
/* eslint-disable no-console */
console.log(usage([
{
content: "A tool to fix usernames of ghosts already in " +
......@@ -130,4 +130,4 @@ async function run() {
process.exit(0);
}
run(); // tslint:disable-line no-floating-promises
run(); // eslint-disable no-floating-promises
......@@ -57,7 +57,7 @@ const optionDefinitions = [
const options = args(optionDefinitions);
if (options.help || (options.add && options.remove) || !(options.add || options.remove)) {
/* tslint:disable:no-console */
/* eslint-disable no-console */
console.log(usage([
{
content: "A tool to give a user a power level in a bot user controlled room.",
......
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