Skip to content

Commit

Permalink
Update linting dependencies
Browse files Browse the repository at this point in the history
* Update prettier and eslint and fix minor issues flagged by the newer
  versions.
  • Loading branch information
wshanks committed Jul 22, 2024
1 parent 03db0a4 commit 4758061
Show file tree
Hide file tree
Showing 5 changed files with 492 additions and 645 deletions.
4 changes: 1 addition & 3 deletions addon/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function buildKeyCommand(win, command) {
case "unset":
break;
default:
eval(command); // eslint-disable-line no-eval
eval(command);
break;
}
return false;
Expand Down Expand Up @@ -239,11 +239,9 @@ var tbkeys = class extends ExtensionCommon.ExtensionAPI {
Services.obs.notifyObservers(null, "startupcache-invalidate", null);
}

// eslint-disable-next-line no-unused-vars
getAPI(context) {
return {
tbkeys: {
// eslint-disable-next-line require-await
bindKeys: async function (keyBindings) {
TBKeys.bindKeys(keyBindings);
},
Expand Down
2 changes: 1 addition & 1 deletion addon/options.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>

<html>
<head>
Expand Down
2 changes: 1 addition & 1 deletion addon/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function validateKeys() {
JSON.parse(keysField.value);
}
keysField.setCustomValidity("");
} catch (err) {
} catch {
keysField.setCustomValidity("Invalid JSON");
valid = false;
}
Expand Down
32 changes: 32 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ["**/build", "addon/modules"],
},
...compat.extends("eslint:recommended"),
{
languageOptions: {
globals: {
...globals.browser,
},

ecmaVersion: 12,
sourceType: "module",
},

rules: {},
},
];
Loading

0 comments on commit 4758061

Please sign in to comment.