Skip to content

Commit

Permalink
chore: bump eslint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
northword committed May 15, 2024
1 parent 3e28d58 commit cc31172
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 57 deletions.
2 changes: 2 additions & 0 deletions addon/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-undef */

/**
* Most of this code is from Zotero team's official Make It Red example[1]
* or the Zotero 7 documentation[2].
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 @@
// @ts-check Let TS check this config file

import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
{
ignores: ["build/**", "dist/**", "node_modules/**", "scripts/"],
},
{
extends: [eslint.configs.recommended, ...tseslint.configs.recommended],
rules: {
"@typescript-eslint/ban-ts-comment": [
"warn",
{
"ts-expect-error": "allow-with-description",
"ts-ignore": "allow-with-description",
"ts-nocheck": "allow-with-description",
"ts-check": "allow-with-description",
},
],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": [
"off",
{
ignoreRestArgs: true,
},
],
"@typescript-eslint/no-non-null-assertion": "off",
},
},
);
61 changes: 5 additions & 56 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scripts": {
"start": "zotero-plugin serve",
"build": "tsc --noEmit && zotero-plugin build",
"lint": "prettier --write . && eslint . --ext .ts --fix",
"lint": "prettier --write . && eslint . --fix",
"release": "zotero-plugin release",
"test": "echo \"Error: no test specified\" && exit 1",
"update-deps": "npm update --save"
Expand All @@ -31,65 +31,14 @@
"zotero-plugin-toolkit": "^2.3.31"
},
"devDependencies": {
"@eslint/js": "^9.2.0",
"@types/node": "^20.12.12",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.2.0",
"prettier": "^3.2.5",
"typescript": "^5.4.5",
"typescript-eslint": "^7.9.0",
"zotero-plugin-scaffold": "^0.0.22",
"zotero-types": "^1.3.24"
},
"eslintConfig": {
"env": {
"browser": true,
"es2021": true
},
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/ban-ts-comment": [
"warn",
{
"ts-expect-error": "allow-with-description",
"ts-ignore": "allow-with-description",
"ts-nocheck": "allow-with-description",
"ts-check": "allow-with-description"
}
],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": [
"off",
{
"ignoreRestArgs": true
}
],
"@typescript-eslint/no-non-null-assertion": "off"
},
"ignorePatterns": [
"**/.vscode/**",
"**/build/**",
"**/logs/**",
"**/dist/**",
"**/node_modules/**",
"**/scripts/**",
"**/*.js",
"**/*.bak"
]
"zotero-types": "^2.0.0"
},
"prettier": {
"printWidth": 80,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function onMainWindowLoad(win: Window): Promise<void> {
// Create ztoolkit for every window
addon.data.ztoolkit = createZToolkit();

// @ts-ignore
// @ts-ignore This is a moz feature
window.MozXULElement.insertFTLIfNeeded(`${config.addonRef}-mainWindow.ftl`);

const popupWin = new ztoolkit.ProgressWindow(config.addonName, {
Expand Down

0 comments on commit cc31172

Please sign in to comment.