Skip to content

Commit 6b7a7d2

Browse files
committed
fixing prettier with eslint
1 parent db46cb6 commit 6b7a7d2

183 files changed

Lines changed: 10619 additions & 13761 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@
8282
"parserOptions": {
8383
"project": "./tsconfig.test.json"
8484
},
85-
"extends": [
86-
"plugin:@typescript-eslint/recommended",
87-
"plugin:prettier/recommended"
88-
],
85+
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
8986
"rules": {
9087
"@typescript-eslint/explicit-function-return-type": "off",
9188
"@typescript-eslint/no-explicit-any": "off",

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"endOfLine": "auto"
2+
"endOfLine": "auto",
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"printWidth": 100
36
}

CHANGELOG.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ processor.saveFromTree(tree, output);
2727
// After (v3.x)
2828
const tree: AACTree = await processor.loadIntoTree(file);
2929
const texts: string[] = await processor.extractTexts(file);
30-
const result: Uint8Array = await processor.processTexts(
31-
file,
32-
translations,
33-
output,
34-
);
30+
const result: Uint8Array = await processor.processTexts(file, translations, output);
3531
await processor.saveFromTree(tree, output);
3632
```
3733

@@ -43,8 +39,7 @@ const symbols: ButtonForTranslation[] = processor.extractSymbolsForLLM(file);
4339
processor.processLLMTranslations(file, translations, output);
4440

4541
// After
46-
const symbols: ButtonForTranslation[] =
47-
await processor.extractSymbolsForLLM(file);
42+
const symbols: ButtonForTranslation[] = await processor.extractSymbolsForLLM(file);
4843
await processor.processLLMTranslations(file, translations, output);
4944
```
5045

@@ -108,7 +103,7 @@ async function processMultipleFiles(files: string[]) {
108103
const processor = getProcessor(file);
109104
const tree = await processor.loadIntoTree(file);
110105
return tree;
111-
}),
106+
})
112107
);
113108
return results;
114109
}
@@ -321,34 +316,34 @@ npm install aac-processors@2.x
321316

322317
```javascript
323318
// Old (CommonJS)
324-
const { DotProcessor } = require("aac-processors/dist/processors");
319+
const { DotProcessor } = require('aac-processors/dist/processors');
325320

326321
// New (ES Modules + TypeScript)
327-
import { DotProcessor, getProcessor } from "aac-processors";
322+
import { DotProcessor, getProcessor } from 'aac-processors';
328323
```
329324

330325
### API Changes
331326

332327
```typescript
333328
// Old
334329
const processor = new DotProcessor();
335-
const tree = processor.loadIntoTree("file.dot");
330+
const tree = processor.loadIntoTree('file.dot');
336331

337332
// New (same API, but with TypeScript support)
338333
const processor = new DotProcessor();
339-
const tree: AACTree = processor.loadIntoTree("file.dot");
334+
const tree: AACTree = processor.loadIntoTree('file.dot');
340335

341336
// New factory pattern
342-
const processor = getProcessor("file.dot"); // Auto-detects format
337+
const processor = getProcessor('file.dot'); // Auto-detects format
343338
```
344339

345340
### New Translation Workflow
346341

347342
```typescript
348343
// New in 2.x
349-
const texts = processor.extractTexts("file.dot");
350-
const translations = new Map([["Hello", "Hola"]]);
351-
const result = processor.processTexts("file.dot", translations, "output.dot");
344+
const texts = processor.extractTexts('file.dot');
345+
const translations = new Map([['Hello', 'Hola']]);
346+
const result = processor.processTexts('file.dot', translations, 'output.dot');
352347
```
353348

354349
For detailed migration assistance, see the [Migration Guide](docs/MIGRATION.md).

README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ Full feature set, including filesystem access, SQLite-backed formats, and
1818
ZIP/encrypted formats.
1919

2020
```ts
21-
import { getProcessor, SnapProcessor } from "@willwade/aac-processors";
21+
import { getProcessor, SnapProcessor } from '@willwade/aac-processors';
2222

23-
const processor = getProcessor("board.sps");
24-
const tree = await processor.loadIntoTree("board.sps");
23+
const processor = getProcessor('board.sps');
24+
const tree = await processor.loadIntoTree('board.sps');
2525

2626
const snap = new SnapProcessor();
27-
const texts = await snap.extractTexts("board.sps");
27+
const texts = await snap.extractTexts('board.sps');
2828
```
2929

3030
### Browser
@@ -38,10 +38,7 @@ and either include `<script src="sql-wasm.js"></script>` in your HTML, or
3838
`window.initSqlJs = require('sql.js');` in your app.
3939

4040
```ts
41-
import {
42-
configureSqlJs,
43-
SnapProcessor,
44-
} from "@willwade/aac-processors/browser";
41+
import { configureSqlJs, SnapProcessor } from '@willwade/aac-processors/browser';
4542

4643
configureSqlJs({
4744
locateFile: (file) => new URL(`./${file}`, import.meta.url).toString(),
@@ -52,7 +49,7 @@ const tree = await snap.loadIntoTree(snapUint8Array);
5249
```
5350

