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

chore: upgrade to eslint 9.x #625

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

407 changes: 0 additions & 407 deletions .eslintrc.cjs

This file was deleted.

8 changes: 4 additions & 4 deletions assets/js/showdown-extensions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ const extensions = {
type: "lang",
regex: /`([Cc]olor).(\w+)\(\)`/g,
replace: ($0, className, funcName) => {
return `<a href="@@webRoot/api/#Color${className === "Color"? "." : "#"}${funcName}">${$0}</a>`;
}
return `<a href="@@webRoot/api/#Color${className === "Color" ? "." : "#"}${funcName}">${$0}</a>`;
},
},
"callouts": {
type: "lang",
regex: /^\s*(Tip|Warning|Note):\s+/gm,
replace: ($0, className, funcName) => {
return `<p class="${className.toLowerCase()}" markdown="1">`;
}
}
},
},
};

export default extensions;
430 changes: 430 additions & 0 deletions eslint.config.js

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions notebook/color-notebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ export default class Notebook {
this.code = this.pre.textContent;

let value = this.code.trim().replace(/\s+$/m, "");
let error;

if (codes.get(pre) === value) {
// We've already evaluated this
Expand All @@ -202,7 +203,7 @@ export default class Notebook {
}
catch (e) {
// Syntax error
var error = e;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there may have been a reason this used var. let me know if we cant make this change

error = e;
}

if (!error) {
Expand All @@ -211,7 +212,7 @@ export default class Notebook {
}
catch (e) {
// Syntax error in the rewritten code
var error = e;
error = e;
}
}

Expand Down Expand Up @@ -370,6 +371,7 @@ export function walk (pre, callback, filter) {
let walker = document.createTreeWalker(pre, filter);
let node;

// eslint-disable-next-line no-cond-assign
while (node = walker.nextNode()) {
let ret = callback(node);

Expand All @@ -390,6 +392,7 @@ function getNodeAt (offset, container, {type} = {}) {
let node, sum = 0;
let walk = document.createTreeWalker(container, NodeFilter.SHOW_TEXT);

// eslint-disable-next-line no-cond-assign
while (node = walk.nextNode()) {
sum += node.data.length;

Expand Down
Loading