Skip to content

Commit 5791a73

Browse files
authoredJul 7, 2024
Convert frontend code to typescript (#31559)
None of the frontend js/ts files was touched besides these two commands (edit: no longer true, I touched one file in 61105d0 because of a deprecation that was not showing before the rename). `tsc` currently reports 778 errors, so I have disabled it in CI as planned. Everything appears to work fine.
1 parent 5115c27 commit 5791a73

File tree

168 files changed

+563
-387
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+563
-387
lines changed
 

‎.eslintrc.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ overrides:
5858
worker: true
5959
rules:
6060
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, status, statusbar, stop, toolbar, top]
61-
- files: ["*.config.*"]
61+
- files: ["*.config.*", "**/*.d.ts"]
6262
rules:
6363
i/no-unused-modules: [0]
64-
- files: ["**/*.test.*", "web_src/js/test/setup.js"]
64+
- files: ["**/*.test.*", "web_src/js/test/setup.ts"]
6565
env:
6666
vitest-globals/env: true
6767
rules:
@@ -114,7 +114,7 @@ overrides:
114114
vitest/valid-describe-callback: [2]
115115
vitest/valid-expect: [2]
116116
vitest/valid-title: [2]
117-
- files: ["web_src/js/modules/fetch.js", "web_src/js/standalone/**/*"]
117+
- files: ["web_src/js/modules/fetch.ts", "web_src/js/standalone/**/*"]
118118
rules:
119119
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
120120
- files: ["**/*.vue"]
@@ -467,7 +467,7 @@ rules:
467467
no-dupe-else-if: [2]
468468
no-dupe-keys: [2]
469469
no-duplicate-case: [2]
470-
no-duplicate-imports: [2]
470+
no-duplicate-imports: [0]
471471
no-else-return: [2]
472472
no-empty-character-class: [2]
473473
no-empty-function: [0]
@@ -619,7 +619,7 @@ rules:
619619
no-restricted-exports: [0]
620620
no-restricted-globals: [2, addEventListener, blur, close, closed, confirm, defaultStatus, defaultstatus, error, event, external, find, focus, frameElement, frames, history, innerHeight, innerWidth, isFinite, isNaN, length, location, locationbar, menubar, moveBy, moveTo, name, onblur, onerror, onfocus, onload, onresize, onunload, open, opener, opera, outerHeight, outerWidth, pageXOffset, pageYOffset, parent, print, removeEventListener, resizeBy, resizeTo, screen, screenLeft, screenTop, screenX, screenY, scroll, scrollbars, scrollBy, scrollTo, scrollX, scrollY, self, status, statusbar, stop, toolbar, top, __dirname, __filename]
621621
no-restricted-imports: [0]
622-
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.js instead"}]
622+
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression, {selector: "CallExpression[callee.name='fetch']", message: "use modules/fetch.ts instead"}]
623623
no-return-assign: [0]
624624
no-script-url: [2]
625625
no-self-assign: [2, {props: true}]

‎Makefile

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

147-
ESLINT_FILES := web_src/js tools *.js tests/e2e
147+
ESLINT_FILES := web_src/js tools *.js *.ts tests/e2e
148148
STYLELINT_FILES := web_src/css web_src/js/components/*.vue
149149
SPELLCHECK_FILES := $(GO_DIRS) $(WEB_DIRS) docs/content templates options/locale/locale_en-US.ini .github $(filter-out CHANGELOG.md, $(wildcard *.go *.js *.md *.yml *.yaml *.toml))
150150
EDITORCONFIG_FILES := templates .github/workflows options/locale/locale_en-US.ini
@@ -376,12 +376,12 @@ lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
376376
.PHONY: lint-js
377377
lint-js: node_modules
378378
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES)
379-
npx tsc
379+
# npx tsc
380380

381381
.PHONY: lint-js-fix
382382
lint-js-fix: node_modules
383383
npx eslint --color --max-warnings=0 --ext js,ts,vue $(ESLINT_FILES) --fix
384-
npx tsc
384+
# npx tsc
385385

386386
.PHONY: lint-css
387387
lint-css: node_modules

0 commit comments

Comments
 (0)