Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

DEV: Update eslint config #352

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.cjs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import I18n from "I18n";
import { activateEncrypt } from "discourse/plugins/discourse-encrypt/lib/discourse";

Expand Down Expand Up @@ -30,7 +30,7 @@ export default class ActivateEncrypt extends Component {

this.encryptWidgetStore.reset();
this.args.closeModal();
} catch (e) {
} catch {
this.error = I18n.t("encrypt.preferences.paper_key_invalid");
} finally {
this.inProgress = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class DecryptAllModal extends Component {
try {
await decrypter.run();
this.successCount++;
} catch (e) {
} catch {
this.errorCount++;
}
this.doneCount++;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import { dependentKeyCompat } from "@ember/object/compat";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import GeneratePaperKey from "./generate-paper-key";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { deleteDb } from "discourse/plugins/discourse-encrypt/lib/database";
Expand Down Expand Up @@ -44,7 +44,6 @@ export default class ResetKeyPair extends Component {
this.inProgress = true;

try {
// eslint-disable-next-line no-restricted-globals
await Promise.all([
ajax("/encrypt/reset", {
type: "POST",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import { service } from "@ember/service";
import { ajax } from "discourse/lib/ajax";
import { extractError } from "discourse/lib/ajax-error";
import { saveDbIdentity } from "discourse/plugins/discourse-encrypt/lib/database";
Expand Down Expand Up @@ -37,7 +37,6 @@ export default class RotateKeyPair extends Component {
this.error = null;

try {
// eslint-disable-next-line no-restricted-globals
const [data, oldIdentity, newIdentity] = await Promise.all([
ajax("/encrypt/rotate"),
getIdentity(),
Expand All @@ -55,7 +54,7 @@ export default class RotateKeyPair extends Component {
}

const topicKeys = {};
// eslint-disable-next-line no-restricted-globals

await Promise.all(
Object.entries(data.topic_keys).map(async ([topicId, topicKey]) => {
const key = await importKey(topicKey, oldIdentity.encryptPrivate);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-arrow-function-computed-properties */
import { computed, defineProperty } from "@ember/object";
import I18n from "I18n";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable ember/no-arrow-function-computed-properties */
import { getOwner } from "@ember/application";
import { action, computed, defineProperty } from "@ember/object";
import { popupAjaxError } from "discourse/lib/ajax-error";
Expand Down
8 changes: 4 additions & 4 deletions assets/javascripts/discourse/initializers/decrypt-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ export default {
let key;
try {
key = await getTopicKey(topicId);
} catch (error) {
} catch {
state.encryptState = "error";
state.error = I18n.t("encrypt.invalid_topic_key");
this.scheduleRerender();
Expand All @@ -418,7 +418,7 @@ export default {
let plaintext;
try {
plaintext = await decrypt(key, ciphertext);
} catch (error) {
} catch {
state.encryptState = "error";
state.error = I18n.t("encrypt.invalid_ciphertext");
this.scheduleRerender();
Expand Down Expand Up @@ -452,7 +452,7 @@ export default {
expected: true,
});
}
} catch (error) {
} catch {
verified[attrs.id] = [
{
attr: "signature",
Expand All @@ -471,7 +471,7 @@ export default {
state.encryptState = "decrypted";
state.plaintext = cooked.toString();
this.scheduleRerender();
} catch (error) {
} catch {
const store = getOwner(this).lookup("service:encrypt-widget-store");
store.add(this);

Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import DiscourseRecommended from "@discourse/lint-configs/eslint";

export default [...DiscourseRecommended];
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "1.3.10",
"@discourse/lint-configs": "2.0.1",
"ember-template-lint": "6.0.0",
"eslint": "8.57.1",
"prettier": "2.8.8",
"@babel/plugin-proposal-decorators": "^7.25.7"
"eslint": "9.14.0",
"prettier": "2.8.8"
},
"engines": {
"node": ">= 18",
Expand Down
Loading