From 4c27c09b4d533b14c8f48fe5ee4c36a58feefaff Mon Sep 17 00:00:00 2001 From: XLBilly Date: Fri, 28 Nov 2025 21:16:43 +0800 Subject: [PATCH] Update eslint config (#9457) * Update eslint config * Switch off max classes restriction * Enforce tab indent, semicolon * Warn when there exists unused vars * Update change note * Update change note * Update change note --- .../5.4.0/leilei332-update-eslint-config.tid | 12 ++++++++++++ eslint.config.mjs | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 editions/tw5.com/tiddlers/releasenotes/5.4.0/leilei332-update-eslint-config.tid diff --git a/editions/tw5.com/tiddlers/releasenotes/5.4.0/leilei332-update-eslint-config.tid b/editions/tw5.com/tiddlers/releasenotes/5.4.0/leilei332-update-eslint-config.tid new file mode 100644 index 000000000..86eb60b05 --- /dev/null +++ b/editions/tw5.com/tiddlers/releasenotes/5.4.0/leilei332-update-eslint-config.tid @@ -0,0 +1,12 @@ +title: $:/changenotes/5.4.0/#9457 +description: Update eslint configuration +release: 5.4.0 +tags: $:/tags/ChangeNote +change-type: enhancement +change-category: developer +github-links: https://github.com/TiddlyWiki/TiddlyWiki5/pull/9457 +github-contributors: Leilei332 + +* Enforce tab indentation, semicolon +* Switch off `max-classes-per-file` +* Show warning for unused variables diff --git a/eslint.config.mjs b/eslint.config.mjs index b6e942851..2b0db2296 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -100,7 +100,7 @@ js.configs.recommended, "id-length": "off", "id-match": "error", "@stylistic/implicit-arrow-linebreak": "error", - "@stylistic/indent": "off", + "@stylistic/indent": ["error", "tab"], "init-declarations": "off", "@stylistic/jsx-quotes": "error", "@stylistic/key-spacing": "off", @@ -121,7 +121,7 @@ js.configs.recommended, "@stylistic/lines-around-comment": "off", "@stylistic/lines-around-directive": "off", "@stylistic/lines-between-class-members": "error", - "max-classes-per-file": "error", + "max-classes-per-file": "off", "max-depth": "off", "@stylistic/max-len": "off", "max-lines": "off", @@ -266,7 +266,7 @@ js.configs.recommended, "require-jsdoc": "off", "require-unicode-regexp": "off", "@stylistic/rest-spread-spacing": "error", - "@stylistic/semi": "off", + "@stylistic/semi": ["error", "always"], "@stylistic/semi-spacing": "off", "@stylistic/semi-style": "off", "sort-imports": "error", @@ -293,7 +293,7 @@ js.configs.recommended, yoda: "off", // temporary rules "no-useless-escape": "off", - "no-unused-vars": "off", + "no-unused-vars": "warn", "no-empty": "off", "@stylistic/no-extra-semi": "off", "no-redeclare": "off",