Skip to content

Commit

Permalink
Lint all jsdoc blocks. Add missing docblock placeholders.
Browse files Browse the repository at this point in the history
  • Loading branch information
Neloreck committed Jul 8, 2023
1 parent 44b3dbc commit c987b17
Show file tree
Hide file tree
Showing 294 changed files with 1,508 additions and 385 deletions.
426 changes: 182 additions & 244 deletions .eslintrc.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions cli/build/steps/configs_dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export async function buildDynamicConfigs(parameters: IBuildCommandParameters):
* Get list of LTX transformable descriptors.
*/
async function getLtxConfigs(filters: Array<string> = []): Promise<Array<TFolderReplicationDescriptor>> {
/**
* todo;
*/
function collectLtxConfigs(
acc: Array<TFolderReplicationDescriptor>,
it: TFolderFiles
Expand Down
3 changes: 3 additions & 0 deletions cli/build/steps/configs_statics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export async function buildStaticConfigs(parameters: IBuildCommandParameters): P
* Get list of static configs.
*/
async function getStaticConfigs(filters: Array<string> = []): Promise<Array<TFolderReplicationDescriptor>> {
/**
* todo;
*/
function collectConfigs(
acc: Array<TFolderReplicationDescriptor>,
it: TFolderFiles
Expand Down
3 changes: 0 additions & 3 deletions cli/build/steps/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ interface IBuildMetaParams {

/**
* Step to collect metadata in a single file with timing metrics.
*
* @param meta - build meta information to save
* @param timeTracker - build time tracker with performance metrics
*/
export async function buildMeta({ meta, timeTracker }: IBuildMetaParams): Promise<void> {
log.info(blueBright("Build metadata"));
Expand Down
3 changes: 3 additions & 0 deletions cli/build/steps/translations_dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export async function buildDynamicTranslations(): Promise<void> {
return log.warn("No languages to translate found in config.json file, skip");
}

/**
* todo;
*/
function collectTranslations(
acc: Array<TFolderReplicationDescriptor>,
it: TFolderFiles
Expand Down
3 changes: 3 additions & 0 deletions cli/build/steps/ui_dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ export async function buildDynamicUi(parameters: IBuildCommandParameters): Promi
* Get list of UI config files in engine source files.
*/
async function getUiConfigs(filters: Array<string> = []): Promise<Array<TFolderReplicationDescriptor>> {
/**
* todo;
*/
function collectXmlConfigs(
acc: Array<TFolderReplicationDescriptor>,
it: TFolderFiles
Expand Down
3 changes: 3 additions & 0 deletions cli/build/steps/ui_statics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export async function buildStaticUi(parameters: IBuildCommandParameters): Promis
* Get UI configuration files list.
*/
async function getUiConfigs(filters: Array<string> = []): Promise<Array<TFolderReplicationDescriptor>> {
/**
* todo;
*/
function collectXmlConfigs(
acc: Array<TFolderReplicationDescriptor>,
it: Array<string> | string
Expand Down
3 changes: 3 additions & 0 deletions cli/format/format_ltx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ async function formatLtxFile(file: string): Promise<void> {
* Get list of static configs.
*/
async function getLtxConfigs(filters: Array<string> = []): Promise<Array<string>> {
/**
* todo;
*/
function collectConfigs(acc: Array<string>, it: TFolderFiles): Array<string> {
if (Array.isArray(it)) {
it.forEach((nested) => collectConfigs(acc, nested));
Expand Down
3 changes: 3 additions & 0 deletions cli/parse/parse_externals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export async function parseExternals(): Promise<void> {
* Get list of LTX transformable descriptors.
*/
async function getSourcesList(source: string): Promise<Array<string>> {
/**
* todo;
*/
function collectList(acc: Array<string>, it: TFolderFiles): Array<string> {
if (Array.isArray(it)) {
it.forEach((nested) => collectList(acc, nested));
Expand Down
6 changes: 6 additions & 0 deletions cli/parse/utils/__test__/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ interface IAbstractInterface {
b: string;
}

/**
* todo;
*/
function extern(name: string, cb: (...args: Array<unknown>) => void): void {}

/**
* todo;
*/
function another(name: string, cb: (...args: Array<unknown>) => void): void {}

extern("module.callback_name_one", (a: number, b: string, c: boolean, d: SomeAlias): boolean => true);
Expand Down
6 changes: 6 additions & 0 deletions cli/preview/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ function createFoldersForConfigs(xmlConfigs: Array<TFolderReplicationDescriptor>
});
}

/**
* todo;
*/
async function getUiConfigs(filters: Array<string> = []): Promise<Array<TFolderReplicationDescriptor>> {
/**
* todo;
*/
function collectXmlConfigs(
acc: Array<TFolderReplicationDescriptor>,
it: TFolderFiles
Expand Down
24 changes: 24 additions & 0 deletions cli/preview/utils/generate_preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import { default as jsdom } from "jsdom";

const { style, STATIC_ASSET, GRADIENT_BG_, GENERIC } = generateDomClasses();

/**
*
*/
export function generateHTMLPreviewFromXMLString(content: string): string {
const dom = new jsdom.JSDOM(content);

Expand Down Expand Up @@ -58,10 +61,16 @@ export function generateHTMLPreviewFromXMLString(content: string): string {
return dom.serialize();
}

/**
*
*/
function prepareOther(node: HTMLElement): void {
node.style.border = "solid black 1px";
}

/**
*
*/
function prepareText(node: HTMLElement): void {
node.style.overflow = "hidden";
node.style.width = "100%";
Expand All @@ -74,6 +83,9 @@ function prepareText(node: HTMLElement): void {
}
}

/**
*
*/
function prepareTexture(node: HTMLElement): void {
node.setAttribute("texture_resource", node.textContent);

Expand All @@ -84,15 +96,24 @@ function prepareTexture(node: HTMLElement): void {
node.style.height = "100%";
}

/**
*
*/
function prepareWindow(node: HTMLElement): void {
node.style.position = "absolute";
node.style.background = "rgba(50, 50, 50, 0.05)";
}

/**
*
*/
function prepareStaticAsset(node: HTMLElement): void {
node.className = STATIC_ASSET + " " + GRADIENT_BG_ + Math.floor(Math.random() * 10);
}

/**
*
*/
function generateDomClasses() {
const GENERIC: string = "generic";
const STATIC_ASSET: string = "static-asset";
Expand Down Expand Up @@ -144,6 +165,9 @@ function generateDomClasses() {
};
}

/**
* todo;
*/
function getRandomColor(): string {
return "#" + (((1 << 24) * Math.random()) | 0).toString(16).padStart(6, "0");
}
17 changes: 17 additions & 0 deletions cli/utils/fs/get_diffs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ export interface IDiffs {
deletions: IDiff;
}

/**
* todo;
*/
function getTime(dateOrDateStr: Date | string): number {
return typeof dateOrDateStr === "string" ? Date.parse(dateOrDateStr) : dateOrDateStr.getTime();
}

/**
* todo;
*/
async function ensureDirAccess(directory: string): Promise<void> {
try {
await fsp.access(directory);
Expand All @@ -43,6 +49,11 @@ async function ensureDirAccess(directory: string): Promise<void> {
}
}

/**
* todo;
*
* @yields - files from directory in a recursive way
*/
async function* getFiles(directory: string): AsyncGenerator<string> {
const dirents = await fsp.readdir(directory, { withFileTypes: true });

Expand All @@ -54,6 +65,9 @@ async function* getFiles(directory: string): AsyncGenerator<string> {
}
}

/**
* todo;
*/
async function getFileStats(directory: string, options): Promise<FileStats> {
const dir = path.resolve(directory);

Expand Down Expand Up @@ -85,6 +99,9 @@ async function getFileStats(directory: string, options): Promise<FileStats> {
return fileStats;
}

/**
* todo;
*/
export async function getDiffs(base: FilePathMap, target: FilePathMap, options?: DiffOptions): Promise<IDiffs> {
const { exclusions = [], compareSizes = true } = options || {};
const statsOptions = { exclusions };
Expand Down
3 changes: 3 additions & 0 deletions cli/utils/fs/open_folder_in_explorer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as cp from "child_process";
import * as os from "os";

/**
* todo;
*/
export function openFolderInExplorer(path: string): Promise<void> {
return new Promise((resolve, reject) => {
const osType: string = os.type();
Expand Down
10 changes: 8 additions & 2 deletions cli/utils/fs/read_dir_content_flat_gen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import fsp from "fs/promises";
import path from "path";
import * as fsp from "fs/promises";
import * as path from "path";

/**
* Read folder content with generator.
*
* @param directory - target folder to traverse
* @yields next item in directory
*/
export async function* readFolderGen(directory: string) {
const dirents = await fsp.readdir(directory, { withFileTypes: true });

Expand Down
3 changes: 3 additions & 0 deletions cli/utils/fs/read_last_lines_of_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import { Optional } from "#/utils/types";

const NEW_LINE_CHARACTERS: Array<string> = ["\n"];

/**
* todo;
*/
export async function readLastLinesOfFile(
filePath: string,
maxLineCount: number,
Expand Down
Loading

0 comments on commit c987b17

Please sign in to comment.