mirror of
https://github.com/zumbiepig/MineXLauncher.git
synced 2025-06-08 09:24:48 +00:00
fix?
This commit is contained in:
parent
85322cfdf7
commit
c6f14eea16
13
build.ts
13
build.ts
@ -4,8 +4,8 @@ import { join } from 'path';
|
||||
import chalk from 'chalk';
|
||||
|
||||
function getFiles(baseDir: string, dir?: string, filesArr?: string[]) {
|
||||
dir = dir || baseDir;
|
||||
filesArr = filesArr || [];
|
||||
dir = dir ?? baseDir;
|
||||
filesArr = filesArr ?? [];
|
||||
const files = readdirSync(dir);
|
||||
for (const file of files) {
|
||||
const name = join(dir, file);
|
||||
@ -18,6 +18,8 @@ function getFiles(baseDir: string, dir?: string, filesArr?: string[]) {
|
||||
return filesArr;
|
||||
}
|
||||
|
||||
console.clear();
|
||||
|
||||
console.log(chalk.cyan('Linting code...\n'));
|
||||
const lintOutput = await $`bunx eslint ./src/`.nothrow().text();
|
||||
if (lintOutput) {
|
||||
@ -25,6 +27,13 @@ if (lintOutput) {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(chalk.cyan('Type-checking code...\n'));
|
||||
const tscOutput = await $`bunx tsc`.nothrow().text();
|
||||
if (tscOutput) {
|
||||
console.error(tscOutput);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
console.log(chalk.cyan('Removing old build artifacts...\n'));
|
||||
await $`rm -rf ./public/resources/scripts/ ./public/assets.json ./public/sw.js ./public/sw-full.js`.quiet();
|
||||
|
||||
|
@ -4,15 +4,24 @@ import tseslint from 'typescript-eslint';
|
||||
export default tseslint.config(
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.strict,
|
||||
...tseslint.configs.stylisticTypeChecked,
|
||||
{
|
||||
languageOptions: {
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
'error', {
|
||||
'error',
|
||||
{
|
||||
'ts-expect-error': false,
|
||||
'ts-nocheck': false,
|
||||
'ts-check': true,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
3
index.ts
3
index.ts
@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import { join } from 'path';
|
||||
import { env } from 'bun';
|
||||
import express, { json, urlencoded } from 'express';
|
||||
@ -14,7 +15,7 @@ import serveStatic from 'serve-static';
|
||||
import { indexRouter } from './routes/index.ts';
|
||||
|
||||
const BASE_DIR = join(import.meta.dir, 'public');
|
||||
const PORT = env.PORT || 3000;
|
||||
const PORT = env.PORT ?? 3000;
|
||||
|
||||
const debugLogger = debug('app:server');
|
||||
const isDev = env.NODE_ENV === 'development';
|
||||
|
@ -29,6 +29,7 @@
|
||||
"@types/compression": "^1.7.5",
|
||||
"@types/debug": "^4.1.12",
|
||||
"@types/errorhandler": "^1.5.3",
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"@types/morgan": "^1.9.9",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/serve-favicon": "^2.5.7",
|
||||
|
@ -1,3 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import { Router } from 'express';
|
||||
const indexRouter = Router();
|
||||
|
||||
|
@ -330,9 +330,8 @@ if (window.location.pathname === '/') {
|
||||
googleAdsPush.text = '(adsbygoogle = window.adsbygoogle || []).push({});';
|
||||
document.body.appendChild(googleAdsPush);
|
||||
|
||||
const adsContainers = document.getElementsByClassName('ads-container');
|
||||
for (let i = 0; i < adsContainers.length; i++) {
|
||||
const adsContainer = adsContainers[i] as HTMLElement;
|
||||
const adsContainers = Array.from(document.getElementsByClassName('ads-container')) as HTMLElement[];
|
||||
for (const adsContainer of adsContainers) {
|
||||
adsContainer.style.display = 'flex';
|
||||
}
|
||||
});
|
||||
|
@ -53,7 +53,7 @@ self.addEventListener('activate', (event) => {
|
||||
self.addEventListener('fetch', (event) => {
|
||||
event.respondWith(
|
||||
caches.match(event.request).then((response) => {
|
||||
return response || fetch(event.request);
|
||||
return response ?? fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
@ -1,12 +1,4 @@
|
||||
{
|
||||
"extends": ["@tsconfig/bun", "@tsconfig/strictest"],
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "public",
|
||||
"moduleDetection": "auto",
|
||||
"allowImportingTsExtensions": false,
|
||||
"noEmit": false,
|
||||
"removeComments": true
|
||||
},
|
||||
"include": ["src"]
|
||||
"exclude": ["node_modules", "public"]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user