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
61105d0618
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.
This commit is contained in:
silverwind
2024-07-07 17:32:30 +02:00
committed by GitHub
parent 5115c278ff
commit 5791a73e75
168 changed files with 562 additions and 386 deletions

View File

@ -1,4 +1,4 @@
import {toAbsoluteLocaleDate} from './absolute-date.js';
import {toAbsoluteLocaleDate} from './absolute-date.ts';
test('toAbsoluteLocaleDate', () => {
expect(toAbsoluteLocaleDate('2024-03-15', 'en-US', {

View File

@ -1,5 +0,0 @@
import './polyfills.js';
import '@github/relative-time-element';
import './origin-url.js';
import './overflow-menu.js';
import './absolute-date.js';

View File

@ -0,0 +1,5 @@
import './polyfills.ts';
import '@github/relative-time-element';
import './origin-url.ts';
import './overflow-menu.ts';
import './absolute-date.ts';

View File

@ -1,4 +1,4 @@
import {toOriginUrl} from './origin-url.js';
import {toOriginUrl} from './origin-url.ts';
test('toOriginUrl', () => {
const oldLocation = window.location;

View File

@ -1,6 +1,6 @@
import {throttle} from 'throttle-debounce';
import {createTippy} from '../modules/tippy.js';
import {isDocumentFragmentOrElementNode} from '../utils/dom.js';
import {createTippy} from '../modules/tippy.ts';
import {isDocumentFragmentOrElementNode} from '../utils/dom.ts';
import octiconKebabHorizontal from '../../../public/assets/img/svg/octicon-kebab-horizontal.svg';
window.customElements.define('overflow-menu', class extends HTMLElement {