Skip to content

Commit 2b607a8

Browse files
committed
Update eslint to v9
1 parent e612b97 commit 2b607a8

28 files changed

+1504
-1452
lines changed

.eslintrc.cjs

Lines changed: 0 additions & 1005 deletions
This file was deleted.

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(DIST)
162162
GO_DIRS := build cmd models modules routers services tests
163163
WEB_DIRS := web_src/js web_src/css
164164

165-
ESLINT_FILES := web_src/js tools *.ts *.cjs tests/e2e
165+
ESLINT_FILES := web_src/js tools *.ts tests/e2e
166166
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
167167
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.md *.yml *.yaml *.toml)) $(filter-out tools/misspellings.csv, $(wildcard tools/*))
168168
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini
@@ -346,12 +346,12 @@ lint-backend-fix: lint-go-fix lint-go-gitea-vet lint-editorconfig ## lint backen
346346

347347
.PHONY: lint-js
348348
lint-js: node_modules ## lint js files
349-
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
349+
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 $(ESLINT_FILES)
350350
$(NODE_VARS) pnpm exec vue-tsc
351351

352352
.PHONY: lint-js-fix
353353
lint-js-fix: node_modules ## lint js files and fix issues
354-
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
354+
$(NODE_VARS) pnpm exec eslint --color --max-warnings=0 $(ESLINT_FILES) --fix
355355
$(NODE_VARS) pnpm exec vue-tsc
356356

357357
.PHONY: lint-css

eslint.config.ts

Lines changed: 1032 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@
6767
},
6868
"devDependencies": {
6969
"@eslint-community/eslint-plugin-eslint-comments": "4.5.0",
70+
"@eslint/compat": "1.3.2",
7071
"@playwright/test": "1.55.0",
7172
"@stoplight/spectral-cli": "6.15.0",
72-
"@stylistic/eslint-plugin-js": "3.1.0",
73+
"@stylistic/eslint-plugin": "5.3.1",
7374
"@stylistic/stylelint-plugin": "4.0.0",
7475
"@types/codemirror": "5.60.16",
7576
"@types/dropzone": "5.7.9",
@@ -82,24 +83,24 @@
8283
"@types/throttle-debounce": "5.0.2",
8384
"@types/tinycolor2": "1.4.6",
8485
"@types/toastify-js": "1.12.4",
85-
"@typescript-eslint/eslint-plugin": "8.43.0",
8686
"@typescript-eslint/parser": "8.43.0",
8787
"@vitejs/plugin-vue": "6.0.1",
8888
"@vitest/eslint-plugin": "1.3.9",
89-
"eslint": "8.57.0",
89+
"eslint": "9.35.0",
9090
"eslint-import-resolver-typescript": "4.4.4",
91-
"eslint-plugin-array-func": "4.0.0",
92-
"eslint-plugin-github": "5.0.2",
91+
"eslint-plugin-array-func": "5.0.2",
92+
"eslint-plugin-github": "6.0.0",
9393
"eslint-plugin-import-x": "4.16.1",
9494
"eslint-plugin-no-jquery": "3.1.1",
95-
"eslint-plugin-no-use-extend-native": "0.5.0",
95+
"eslint-plugin-no-use-extend-native": "0.7.2",
9696
"eslint-plugin-playwright": "2.2.2",
9797
"eslint-plugin-regexp": "2.10.0",
9898
"eslint-plugin-sonarjs": "3.0.5",
99-
"eslint-plugin-unicorn": "56.0.1",
99+
"eslint-plugin-unicorn": "61.0.2",
100100
"eslint-plugin-vue": "10.4.0",
101101
"eslint-plugin-vue-scoped-css": "2.12.0",
102102
"eslint-plugin-wc": "3.0.1",
103+
"globals": "16.4.0",
103104
"happy-dom": "18.0.1",
104105
"markdownlint-cli": "0.45.0",
105106
"material-icon-theme": "5.27.0",
@@ -112,6 +113,7 @@
112113
"stylelint-value-no-unknown-custom-properties": "6.0.1",
113114
"svgo": "4.0.0",
114115
"type-fest": "4.41.0",
116+
"typescript-eslint": "8.43.0",
115117
"updates": "16.7.0",
116118
"vite-string-plugin": "1.4.6",
117119
"vitest": "3.2.4",

pnpm-lock.yaml

Lines changed: 396 additions & 396 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

types.d.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
declare module '@techknowlogick/license-checker-webpack-plugin' {
22
const plugin: any;
3-
export = plugin
3+
export = plugin;
4+
}
5+
declare module 'eslint-plugin-no-use-extend-native' {
6+
import type {Eslint} from 'eslint';
7+
const plugin: Eslint.Plugin;
8+
export = plugin;
9+
}
10+
declare module 'eslint-plugin-array-func' {
11+
import type {Eslint} from 'eslint';
12+
const plugin: Eslint.Plugin;
13+
export = plugin;
14+
}
15+
declare module 'eslint-plugin-github' {
16+
import type {Eslint} from 'eslint';
17+
const plugin: Eslint.Plugin;
18+
export = plugin;
19+
}
20+
declare module 'eslint-plugin-no-jquery' {
21+
import type {Eslint} from 'eslint';
22+
const plugin: Eslint.Plugin;
23+
export = plugin;
24+
}
25+
declare module '@eslint-community/eslint-plugin-eslint-comments' {
26+
import type {Eslint} from 'eslint';
27+
const plugin: Eslint.Plugin;
28+
export = plugin;
29+
}
30+
declare module '@eslint/compat' {
31+
const value: any;
32+
export const fixupPluginRules = value;
433
}

updates.config.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ export default {
55
'@mcaptcha/vanilla-glue', // breaking changes in rc versions need to be handled
66
'@stylistic/eslint-plugin-js', // need to migrate to eslint 9
77
'cropperjs', // need to migrate to v2 but v2 is not compatible with v1
8-
'eslint', // need to migrate to eslint flat config first
9-
'eslint-plugin-array-func', // need to migrate to eslint flat config first
10-
'eslint-plugin-github', // need to migrate to eslint 9 - https://github.com/github/eslint-plugin-github/issues/585
11-
'eslint-plugin-no-use-extend-native', // need to migrate to eslint flat config first
12-
'eslint-plugin-unicorn', // need to migrate to eslint 9
13-
'eslint-plugin-vitest', // need to migrate to eslint flat config first
148
'tailwindcss', // need to migrate
159
],
1610
} satisfies Config;

web_src/js/components/RepoBranchTagSelector.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default defineComponent({
153153
return -1;
154154
},
155155
getActiveItem() {
156-
const el = this.$refs[`listItem${this.activeItemIndex}`]; // eslint-disable-line no-jquery/variable-pattern
156+
const el = this.$refs[`listItem${this.activeItemIndex}`];
157157
// @ts-expect-error - el is unknown type
158158
return (el && el.length) ? el[0] : null;
159159
},

web_src/js/components/ViewFileTreeStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {pathEscapeSegments} from '../utils/url.ts';
44
import {createElementFromHTML} from '../utils/dom.ts';
55
import {html} from '../utils/html.ts';
66

7-
export function createViewFileTreeStore(props: { repoLink: string, treePath: string, currentRefNameSubURL: string}) {
7+
export function createViewFileTreeStore(props: {repoLink: string, treePath: string, currentRefNameSubURL: string}) {
88
const store = reactive({
99
rootFiles: [],
1010
selectedItem: props.treePath,

web_src/js/features/codeeditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type EditorConfig = {
1919
trim_trailing_whitespace?: boolean,
2020
insert_final_newline?: boolean,
2121
root?: boolean,
22-
}
22+
};
2323

2424
const languagesByFilename: Record<string, string> = {};
2525
const languagesByExt: Record<string, string> = {};

0 commit comments

Comments
 (0)