frontend: Add linting for ts code

This commit is contained in:
Tom 2023-07-13 13:51:18 +02:00
parent ddb4bb3546
commit 16fa721048
18 changed files with 2299 additions and 469 deletions

View file

@ -1,15 +1,15 @@
// setup highlighting
import "~/src/lib/highlight"
import '~/src/lib/highlight'
// setup remote actions
import setup from "~/src/lib/remote"
setup();
import setup from '~/src/lib/remote'
// include the user styles!
import "../User/index.ts"
import "../User/index.css"
import '../User/index.ts'
import '../User/index.css'
// highlight everything
import "highlight.js/styles/default.css"
import highlightJs from "highlight.js"
highlightJs.highlightAll();
import 'highlight.js/styles/default.css'
import highlightJs from 'highlight.js'
setup()
highlightJs.highlightAll()

View file

@ -1,24 +1,23 @@
import "../Admin/index.ts"
import "../Admin/index.css"
import '../Admin/index.ts'
import '../Admin/index.css'
import { Provision } from "~/src/lib/remote/api"
import { Provision } from '~/src/lib/remote/api'
const provision = document.getElementById("provision") as HTMLFormElement;
const slug = document.getElementById("slug") as HTMLInputElement;
const php = document.getElementById("php") as HTMLSelectElement;
const opcacheDevelopment = document.getElementById("opcacheDevelopment") as HTMLInputElement;
const provision = document.getElementById('provision') as HTMLFormElement
const slug = document.getElementById('slug') as HTMLInputElement
const php = document.getElementById('php') as HTMLSelectElement
const opcacheDevelopment = document.getElementById('opcacheDevelopment') as HTMLInputElement
// add an event handler to open the modal form!
provision.addEventListener('submit', (evt) => {
evt.preventDefault();
evt.preventDefault()
Provision({ Slug: slug.value, System: { PHP: php.value, OpCacheDevelopment: opcacheDevelopment.checked } })
.then(slug => {
location.href = "/admin/instance/" + slug;
})
.catch((e) => {console.error(e); location.reload()});
Provision({ Slug: slug.value, System: { PHP: php.value, OpCacheDevelopment: opcacheDevelopment.checked } })
.then(slug => {
location.href = '/admin/instance/' + slug
})
.catch((e) => { console.error(e); location.reload() })
})
// enable the form!
provision.querySelector('fieldset')?.removeAttribute('disabled');
provision.querySelector('fieldset')?.removeAttribute('disabled')

View file

@ -1,24 +1,23 @@
import "../Admin/index.ts"
import "../Admin/index.css"
import '../Admin/index.ts'
import '../Admin/index.css'
import { Rebuild } from "~/src/lib/remote/api"
import { Rebuild } from '~/src/lib/remote/api'
const slug = document.getElementById("slug") as HTMLInputElement
const provision = document.getElementById("provision") as HTMLFormElement;
const php = document.getElementById("php") as HTMLSelectElement;
const opcacheDevelopment = document.getElementById("opcacheDevelopment") as HTMLInputElement;
const slug = document.getElementById('slug') as HTMLInputElement
const provision = document.getElementById('provision') as HTMLFormElement
const php = document.getElementById('php') as HTMLSelectElement
const opcacheDevelopment = document.getElementById('opcacheDevelopment') as HTMLInputElement
// add an event handler to open the modal form!
provision.addEventListener('submit', (evt) => {
evt.preventDefault();
evt.preventDefault()
Rebuild(slug.value, { PHP: php.value, OpCacheDevelopment: opcacheDevelopment.checked })
.then(slug => {
location.href = "/admin/instance/" + slug;
})
.catch((e) => {console.error(e); location.reload()});
Rebuild(slug.value, { PHP: php.value, OpCacheDevelopment: opcacheDevelopment.checked })
.then(slug => {
location.href = '/admin/instance/' + slug
})
.catch((e) => { console.error(e); location.reload() })
})
// enable the form!
provision.querySelector('fieldset')?.removeAttribute('disabled');
provision.querySelector('fieldset')?.removeAttribute('disabled')

View file

@ -1,2 +1,2 @@
import "~/src/lib/copy"
import "~/src/lib/reveal"
import '~/src/lib/copy'
import '~/src/lib/reveal'