Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove extra eslintrc and fix style #35

Merged
merged 1 commit into from
Aug 8, 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
28 changes: 21 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,33 @@

module.exports = {
"env": {
"es2022": true,
"webextensions": true
es2022: true,
webextensions: true
},
"globals": {
messenger: true
},
"root": true,
"plugins": ["mozilla"],
"extends": ["plugin:mozilla/recommended"],
"extends": ["plugin:mozilla/recommended"],

rules: {
"rules": {
// experiment files are not ES modules, so we can't use static import
"mozilla/use-static-import": "off",

// We are still experimenting, console messages are ok for now
"no-console": "off"
"no-console": "off",

// Some other rules that don't seem to be in the recommended set
"no-trailing-spaces": "error",
"eol-last": "error",
"quote-props": ["error", "consistent-as-needed", { keywords: true }],
"quotes": ["error", "double", { avoidEscape: true }],
"padded-blocks": ["error", "never"],
"indent": [2, 2, { SwitchCase: 1 }],
},

overrides: [
"overrides": [
{
files: [".eslintrc.js"],
env: {
Expand All @@ -26,10 +37,13 @@ module.exports = {
},
},
{
files: ["*/experiments/*/parent/*.js"],
files: ["*/experiments/*/parent/*.js", "*/experiments/*/child/*.js"],
globals: {
global: true,
Services: true,
},
rules: {
"no-unused-vars": ["error", { argsIgnorePattern: "^_|context" }]
}
}
]
Expand Down
5 changes: 2 additions & 3 deletions NotificationBox/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ messenger.NotificationBox.onButtonClicked.addListener((windowId, notificationId,
if (["btn-keep"].includes(buttonId)) {
console.log("Box will not close, as long as one listener returns {close:false}.");
return { close: false };
}
return { close: true };

}
return { close: true };
});

// Defining another onButtonClicked listener
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* global ExtensionCommon, Services */

// Tested in Thunderbird 128. Does not work for older versions of Thunderbird.
Expand Down
Loading