Skip to content

Commit

Permalink
Merge pull request #789 from dodona-edu/dependabot/npm_and_yarn/eslin…
Browse files Browse the repository at this point in the history
…t-be7977c65c

Bump the eslint group across 1 directory with 2 updates
  • Loading branch information
jorg-vr authored Jan 24, 2025
2 parents 97a0bf8 + 1821ffe commit 51f1567
Show file tree
Hide file tree
Showing 15 changed files with 270 additions and 315 deletions.
7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import tseslint from "typescript-eslint";
import eslint from "@eslint/js";

export default tseslint.config(
{
ignores: [
"**/webpack.config.js",
"**/tailwind.config.js",
"**/postcss.config.js",
"**/jest.config.js",
"src/Translations.js",
"scripts/ValidateTranslations.js",
"**/dist",
],
},
eslint.configs.recommended,
{
rules: {
"arrow-parens": ["error", "as-needed"],
"comma-dangle": ["error", {
arrays: "only-multiline",
objects: "only-multiline",
imports: "only-multiline",
exports: "only-multiline",
functions: "never",
}],
indent: ["error", 4, { SwitchCase: 1 }],
"no-invalid-this": "warn",
"no-param-reassign": ["error", { props: false }],
"object-curly-spacing": ["error", "always"],
quotes: ["error", "double"],
"space-before-function-paren": ["error", {
anonymous: "always",
named: "never",
asyncArrow: "always",
}],
},
},
tseslint.configs.recommended,
{
rules: {
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-function-return-type": ["error", { allowExpressions: true }],
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
},
}
);
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
"private": false,
"homepage": ".",
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.18.0",
"@types/escape-html": "^1.0.3",
"@types/i18n-js": "^3.8.9",
"@types/jest": "^29.5.10",
"@types/serviceworker": "^0.0.89",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"autoprefixer": "^10.4.16",
"css-loader": "^7.1.2",
"eslint": "^8.52.0",
"eslint-config-google": "^0.14.0",
"eslint-plugin-jest": "^27.6.0",
"eslint": "^9.17.0",
"globals": "^15.14.0",
"i18n-extract": "^0.6.7",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
Expand All @@ -28,6 +27,7 @@
"ts-jest-mock-import-meta": "^1.1.0",
"ts-loader": "^9.5.0",
"typescript": "^5.2.2",
"typescript-eslint": "^8.21.0",
"webpack": "^5.89.0",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.0.2",
Expand Down Expand Up @@ -62,7 +62,7 @@
"build:app": "bash scripts/build.sh development",
"build:library": "bash scripts/build_library.sh",
"test": "jest",
"lint": "eslint --ext '.js' --ext '.ts' src",
"lint": "eslint src",
"validate:translations": "node scripts/ValidateTranslations.js"
},
"description": "Scratchpad for multiple programming languages in the browser.",
Expand Down
2 changes: 1 addition & 1 deletion src/CodeRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export class CodeRunner extends Renderable<CodeRunnerRenderOptions> {

protected override _render(options: CodeRunnerRenderOptions): HTMLElement {
appendClasses(options.statusPanelOptions,
// eslint-disable-next-line max-len
"_tw-border-solid _tw-border-gray-200 _tw-border-b-2 dark:_tw-border-dark-mode-content");
const rendered = renderWithOptions(options.statusPanelOptions, `
<div style="position: relative">
Expand Down
2 changes: 1 addition & 1 deletion src/OutputManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export class OutputManager extends Renderable {
}
errorHTML += "<div class=\"_tw-text-red-500 _tw-text-bold\">";
const infoQM = renderInCircle("?", escapeHTML(errorObject.info),
// eslint-disable-next-line max-len
"_tw-text-blue-500 _tw-border-blue-500 dark:_tw-text-dark-mode-blue dark:_tw-border-dark-mode-blue");
const tracebackEM = renderInCircle("!",
escapeHTML(errorObject.traceback), "_tw-text-red-500 _tw-border-red-500");
Expand Down
6 changes: 3 additions & 3 deletions src/Papyros.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable max-len */
import {
DARK_MODE_TOGGLE_ID,
EDITOR_WRAPPER_ID,
Expand Down Expand Up @@ -145,7 +145,7 @@ export class Papyros extends Renderable<PapyrosRenderOptions> {
} else {
try {
await this.codeRunner.start();
} catch (error: any) {
} catch {
if (confirm(t("Papyros.launch_error"))) {
return this.launch();
}
Expand Down Expand Up @@ -217,7 +217,7 @@ export class Papyros extends Renderable<PapyrosRenderOptions> {
try {
await navigator.serviceWorker.register(serviceWorkerUrl, { scope: "/" });
BackendManager.channel = makeChannel({ serviceWorker: this.config.channelOptions })!;
} catch (error: any) {
} catch {
return false;
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/Translations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable max-len */
// Empty strings are considered missing by i18n-extract
// Therefore the ready-key is an explicit space now, which is still invisible

Expand Down Expand Up @@ -184,7 +184,7 @@ const DUTCH_PHRASES = {
// @codemirror/lint
"Diagnostics": "Problemen",
"No diagnostics": "Geen problemen",
}
}

const TRANSLATIONS = {
en: { "Papyros": ENGLISH_TRANSLATION },
Expand Down
1 change: 0 additions & 1 deletion src/editor/CodeEditor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable valid-jsdoc */
import { ProgrammingLanguage } from "../ProgrammingLanguage";
import { t } from "../util/Util";
import {
Expand Down
2 changes: 1 addition & 1 deletion src/editor/DarkTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const darkTheme = EditorView.theme({
},

".cm-cursor, .cm-dropCursor": { borderLeftColor: cursor },
// eslint-disable-next-line max-len
"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: selection },

".cm-panels": { backgroundColor: darkBackground, color: ivory },
Expand Down
2 changes: 1 addition & 1 deletion src/input/InteractiveInputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class InteractiveInputHandler extends UserInputHandler {
protected override _render(options: RenderOptions): void {
const buttonHTML = renderButton({
id: SEND_INPUT_BTN_ID,
// eslint-disable-next-line max-len
classNames: "btn-secondary",
buttonText: t("Papyros.enter")
});
Expand Down
2 changes: 1 addition & 1 deletion src/input/UserInputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export abstract class UserInputHandler extends Renderable<InputManagerRenderOpti
// Focusing is a rendering operation
// Subclasses can execute code after this operation, skipping the rendering
// Using setTimeout ensures rendering will be done when the main thread has time
// eslint-disable-next-line max-len
// More info here: https://stackoverflow.com/questions/1096436/document-getelementbyidid-focus-is-not-working-for-firefox-or-chrome
setTimeout(() => this.focus(), 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/Rendering.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable max-len */
import { getElement } from "./Util";
import escapeHTML from "escape-html";

Expand Down
2 changes: 1 addition & 1 deletion src/util/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export function cleanCurrentUrl(endingSlash = false): string {
* @param {HTMLElement} el The element to focus
*/
export function placeCaretAtEnd(el: HTMLElement): void {
// eslint-disable-next-line max-len
// Source: https://stackoverflow.com/questions/4233265/contenteditable-set-caret-at-the-end-of-the-text-cross-browser
el.focus();
if (typeof window.getSelection !== "undefined" &&
Expand Down
File renamed without changes.
Loading

0 comments on commit 51f1567

Please sign in to comment.