mirror of
https://github.com/whscullin/apple1js.git
synced 2024-06-07 20:29:31 +00:00
Prettier
This commit is contained in:
parent
0216e75e7f
commit
f7ba798bba
|
@ -1,27 +1,19 @@
|
||||||
{
|
{
|
||||||
// Global
|
// Global
|
||||||
"root": true,
|
"root": true,
|
||||||
|
"plugins": [
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
|
"plugin:prettier/recommended",
|
||||||
"plugin:jest/recommended"
|
"plugin:jest/recommended"
|
||||||
],
|
],
|
||||||
"globals": {
|
"globals": {
|
||||||
"tapes": "writable"
|
"tapes": "writable"
|
||||||
},
|
},
|
||||||
"rules": {
|
"rules": {
|
||||||
"indent": [
|
|
||||||
"error",
|
|
||||||
4,
|
|
||||||
{
|
|
||||||
"SwitchCase": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"quotes": [
|
|
||||||
"error",
|
|
||||||
"single",
|
|
||||||
{ "avoidEscape": true }
|
|
||||||
],
|
|
||||||
"linebreak-style": [
|
"linebreak-style": [
|
||||||
"error",
|
"error",
|
||||||
"unix"
|
"unix"
|
||||||
|
@ -45,6 +37,7 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"prettier/prettier": "error",
|
||||||
// Jest configuration
|
// Jest configuration
|
||||||
"jest/expect-expect": [
|
"jest/expect-expect": [
|
||||||
"error",
|
"error",
|
||||||
|
|
|
@ -143,7 +143,7 @@ export function doLoadLocal(files: FileList) {
|
||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
window.alert('Unable to read tape file: ' + file.name);
|
window.alert('Unable to read tape file: ' + file.name);
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,7 +6,7 @@ const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
||||||
export function base64_encode(data: null | undefined): undefined;
|
export function base64_encode(data: null | undefined): undefined;
|
||||||
export function base64_encode(data: memory): string;
|
export function base64_encode(data: memory): string;
|
||||||
export function base64_encode(
|
export function base64_encode(
|
||||||
data: memory | null | undefined
|
data: memory | null | undefined,
|
||||||
): string | undefined {
|
): string | undefined {
|
||||||
// Twacked by Will Scullin to handle arrays of 'bytes'
|
// Twacked by Will Scullin to handle arrays of 'bytes'
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ export function base64_decode(data: null | undefined): undefined;
|
||||||
export function base64_decode(data: string): memory;
|
export function base64_decode(data: string): memory;
|
||||||
/** Returns an array of bytes from the given base64-encoded string. */
|
/** Returns an array of bytes from the given base64-encoded string. */
|
||||||
export function base64_decode(
|
export function base64_decode(
|
||||||
data: string | null | undefined
|
data: string | null | undefined,
|
||||||
): memory | undefined {
|
): memory | undefined {
|
||||||
// Twacked by Will Scullin to handle arrays of 'bytes'
|
// Twacked by Will Scullin to handle arrays of 'bytes'
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ export class TextPage {
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
7 * 40 * 2,
|
7 * 40 * 2,
|
||||||
8 * 24 * 2
|
8 * 24 * 2,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,10 @@ export default class ACI {
|
||||||
_beKind = false;
|
_beKind = false;
|
||||||
_progress = 0;
|
_progress = 0;
|
||||||
|
|
||||||
constructor(private cpu: CPU6502, private cb: ACICallback) {
|
constructor(
|
||||||
|
private cpu: CPU6502,
|
||||||
|
private cb: ACICallback,
|
||||||
|
) {
|
||||||
this._last = cpu.getCycles();
|
this._last = cpu.getCycles();
|
||||||
this._next = this._last;
|
this._next = this._last;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,15 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010-2023 Will Scullin <scullin@scullinsteel.com>
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
|
* documentation for any purpose is hereby granted without fee, provided that
|
||||||
|
* the above copyright notice appear in all copies and that both that
|
||||||
|
* copyright notice and this permission notice appear in supporting
|
||||||
|
* documentation. No representations are made about the suitability of this
|
||||||
|
* software for any purpose. It is provided "as is" without express or
|
||||||
|
* implied warranty.
|
||||||
|
*/
|
||||||
|
|
||||||
import { Memory, MemberOf, MemoryPages, byte, word } from './types';
|
import { Memory, MemberOf, MemoryPages, byte, word } from './types';
|
||||||
import { toHex } from './util';
|
import { toHex } from './util';
|
||||||
|
|
||||||
|
@ -124,7 +136,7 @@ interface ResettablePageHandler extends MemoryPages {
|
||||||
}
|
}
|
||||||
|
|
||||||
function isResettablePageHandler(
|
function isResettablePageHandler(
|
||||||
pageHandler: MemoryPages | ResettablePageHandler
|
pageHandler: MemoryPages | ResettablePageHandler,
|
||||||
): pageHandler is ResettablePageHandler {
|
): pageHandler is ResettablePageHandler {
|
||||||
return (pageHandler as ResettablePageHandler).reset !== undefined;
|
return (pageHandler as ResettablePageHandler).reset !== undefined;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
import * as Apple1 from './apple1';
|
import * as Apple1 from "./apple1";
|
||||||
|
|
||||||
window.Apple1 = Apple1;
|
window.Apple1 = Apple1;
|
||||||
|
|
|
@ -22,7 +22,10 @@ export interface RAMState {
|
||||||
export default class RAM {
|
export default class RAM {
|
||||||
mem: Uint8Array | byte[];
|
mem: Uint8Array | byte[];
|
||||||
|
|
||||||
constructor(private start_page: byte, private end_page: byte) {
|
constructor(
|
||||||
|
private start_page: byte,
|
||||||
|
private end_page: byte,
|
||||||
|
) {
|
||||||
this.mem = allocMemPages(end_page - start_page + 1);
|
this.mem = allocMemPages(end_page - start_page + 1);
|
||||||
|
|
||||||
for (let page = 0; page <= end_page; page++) {
|
for (let page = 0; page <= end_page; page++) {
|
||||||
|
|
|
@ -175,7 +175,7 @@ export class KeyBoard {
|
||||||
id: string,
|
id: string,
|
||||||
private cpu: CPU6502,
|
private cpu: CPU6502,
|
||||||
private io: Apple1IO,
|
private io: Apple1IO,
|
||||||
private text: TextPage
|
private text: TextPage,
|
||||||
) {
|
) {
|
||||||
this.kb = document.querySelector<HTMLDivElement>(id)!;
|
this.kb = document.querySelector<HTMLDivElement>(id)!;
|
||||||
}
|
}
|
||||||
|
|
1549
package-lock.json
generated
1549
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -30,10 +30,13 @@
|
||||||
"@babel/preset-env": "^7.4.2",
|
"@babel/preset-env": "^7.4.2",
|
||||||
"@types/micromodal": "^0.3.3",
|
"@types/micromodal": "^0.3.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
||||||
|
"@types/jest": "^29.5.3",
|
||||||
"ajv": "^6.9.2",
|
"ajv": "^6.9.2",
|
||||||
"babel-jest": "^29.5.0",
|
"babel-jest": "^29.5.0",
|
||||||
"eslint": "^8.3.0",
|
"eslint": "^8.3.0",
|
||||||
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-plugin-jest": "^27.2.3",
|
"eslint-plugin-jest": "^27.2.3",
|
||||||
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"node-forge": "^1.3.0",
|
"node-forge": "^1.3.0",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.1.1",
|
||||||
|
@ -44,7 +47,6 @@
|
||||||
"webpack-dev-server": "^4.6.0"
|
"webpack-dev-server": "^4.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/jest": "^29.5.3",
|
|
||||||
"micromodal": "^0.4.9"
|
"micromodal": "^0.4.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user