Clean up web code errors and make CI enforce them

This commit is contained in:
Keavon Chambers
2024-09-24 01:15:14 -07:00
parent 14de67c5a7
commit 1ee5ffbbe8
18 changed files with 44 additions and 129 deletions

View File

@@ -12,12 +12,6 @@ module.exports = {
ecmaVersion: "latest",
project: "./tsconfig.json",
},
overrides: [
{
extends: ["plugin:@typescript-eslint/disable-type-checked"],
files: [".eslintrc.cjs"],
},
],
ignorePatterns: [
// Ignore generated directories
"node_modules/",
@@ -28,6 +22,12 @@ module.exports = {
"!.*.js",
"!.*.ts",
],
overrides: [
{
extends: ["plugin:@typescript-eslint/disable-type-checked"],
files: ["./*.js", "./*.cjs"],
},
],
rules: {
// Standard ESLint config (for ordinary JS syntax linting)
indent: "off",

View File

@@ -30,7 +30,7 @@ if (isInstallNeeded()) {
// eslint-disable-next-line no-console
console.log("Finished installing npm packages.");
} catch (error) {
} catch (_) {
// eslint-disable-next-line no-console
console.error("Failed to install npm packages. Please run `npm install` from the `/frontend` directory.");
process.exit(1);

View File

@@ -13,8 +13,8 @@
"build-profiling": "npm run wasm:build-profiling && vite build",
"build": "npm run wasm:build-production && vite build",
"---------- UTILITIES ----------": "",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"lint": "eslint . && tsc --noEmit",
"lint-fix": "eslint . --fix && tsc --noEmit",
"---------- INTERNAL ----------": "",
"setup": "node package-installer.js",
"wasm:build-dev": "wasm-pack build ./wasm --dev --target=web",

View File

@@ -12,27 +12,12 @@
"sourceMap": true,
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
"@/*": ["src/*"]
},
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
]
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"*.ts",
"*.js",
"*.cjs"
],
"exclude": [
"node_modules"
],
"include": ["src/**/*.ts", "src/**/*.d.ts", "*.ts", "*.js", "*.cjs"],
"exclude": ["node_modules"],
"ts-node": {
"compilerOptions": {
"module": "commonjs",

View File

@@ -101,6 +101,7 @@
<footer>
<hr />
<nav class="balance-text require-polyfill">
<a href="https://github.com/GraphiteEditor/Graphite" class="link not-uppercase">GitHub</a>
<a href="/license" class="link not-uppercase">License</a>
<a href="/logo" class="link not-uppercase">Logo</a>
<a href="/press" class="link not-uppercase">Press</a>