Skip to content

Commit e9e3676

Browse files
committed
Fixed linting errors
1 parent eb62239 commit e9e3676

8 files changed

Lines changed: 18 additions & 16 deletions

File tree

src/cli/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import { CellScanningOrder, ScanningSelectionMethod } from '../types/aac';
1313
import { defaultFileAdapter, extname } from '../utils/io';
1414
import { readFileSync } from 'node:fs';
1515

16-
const { pathExists, isDirectory, join, readTextFromInput, basename, writeTextToPath } =
17-
defaultFileAdapter;
16+
const { pathExists, isDirectory, join, basename, writeTextToPath } = defaultFileAdapter;
1817

1918
// Helper function to detect format from file/folder path
2019
async function detectFormat(filePath: string): Promise<string> {
@@ -242,7 +241,7 @@ program
242241
const filteringOptions = parseFilteringOptions(options);
243242

244243
// Auto-detect input format
245-
const inputFormat = (await detectFormat(input));
244+
const inputFormat = await detectFormat(input);
246245
const inputProcessor = getProcessor(inputFormat, filteringOptions);
247246

248247
// Load the tree (handle both files and folders)

src/processors/astericsGridProcessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,8 +1740,8 @@ class AstericsGridProcessor extends BaseProcessor {
17401740
await this.addAudioToElement(
17411741
targetFilePath,
17421742
elementId,
1743-
audioInfo.audioData,
1744-
audioInfo.metadata
1743+
audioInfo.audioData as Buffer,
1744+
audioInfo.metadata as string
17451745
);
17461746
} catch (error) {
17471747
// Failed to add audio to element - continue with others

src/processors/dotProcessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class DotProcessor extends BaseProcessor {
237237

238238
async saveFromTree(tree: AACTree, _outputPath: string): Promise<void> {
239239
const { writeTextToPath } = this.options.fileAdapter;
240-
240+
241241
let dotContent = `digraph "${tree.metadata?.name || 'AACBoard'}" {\n`;
242242

243243
// Helper to escape DOT string

src/processors/excelProcessor.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ export class ExcelProcessor extends BaseProcessor {
2323
* @returns Array of all text content found in the Excel file
2424
*/
2525
async extractTexts(_filePathOrBuffer: ProcessorInput): Promise<string[]> {
26-
2726
console.warn('ExcelProcessor.extractTexts is not implemented yet.');
28-
return [];
27+
return Promise.resolve([]);
2928
}
3029

3130
/**
@@ -37,7 +36,7 @@ export class ExcelProcessor extends BaseProcessor {
3736
console.warn('ExcelProcessor.loadIntoTree is not implemented yet.');
3837
const tree = new AACTree();
3938
tree.metadata.format = 'excel';
40-
return tree;
39+
return Promise.resolve(tree);
4140
}
4241

4342
/**

src/processors/obfsetProcessor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,15 @@ export class ObfsetProcessor extends BaseProcessor {
210210
_translations: Map<string, string>,
211211
_outputPath: string
212212
): Promise<Uint8Array> {
213+
await Promise.resolve();
213214
throw new Error('processTexts is not supported for .obfset currently');
214215
}
215216

216217
/**
217218
* Save tree structure back to file
218219
*/
219220
async saveFromTree(_tree: AACTree, _outputPath: string): Promise<void> {
221+
await Promise.resolve();
220222
throw new Error('saveFromTree is not supported for .obfset currently');
221223
}
222224

src/processors/opmlProcessor.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class OpmlProcessor extends BaseProcessor {
8989

9090
async extractTexts(filePathOrBuffer: ProcessorInput): Promise<string[]> {
9191
const { readTextFromInput } = this.options.fileAdapter;
92-
92+
9393
const content = await readTextFromInput(filePathOrBuffer);
9494

9595
const parser = new XMLParser({ ignoreAttributes: false });
@@ -127,7 +127,7 @@ class OpmlProcessor extends BaseProcessor {
127127

128128
async loadIntoTree(filePathOrBuffer: ProcessorInput): Promise<AACTree> {
129129
const { readBinaryFromInput, readTextFromInput } = this.options.fileAdapter;
130-
130+
131131
const filename =
132132
typeof filePathOrBuffer === 'string' ? getBasename(filePathOrBuffer) : 'upload.opml';
133133
const buffer = await readBinaryFromInput(filePathOrBuffer);
@@ -221,7 +221,7 @@ class OpmlProcessor extends BaseProcessor {
221221
outputPath: string
222222
): Promise<Uint8Array> {
223223
const { writeBinaryToPath, readTextFromInput } = this.options.fileAdapter;
224-
224+
225225
const content = await readTextFromInput(filePathOrBuffer);
226226

227227
let translatedContent = content;
@@ -245,7 +245,7 @@ class OpmlProcessor extends BaseProcessor {
245245

246246
async saveFromTree(tree: AACTree, outputPath: string): Promise<void> {
247247
const { writeTextToPath } = this.options.fileAdapter;
248-
248+
249249
// Helper to recursively build outline nodes with cycle detection
250250
function buildOutline(page: AACPage, visited: Set<string> = new Set()): OpmlOutline {
251251
// Prevent infinite recursion by tracking visited pages

src/processors/snapProcessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,7 @@ class SnapProcessor extends BaseProcessor {
13251325
const metadataJson = metadata ? JSON.stringify({ FileName: metadata }) : null;
13261326
updateButton.run(audioId, metadataJson, buttonId);
13271327

1328-
return audioId;
1328+
return Promise.resolve(audioId);
13291329
} finally {
13301330
db.close();
13311331
}

src/utils/io.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { F_OK } from 'node:constants';
2-
31
export type ProcessorInput = string | Buffer | ArrayBuffer | Uint8Array;
42

53
export type BinaryOutput = Buffer | Uint8Array;
@@ -185,10 +183,12 @@ async function readTextFromInput(
185183

186184
async function writeBinaryToPath(outputPath: string, data: BinaryOutput): Promise<void> {
187185
getFs().writeFileSync(outputPath, data);
186+
await Promise.resolve();
188187
}
189188

190189
async function writeTextToPath(outputPath: string, text: string): Promise<void> {
191190
getFs().writeFileSync(outputPath, text, 'utf8');
191+
await Promise.resolve();
192192
}
193193

194194
async function pathExists(path: string): Promise<boolean> {
@@ -205,6 +205,7 @@ async function getFileSize(path: string): Promise<number> {
205205

206206
async function mkDir(path: string, options?: { recursive?: boolean }): Promise<void> {
207207
getFs().mkdirSync(path, options);
208+
await Promise.resolve();
208209
}
209210

210211
async function listDir(path: string): Promise<string[]> {
@@ -216,6 +217,7 @@ async function removePath(
216217
options?: { recursive?: boolean; force?: boolean }
217218
): Promise<void> {
218219
getFs().rmSync(path, options);
220+
await Promise.resolve();
219221
}
220222

221223
async function mkTempDir(prefix: string): Promise<string> {

0 commit comments

Comments
 (0)