diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 7df9ee9..a6b4f0f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -4,10 +4,8 @@ module.exports = { plugins: ["@typescript-eslint", "prettier"], extends: [ "eslint:recommended", - // disabled due to https://github.com/typescript-eslint/typescript-eslint/issues/8804 - // "plugin:@typescript-eslint/recommended", - // disabled due to https://github.com/typescript-eslint/typescript-eslint/issues/8804 - // "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", "plugin:prettier/recommended", ], parserOptions: { @@ -15,17 +13,20 @@ module.exports = { ecmaFeatures: { modules: true, }, - // disabled due to https://github.com/typescript-eslint/typescript-eslint/issues/8804 - //project: ["./tsconfig.json", "./tsconfig-back.json"], + project: "./tsconfig-back.json", }, rules: { "@typescript-eslint/no-unused-vars": [2, { varsIgnorePattern: "TempstreamJSX" }], - "no-unused-vars": [2, { varsIgnorePattern: "TempstreamJSX" }], + "no-unused-vars": 0, "@typescript-eslint/require-await": 0, /* "jsdoc/require-description": 2, */ "no-await-in-loop": 2, "@typescript-eslint/consistent-type-assertions": [1, { assertionStyle: "never" }], "no-console": [1, { allow: ["error"] }], + "@typescript-eslint/consistent-type-imports": [ + 2, + { disallowTypeAnnotations: false }, + ], }, ignorePatterns: ["dist/*", "public/dist/*", "coverage/*", "webhint/*"], settings: { jsdoc: { mode: "typescript" } }, @@ -42,8 +43,11 @@ module.exports = { }, }, { - files: ["*.stimulus.ts", "src/front/*.ts"], + files: ["*.stimulus.ts", "src/front/*.ts", "src/front/**/*.ts"], env: { browser: true }, + parserOptions: { + project: "./tsconfig-front.json", + }, }, ], }; diff --git a/package-lock.json b/package-lock.json index 6156863..af4ff28 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@types/leaflet": "^1.9.8", "get-port": "^7.0.0", "js-convert-case": "^4.2.0", - "koa-responsive-image-router": "^0.2.23", + "koa-responsive-image-router": "^0.2.24", "locreq": "^3.0.0", "multiple-scripts-tmux": "^1.0.4", "nodemon": "^3.0.1", @@ -5592,9 +5592,9 @@ } }, "node_modules/koa-responsive-image-router": { - "version": "0.2.23", - "resolved": "https://registry.npmjs.org/koa-responsive-image-router/-/koa-responsive-image-router-0.2.23.tgz", - "integrity": "sha512-Zf7tBKx6c4BMcCE9/ubk5c+zzHB3hvrVFafH3F75Arfu2VjAvFcuwfSjWOWbfgkD5Fu69og603sxTUeJ2Jfbvw==", + "version": "0.2.24", + "resolved": "https://registry.npmjs.org/koa-responsive-image-router/-/koa-responsive-image-router-0.2.24.tgz", + "integrity": "sha512-dHKBCu+hQ+v/60iyxy0qBJ4GlbF0h0RDj+qwiGSPxnexMDtGVidgOMp+pPAryeJ4A6vUJwzSm0DhExrqWFe3hw==", "dependencies": { "@koa/router": "^10.0.0", "@sealcode/ts-predicates": "^0.5.3", diff --git a/package.json b/package.json index 9e08d1e..11ac030 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@types/leaflet": "^1.9.8", "get-port": "^7.0.0", "js-convert-case": "^4.2.0", - "koa-responsive-image-router": "^0.2.23", + "koa-responsive-image-router": "^0.2.24", "locreq": "^3.0.0", "multiple-scripts-tmux": "^1.0.4", "nodemon": "^3.0.1", diff --git a/src/back/app.ts b/src/back/app.ts index 11632ec..8bfd6d2 100644 --- a/src/back/app.ts +++ b/src/back/app.ts @@ -1,5 +1,6 @@ import _locreq from "locreq"; -import { App, LoggerMailer, SMTPMailer, Context as SealiousContext } from "sealious"; +import type { Context as SealiousContext } from "sealious"; +import { App, LoggerMailer, SMTPMailer } from "sealious"; import type { LoggerLevel } from "sealious/@types/src/app/logger.js"; import { collections } from "./collections/collections.js"; import { diff --git a/src/back/collections/password-reset-intents.test.ts b/src/back/collections/password-reset-intents.test.ts index 2cb2a25..cced86f 100644 --- a/src/back/collections/password-reset-intents.test.ts +++ b/src/back/collections/password-reset-intents.test.ts @@ -1,6 +1,6 @@ import axios from "axios"; import assert from "assert"; -import TheApp from "../app.js"; +import type TheApp from "../app.js"; import { withProdApp } from "../test_utils/with-prod-app.js"; import { LONG_TEST_TIMEOUT } from "../test_utils/webhint.js"; diff --git a/src/back/collections/password-reset-intents.ts b/src/back/collections/password-reset-intents.ts index 65b4b06..2a93292 100644 --- a/src/back/collections/password-reset-intents.ts +++ b/src/back/collections/password-reset-intents.ts @@ -1,4 +1,5 @@ -import { App, Collection, CollectionItem, Context, FieldTypes, Policies } from "sealious"; +import type { App, CollectionItem, Context } from "sealious"; +import { Collection, FieldTypes, Policies } from "sealious"; import assert from "assert"; import PasswordResetTemplate from "../email-templates/password-reset.js"; import TheApp from "../app.js"; diff --git a/src/back/collections/user-roles.ts b/src/back/collections/user-roles.ts index e88c9be..61a513e 100644 --- a/src/back/collections/user-roles.ts +++ b/src/back/collections/user-roles.ts @@ -1,4 +1,5 @@ -import { App, Collection, FieldTypes, Policies, Policy } from "sealious"; +import type { App, Policy } from "sealious"; +import { Collection, FieldTypes, Policies } from "sealious"; import { Roles } from "../policy-types/roles.js"; export default class UserRoles extends Collection { diff --git a/src/back/collections/users.ts b/src/back/collections/users.ts index cf6b630..a9be885 100644 --- a/src/back/collections/users.ts +++ b/src/back/collections/users.ts @@ -1,4 +1,5 @@ -import { App, Collections, Context, FieldTypes, Policies } from "sealious"; +import type { Context } from "sealious"; +import { App, Collections, FieldTypes, Policies } from "sealious"; import assert from "assert"; import TheApp from "../app.js"; import ADMIN_CREDENTIALS from "../default-admin-credentials.js"; diff --git a/src/back/email-templates/password-reset.ts b/src/back/email-templates/password-reset.ts index bd6421e..61aacb3 100644 --- a/src/back/email-templates/password-reset.ts +++ b/src/back/email-templates/password-reset.ts @@ -1,5 +1,5 @@ import { EmailTemplates, Errors } from "sealious"; -import TheApp from "../app.js"; +import type TheApp from "../app.js"; export default async function PasswordResetTemplate( app: TheApp, diff --git a/src/back/email-templates/registration-intent.ts b/src/back/email-templates/registration-intent.ts index bb4875f..8f9a42e 100644 --- a/src/back/email-templates/registration-intent.ts +++ b/src/back/email-templates/registration-intent.ts @@ -1,4 +1,5 @@ -import { App, EmailTemplates } from "sealious"; +import type { App } from "sealious"; +import { EmailTemplates } from "sealious"; export default async function RegistrationIntentTemplate( app: App, diff --git a/src/back/html.ts b/src/back/html.ts index a6d548b..1c82468 100644 --- a/src/back/html.ts +++ b/src/back/html.ts @@ -1,6 +1,7 @@ -import { FlatTemplatable, Templatable, tempstream } from "tempstream"; -import { Readable } from "stream"; -import { BaseContext } from "koa"; +import type { FlatTemplatable, Templatable } from "tempstream"; +import { tempstream } from "tempstream"; +import type { Readable } from "stream"; +import type { BaseContext } from "koa"; import { toKebabCase } from "js-convert-case"; import { DEFAULT_HTML_LANG } from "./config.js"; import { default_navbar } from "./routes/common/navbar.js"; diff --git a/src/back/jdd-components/autoscrolling-images/autoscrolling-images.jdd.tsx b/src/back/jdd-components/autoscrolling-images/autoscrolling-images.jdd.tsx index bce8bef..02e85f5 100644 --- a/src/back/jdd-components/autoscrolling-images/autoscrolling-images.jdd.tsx +++ b/src/back/jdd-components/autoscrolling-images/autoscrolling-images.jdd.tsx @@ -1,12 +1,12 @@ -import arrow from "./autoscrolling-images-arrow.svg"; - -import { FlatTemplatable, TempstreamJSX } from "tempstream"; -import { - Component, - ComponentArguments, +import type { FlatTemplatable } from "tempstream"; +import { TempstreamJSX } from "tempstream"; +import type { ExtractStructuredComponentArgumentsValues, JDDContext, } from "@sealcode/jdd"; +import { Component, ComponentArguments } from "@sealcode/jdd"; + +import arrow from "./autoscrolling-images-arrow.svg"; const component_arguments = { title: new ComponentArguments.ShortText(), @@ -35,7 +35,7 @@ export class AutoscrollingImages extends Component { { render_image }: JDDContext ): FlatTemplatable { const imageNumberPerPage = parseInt(imagesPerPage); - let parsedImagesArray = []; + const parsedImagesArray = []; for (let i = 0; i < images.length; i += imageNumberPerPage) { parsedImagesArray.push(images.slice(i, i + imageNumberPerPage)); @@ -149,7 +149,7 @@ export class AutoscrollingImages extends Component {
- {parsedImagesArray.map((pageIndex) => ( + {parsedImagesArray.map((_, pageIndex) => (