style: fix linting issues met Prettier

This commit is contained in:
Lint Action 2025-04-02 18:32:29 +00:00
parent 7e46ce9c5f
commit 0bdee56dc3
10 changed files with 19 additions and 21 deletions

View file

@ -1,4 +1,4 @@
import { Language } from "@dwengo-1/common/util/language";
import { Language } from '@dwengo-1/common/util/language';
export class LearningObjectIdentifier {
constructor(

View file

@ -69,7 +69,7 @@ async function fetchLearningObjects(learningPathId: LearningPathIdentifier, full
nodes.map(async (node) => {
const learningObjectId: LearningObjectIdentifier = {
hruid: node.learningobject_hruid,
language: learningPathId.language
language: learningPathId.language,
};
return dwengoApiLearningObjectProvider.getLearningObjectById(learningObjectId);
})

View file

@ -2,11 +2,7 @@ import dwengoApiLearningObjectProvider from './dwengo-api-learning-object-provid
import { LearningObjectProvider } from './learning-object-provider.js';
import { envVars, getEnvVar } from '../../util/envVars.js';
import databaseLearningObjectProvider from './database-learning-object-provider.js';
import {
FilteredLearningObject,
LearningObjectIdentifier,
LearningPathIdentifier,
} from '@dwengo-1/common/interfaces/learning-content';
import { FilteredLearningObject, LearningObjectIdentifier, LearningPathIdentifier } from '@dwengo-1/common/interfaces/learning-content';
function getProvider(id: LearningObjectIdentifier): LearningObjectProvider {
if (id.hruid.startsWith(getEnvVar(envVars.UserContentPrefix))) {

View file

@ -78,7 +78,7 @@ export async function createQuestion(questionDTO: QuestionDTO): Promise<Question
const loId: LearningObjectIdentifier = {
...questionDTO.learningObjectIdentifier,
version: questionDTO.learningObjectIdentifier.version ?? 1,
}
};
try {
await questionRepository.createQuestion({
@ -104,8 +104,8 @@ export async function deleteQuestion(questionId: QuestionId): Promise<QuestionDT
const loId: LearningObjectIdentifier = {
...questionId.learningObjectIdentifier,
version: questionId.learningObjectIdentifier.version ?? 1
}
version: questionId.learningObjectIdentifier.version ?? 1,
};
try {
await questionRepository.removeQuestionByLearningObjectAndSequenceNumber(loId, questionId.sequenceNumber);

View file

@ -1,4 +1,4 @@
import { LearningObjectIdentifier } from "@dwengo-1/common/interfaces/learning-content";
import { LearningObjectIdentifier } from '@dwengo-1/common/interfaces/learning-content';
export function isValidHttpUrl(url: string): boolean {
try {

View file

@ -3,7 +3,7 @@
"include": ["src/**/*.ts"],
"compilerOptions": {
"rootDir": "./src",
"outDir": "./dist",
"outDir": "./dist"
},
"references": [
{

View file

@ -4,7 +4,9 @@
"description": "Common types and utilities for Dwengo-1",
"private": true,
"type": "module",
"files": [ "./dist" ],
"files": [
"./dist"
],
"scripts": {
"build": "tsc --build",
"clean": "tsc --build --clean",

View file

@ -1,4 +1,4 @@
import { Language } from "../util/language";
import { Language } from '../util/language';
export interface Transition {
default: boolean;

View file

@ -24,7 +24,7 @@ export default [
'**/prettier.config.js',
'docs/.venv/**',
'prettier.config.js',
'frontend/prettier.config.js'
'frontend/prettier.config.js',
],
files: ['**/*.ts', '**/*.cts', '**.*.mts'],
},
@ -214,6 +214,6 @@ export default [
'no-multi-assign': 'error',
'no-nested-ternary': 'error',
'no-object-constructor': 'error',
}
},
},
];

View file

@ -4,7 +4,7 @@
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
"composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
"composite": true /* Enable constraints that allow a TypeScript project to be used with project references. */,
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
@ -59,10 +59,10 @@
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declarationMap": true, /* Create sourcemaps for d.ts files. */
"declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
"declarationMap": true /* Create sourcemaps for d.ts files. */,
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */