Skip to content

Commit 9ce22e4

Browse files
committed
chore(deps): upgrade prettier
reformat all code with the new prettier version
1 parent a2dd0c2 commit 9ce22e4

17 files changed

+160
-66
lines changed

benchmark/benchmark.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function createBenchmark(benchmarkName: string): Benchmark {
7878
// As a sanity if duration_ms is 0 just double the count.
7979
profile.iterationCount << 1,
8080
// Otherwise try to guess how many iterations we have to do to get the right time.
81-
Math.round((MIN_SAMPLE_DURATION / durationMs) * profile.iterationCount)
81+
Math.round((MIN_SAMPLE_DURATION / durationMs) * profile.iterationCount),
8282
);
8383
profile.noImprovementCount = 0;
8484
runAgain = true;
@@ -120,7 +120,7 @@ export function createBenchmark(benchmarkName: string): Benchmark {
120120
const percent = (100 - (profile.bestTime / fastest.bestTime) * 100).toFixed(0);
121121
return ' ' + profile.profileName + ': ' + time + ' ' + unit + '(' + percent + '%)';
122122
})
123-
.join('\n')}`
123+
.join('\n')}`,
124124
);
125125
};
126126
return benchmark;

demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />

demo/src/cpu-performance.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ export class CPUPerformance {
66
private samples = new Float32Array(64);
77
private sampleIndex = 0;
88

9-
constructor(private cpu: CPU, private MHZ: number) {}
9+
constructor(
10+
private cpu: CPU,
11+
private MHZ: number,
12+
) {}
1013

1114
reset() {
1215
this.prevTime = 0;

package-lock.json

+106-42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,17 @@
3636
],
3737
"devDependencies": {
3838
"@types/node": "^18.0.0",
39-
"@types/prettier": "^2.3.2",
4039
"@typescript-eslint/eslint-plugin": "^5.48.0",
4140
"@typescript-eslint/parser": "^5.48.0",
4241
"@wokwi/elements": "^0.16.2",
4342
"acorn": "^7.3.1",
4443
"eslint": "^8.31.0",
45-
"eslint-config-prettier": "^8.6.0",
44+
"eslint-config-prettier": "^10.0.1",
4645
"eslint-plugin-json": "^3.1.0",
47-
"eslint-plugin-prettier": "^4.2.1",
46+
"eslint-plugin-prettier": "^5.1.3",
4847
"husky": "^6.0.0",
4948
"lint-staged": "^9.5.0",
50-
"prettier": "^2.3.2",
49+
"prettier": "^3.5.0",
5150
"rimraf": "^3.0.2",
5251
"tsx": "^4.19.2",
5352
"typescript": "^4.9.4",

src/cpu/cpu.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ export class CPU {
8080
nextInterrupt: i16 = -1;
8181
maxInterrupt: i16 = 0;
8282

83-
constructor(public progMem: Uint16Array, private sramBytes = 8192) {
83+
constructor(
84+
public progMem: Uint16Array,
85+
private sramBytes = 8192,
86+
) {
8487
this.reset();
8588
}
8689

src/cpu/instruction.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ export function avrInstruction(cpu: CPU) {
393393
cpu.cycles++;
394394
cpu.data[(opcode & 0x1f0) >> 4] = cpu.readData(
395395
cpu.dataView.getUint16(28, true) +
396-
((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8))
396+
((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)),
397397
);
398398
} else if ((opcode & 0xfe0f) === 0x8000) {
399399
/* LDZ, 1000 000d dddd 0000 */
@@ -419,7 +419,7 @@ export function avrInstruction(cpu: CPU) {
419419
cpu.cycles++;
420420
cpu.data[(opcode & 0x1f0) >> 4] = cpu.readData(
421421
cpu.dataView.getUint16(30, true) +
422-
((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8))
422+
((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)),
423423
);
424424
} else if (opcode === 0x95c8) {
425425
/* LPM, 1001 0101 1100 1000 */
@@ -716,7 +716,7 @@ export function avrInstruction(cpu: CPU) {
716716
cpu.writeData(
717717
cpu.dataView.getUint16(28, true) +
718718
((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)),
719-
cpu.data[(opcode & 0x1f0) >> 4]
719+
cpu.data[(opcode & 0x1f0) >> 4],
720720
);
721721
cpu.cycles++;
722722
} else if ((opcode & 0xfe0f) === 0x8200) {
@@ -744,7 +744,7 @@ export function avrInstruction(cpu: CPU) {
744744
cpu.writeData(
745745
cpu.dataView.getUint16(30, true) +
746746
((opcode & 7) | ((opcode & 0xc00) >> 7) | ((opcode & 0x2000) >> 8)),
747-
cpu.data[(opcode & 0x1f0) >> 4]
747+
cpu.data[(opcode & 0x1f0) >> 4],
748748
);
749749
cpu.cycles++;
750750
} else if ((opcode & 0xfc00) === 0x1800) {

src/peripherals/adc.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ export class AVRADC {
163163
enableMask: ADIE,
164164
};
165165

166-
constructor(private cpu: CPU, private config: ADCConfig) {
166+
constructor(
167+
private cpu: CPU,
168+
private config: ADCConfig,
169+
) {
167170
cpu.writeHooks[config.ADCSRA] = (value, oldValue) => {
168171
if (value & ADEN && !(oldValue && ADEN)) {
169172
this.conversionCycles = 25;

src/peripherals/clock.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class AVRClock {
3535
constructor(
3636
private cpu: CPU,
3737
private baseFreqHz: u32,
38-
private config: AVRClockConfig = clockConfig
38+
private config: AVRClockConfig = clockConfig,
3939
) {
4040
this.cpu.writeHooks[this.config.CLKPR] = (clkpr) => {
4141
if ((!this.clockEnabledCycles || this.clockEnabledCycles < cpu.cycles) && clkpr === CLKPCE) {

src/peripherals/eeprom.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class AVREEPROM {
8585
constructor(
8686
private cpu: CPU,
8787
private backend: EEPROMBackend,
88-
private config: AVREEPROMConfig = eepromConfig
88+
private config: AVREEPROMConfig = eepromConfig,
8989
) {
9090
this.cpu.writeHooks[this.config.EECR] = (eecr) => {
9191
const { EEARH, EEARL, EECR, EEDR } = this.config;

0 commit comments

Comments
 (0)