diff --git a/.github/workflows/lint-action.yml b/.github/workflows/lint-action.yml index 32823417..7fd77d28 100644 --- a/.github/workflows/lint-action.yml +++ b/.github/workflows/lint-action.yml @@ -43,6 +43,6 @@ jobs: with: auto_fix: true eslint: true - eslint_args: '--config eslint.config.ts' + eslint_args: "--config eslint.config.ts --ignore-pattern '**/prettier.config.js'" prettier: true - commit_message: 'style: fix linting issues met ${linter}' \ No newline at end of file + commit_message: 'style: fix linting issues met ${linter}' diff --git a/.gitignore b/.gitignore index d28e7d73..d3905d1f 100644 --- a/.gitignore +++ b/.gitignore @@ -737,4 +737,4 @@ flycheck_*.el # network security /network-security.data - +docs/.venv diff --git a/backend/src/controllers/learning-objects.ts b/backend/src/controllers/learning-objects.ts index a8dfd4e8..a2510631 100644 --- a/backend/src/controllers/learning-objects.ts +++ b/backend/src/controllers/learning-objects.ts @@ -6,11 +6,7 @@ import attachmentService from '../services/learning-objects/attachment-service.j import { BadRequestException } from '../exceptions/bad-request-exception.js'; import { NotFoundException } from '../exceptions/not-found-exception.js'; import { envVars, getEnvVar } from '../util/envVars.js'; -import { - FilteredLearningObject, - LearningObjectIdentifier, - LearningPathIdentifier -} from "@dwengo-1/common/interfaces/learning-content"; +import { FilteredLearningObject, LearningObjectIdentifier, LearningPathIdentifier } from '@dwengo-1/common/interfaces/learning-content'; function getLearningObjectIdentifierFromRequest(req: Request): LearningObjectIdentifier { if (!req.params.hruid) { diff --git a/backend/src/entities/content/learning-object-identifier.ts b/backend/src/entities/content/learning-object-identifier.ts index b7802ddd..09a9c057 100644 --- a/backend/src/entities/content/learning-object-identifier.ts +++ b/backend/src/entities/content/learning-object-identifier.ts @@ -1,4 +1,4 @@ -import { Language } from "@dwengo-1/common/util/language"; +import { Language } from '@dwengo-1/common/util/language'; export class LearningObjectIdentifier { constructor( diff --git a/backend/src/services/learning-objects/dwengo-api-learning-object-provider.ts b/backend/src/services/learning-objects/dwengo-api-learning-object-provider.ts index ffa57814..d67b69ae 100644 --- a/backend/src/services/learning-objects/dwengo-api-learning-object-provider.ts +++ b/backend/src/services/learning-objects/dwengo-api-learning-object-provider.ts @@ -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); }) diff --git a/backend/src/services/learning-objects/learning-object-service.ts b/backend/src/services/learning-objects/learning-object-service.ts index 69004ae1..5a06f0f2 100644 --- a/backend/src/services/learning-objects/learning-object-service.ts +++ b/backend/src/services/learning-objects/learning-object-service.ts @@ -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))) { diff --git a/backend/src/services/questions.ts b/backend/src/services/questions.ts index 355f0110..319061c5 100644 --- a/backend/src/services/questions.ts +++ b/backend/src/services/questions.ts @@ -74,7 +74,7 @@ export async function createQuestion(questionDTO: QuestionDTO): Promise { expect(result.data?.length).toBe(1); // Should include all the nodes, even those pointing to foreign learning objects. - expect([...result.data![0].nodes.map((it) => it.learningobject_hruid)].sort()).toEqual( - example.learningPath.nodes.map((it) => it.learningObjectHruid).sort() + expect([...result.data![0].nodes.map((it) => it.learningobject_hruid)].sort((a, b) => a.localeCompare(b))).toEqual( + example.learningPath.nodes.map((it) => it.learningObjectHruid).sort((a, b) => a.localeCompare(b)) ); }); }); diff --git a/backend/tsconfig.json b/backend/tsconfig.json index 14f53f22..1ddfe1e0 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -3,7 +3,7 @@ "include": ["src/**/*.ts"], "compilerOptions": { "rootDir": "./src", - "outDir": "./dist", + "outDir": "./dist" }, "references": [ { diff --git a/common/package.json b/common/package.json index c549e085..7eef4ded 100644 --- a/common/package.json +++ b/common/package.json @@ -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", diff --git a/common/src/interfaces/learning-content.ts b/common/src/interfaces/learning-content.ts index a8ddc171..02e49648 100644 --- a/common/src/interfaces/learning-content.ts +++ b/common/src/interfaces/learning-content.ts @@ -1,4 +1,4 @@ -import { Language } from "../util/language"; +import { Language } from '../util/language'; export interface Transition { default: boolean; diff --git a/eslint.config.ts b/eslint.config.ts index 831b213f..fb19e5c4 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -16,7 +16,16 @@ export default [ prettierConfig, includeIgnoreFile(gitignorePath), { - ignores: ['**/dist/**', '**/.node_modules/**', '**/coverage/**', '**/.github/**'], + ignores: [ + '**/dist/**', + '**/.node_modules/**', + '**/coverage/**', + '**/.github/**', + '**/prettier.config.js', + 'docs/.venv/**', + 'prettier.config.js', + 'frontend/prettier.config.js', + ], files: ['**/*.ts', '**/*.cts', '**.*.mts'], }, { diff --git a/package-lock.json b/package-lock.json index 79ebf319..27d261cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "dwengo-1-monorepo", + "name": "dwengo-1", "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "dwengo-1-monorepo", + "name": "dwengo-1", "version": "0.1.1", "license": "MIT", "workspaces": [ diff --git a/tsconfig.json b/tsconfig.json index 5e1fd98c..1da18198 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -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. */