5451
```ts
55-
import { GridsetProcessor } from "@willwade/aac-processors/browser";
52+
import { GridsetProcessor } from '@willwade/aac-processors/browser';
5653

5754
const processor = new GridsetProcessor();
5855
const tree = await processor.loadIntoTree(gridsetUint8Array);
@@ -75,17 +72,17 @@ const tree = await processor.loadIntoTree(gridsetUint8Array);
7572
All processors implement `processTexts()` to get all strings eg
7673

7774
```ts
78-
import { DotProcessor } from "@willwade/aac-processors";
75+
import { DotProcessor } from '@willwade/aac-processors';
7976

8077
const processor = new DotProcessor();
81-
const texts = await processor.extractTexts("board.dot");
78+
const texts = await processor.extractTexts('board.dot');
8279

8380
const translations = new Map([
84-
["Hello", "Hola"],
85-
["Food", "Comida"],
81+
['Hello', 'Hola'],
82+
['Food', 'Comida'],
8683
]);
8784

88-
await processor.processTexts("board.dot", translations, "board-es.dot");
85+
await processor.processTexts('board.dot', translations, 'board-es.dot');
8986
```
9087

9188
NB: Please use [https://aactools.co.uk](https://aactools.co.uk) for a far more comphrensive translation logic - where we do far far more than this...

jest.config.js

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
11
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
33
rootDir: __dirname,
4-
preset: "ts-jest",
5-
testEnvironment: "node",
6-
roots: ["<rootDir>/src", "<rootDir>/test"],
7-
testMatch: [
8-
"**/__tests__/**/*.+(ts|tsx|js)",
9-
"**/?(*.)+(spec|test).+(ts|tsx|js)",
10-
],
4+
preset: 'ts-jest',
5+
testEnvironment: 'node',
6+
roots: ['<rootDir>/src', '<rootDir>/test'],
7+
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
118
transform: {
12-
"^.+\\.(ts|tsx)$": [
13-
"ts-jest",
9+
'^.+\\.(ts|tsx)$': [
10+
'ts-jest',
1411
{
15-
tsconfig: "<rootDir>/tsconfig.test.json",
12+
tsconfig: '<rootDir>/tsconfig.test.json',
1613
},
1714
],
1815
},
19-
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
16+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
2017
collectCoverage: true,
21-
coverageDirectory: "coverage",
22-
coverageReporters: [
23-
"text",
24-
"text-summary",
25-
"lcov",
26-
"html",
27-
"json",
28-
"json-summary",
29-
"cobertura",
30-
],
18+
coverageDirectory: 'coverage',
19+
coverageReporters: ['text', 'text-summary', 'lcov', 'html', 'json', 'json-summary', 'cobertura'],
3120
collectCoverageFrom: [
32-
"src/**/*.{js,ts}",
33-
"!src/**/*.d.ts",
34-
"!src/**/*.test.{js,ts}",
35-
"!src/**/__tests__/**",
36-
"!src/cli/**",
37-
"!src/utilities/**",
21+
'src/**/*.{js,ts}',
22+
'!src/**/*.d.ts',
23+
'!src/**/*.test.{js,ts}',
24+
'!src/**/__tests__/**',
25+
'!src/cli/**',
26+
'!src/utilities/**',
3827
],
39-
coveragePathIgnorePatterns: ["/node_modules/", "/dist/", "/__tests__/"],
28+
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/__tests__/'],
4029
coverageThreshold: {
4130
global: {
4231
branches: 58,
@@ -45,13 +34,13 @@ module.exports = {
4534
statements: 72,
4635
},
4736
// Per-file thresholds for critical components
48-
"src/core/": {
37+
'src/core/': {
4938
branches: 80,
5039
functions: 88,
5140
lines: 88,
5241
statements: 88,
5342
},
54-
"src/processors/dotProcessor.ts": {
43+
'src/processors/dotProcessor.ts': {
5544
branches: 70,
5645
functions: 80,
5746
lines: 80,
@@ -60,8 +49,8 @@ module.exports = {
6049
},
6150
// Enable module resolution for both src and dist
6251
moduleNameMapper: {
63-
"^@/(.*)$": "<rootDir>/src/$1",
52+
'^@/(.*)$': '<rootDir>/src/$1',
6453
},
6554
// Ensure Jest can find modules
66-
moduleDirectories: ["node_modules", "<rootDir>/src", "<rootDir>/dist"],
55+
moduleDirectories: ['node_modules', '<rootDir>/src', '<rootDir>/dist'],
6756
};

src/analytics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* This is separate from pageset metrics.
66
*/
77

8-
export * from "./utilities/analytics/history";
8+
export * from './utilities/analytics/history';

src/applePanels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
// Processor class
8-
export { ApplePanelsProcessor } from "./processors/applePanelsProcessor";
8+
export { ApplePanelsProcessor } from './processors/applePanelsProcessor';
99

1010
// Note: Apple Panels doesn't currently have platform-specific helpers
1111
// Future helper functions can be added here

src/astericsGrid.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
// Processor class
8-
export { AstericsGridProcessor } from "./processors/astericsGridProcessor";
8+
export { AstericsGridProcessor } from './processors/astericsGridProcessor';
99

1010
// Note: Asterics Grid doesn't currently have platform-specific helpers
1111
// Future helper functions can be added here

0 commit comments

Comments
 (0)