diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..b635e6f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "bracketSpacing": false, + "semi": true, + "singleQuote": true +} diff --git a/js/apple1.ts b/js/apple1.ts index 65cba61..40c1573 100644 --- a/js/apple1.ts +++ b/js/apple1.ts @@ -12,11 +12,11 @@ import MicroModal from 'micromodal'; import Apple1IO from './apple1io'; -import { CPU6502, word, byte } from '@whscullin/cpu6502'; +import {CPU6502, word, byte} from '@whscullin/cpu6502'; import Prefs from './prefs'; import RAM from './ram'; -import { TextPage } from './canvas1'; -import { debug, hup } from './util'; +import {TextPage} from './canvas1'; +import {debug, hup} from './util'; import Basic from './roms/basic'; import Bios from './roms/bios'; @@ -24,7 +24,7 @@ import Krusader from './roms/krusader'; import ACI from './cards/aci'; -import { mapKeyEvent, KeyBoard } from './ui/keyboard'; +import {mapKeyEvent, KeyBoard} from './ui/keyboard'; // eslint-disable-next-line prefer-const let DEBUG = false; @@ -272,7 +272,8 @@ declare global { let _key: byte; function _keydown(evt: KeyboardEvent) { - const F1 = 112, F2 = 113; + const F1 = 112, + F2 = 113; if (evt.keyCode === F1) { cpu.reset(); } else if (evt.keyCode === F2) { diff --git a/js/apple1io.ts b/js/apple1io.ts index a9d5db6..4a414f7 100644 --- a/js/apple1io.ts +++ b/js/apple1io.ts @@ -9,8 +9,8 @@ * implied warranty. */ -import { TextPage } from './canvas1'; -import type { byte } from '@whscullin/cpu6502'; +import {TextPage} from './canvas1'; +import type {byte} from '@whscullin/cpu6502'; const LOC = { KBD: 0x10, diff --git a/js/base64.ts b/js/base64.ts index cac518d..5db03f1 100644 --- a/js/base64.ts +++ b/js/base64.ts @@ -1,4 +1,4 @@ -import { memory } from '@whscullin/cpu6502'; +import {memory} from '@whscullin/cpu6502'; const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; diff --git a/js/canvas1.ts b/js/canvas1.ts index 1c8140b..3de909e 100644 --- a/js/canvas1.ts +++ b/js/canvas1.ts @@ -9,8 +9,8 @@ * implied warranty. */ -import { charset } from './roms/apple1char'; -import type { byte } from '@whscullin/cpu6502'; +import {charset} from './roms/apple1char'; +import type {byte} from '@whscullin/cpu6502'; /* 0: A9 9 AA 20 EF FF E8 8A 4C 2 0 diff --git a/js/cards/aci.ts b/js/cards/aci.ts index ee5ebe5..4403481 100644 --- a/js/cards/aci.ts +++ b/js/cards/aci.ts @@ -1,5 +1,5 @@ -import { CPU6502, byte } from '@whscullin/cpu6502'; -import { debug } from '../util'; +import {CPU6502, byte} from '@whscullin/cpu6502'; +import {debug} from '../util'; // prettier-ignore const rom = [ diff --git a/js/entry1.js b/js/entry1.js index 0f18cda..69799c4 100644 --- a/js/entry1.js +++ b/js/entry1.js @@ -1,3 +1,3 @@ -import * as Apple1 from "./apple1"; +import * as Apple1 from './apple1'; window.Apple1 = Apple1; diff --git a/js/ram.ts b/js/ram.ts index b3ba3ac..a058cfa 100644 --- a/js/ram.ts +++ b/js/ram.ts @@ -9,9 +9,9 @@ * implied warranty. */ -import { base64_decode, base64_encode } from './base64'; -import { allocMemPages } from './util'; -import type { byte, memory } from '@whscullin/cpu6502'; +import {base64_decode, base64_encode} from './base64'; +import {allocMemPages} from './util'; +import type {byte, memory} from '@whscullin/cpu6502'; export interface RAMState { start: byte; diff --git a/js/roms/basic.ts b/js/roms/basic.ts index b518943..0a58a9c 100644 --- a/js/roms/basic.ts +++ b/js/roms/basic.ts @@ -1,4 +1,4 @@ -import { byte } from '@whscullin/cpu6502'; +import {byte} from '@whscullin/cpu6502'; export default class Basic { ram = [ diff --git a/js/roms/bios.ts b/js/roms/bios.ts index f5d41f5..2994fe7 100644 --- a/js/roms/bios.ts +++ b/js/roms/bios.ts @@ -1,4 +1,4 @@ -import { byte } from '@whscullin/cpu6502'; +import {byte} from '@whscullin/cpu6502'; export default class Bios { rom = [ diff --git a/js/roms/enhanced-basic.ts b/js/roms/enhanced-basic.ts index 76f4c57..f84b705 100644 --- a/js/roms/enhanced-basic.ts +++ b/js/roms/enhanced-basic.ts @@ -1,4 +1,4 @@ -import { byte } from '@whscullin/cpu6502'; +import {byte} from '@whscullin/cpu6502'; export default class EnhancedBasic { rom = [ diff --git a/js/roms/krusader.ts b/js/roms/krusader.ts index bfecab6..d3aefc1 100644 --- a/js/roms/krusader.ts +++ b/js/roms/krusader.ts @@ -1,4 +1,4 @@ -import { byte } from '@whscullin/cpu6502'; +import {byte} from '@whscullin/cpu6502'; export default class Krusader { rom = [ diff --git a/js/symbols.ts b/js/symbols.ts index 974731a..f407632 100644 --- a/js/symbols.ts +++ b/js/symbols.ts @@ -9,7 +9,7 @@ * implied warranty. */ -import type { word } from '@whscullin/cpu6502'; +import type {word} from '@whscullin/cpu6502'; export const SYMBOLS: Record = { 0xd010: 'KBD', diff --git a/js/ui/keyboard.ts b/js/ui/keyboard.ts index f8f7742..3f0f719 100644 --- a/js/ui/keyboard.ts +++ b/js/ui/keyboard.ts @@ -9,10 +9,10 @@ * implied warranty. */ -import { CPU6502, byte } from '@whscullin/cpu6502'; -import { debug, toHex } from '../util'; +import {CPU6502, byte} from '@whscullin/cpu6502'; +import {debug, toHex} from '../util'; import Apple1IO from 'js/apple1io'; -import { TextPage } from 'js/canvas1'; +import {TextPage} from 'js/canvas1'; // keycode: [plain, cntl, shift] diff --git a/js/util.ts b/js/util.ts index 82518a3..461ab61 100644 --- a/js/util.ts +++ b/js/util.ts @@ -9,7 +9,7 @@ * implied warranty. */ -import { byte, word } from '@whscullin/cpu6502'; +import {byte, word} from '@whscullin/cpu6502'; const hex_digits = '0123456789ABCDEF'; const bin_digits = '01'; diff --git a/package.json b/package.json index 8d2af44..2e73de1 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "webpack --mode=production", "dev": "webpack-dev-server", "lint": "eslint js", + "lint-fix": "eslint --fix js", "start": "webpack-dev-server", "test": "jest" },