diff --git a/.eslintrc.json b/.eslintrc.json index 3407a0a..22ba101 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -21,6 +21,7 @@ "error" ], "semi": "off", + "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/semi": [ "error", "always" diff --git a/js/apple2io.ts b/js/apple2io.ts index 783bb78..f1a059e 100644 --- a/js/apple2io.ts +++ b/js/apple2io.ts @@ -12,7 +12,7 @@ type Annunciators = Record; export interface Apple2IOState { annunciators: Annunciators; - cards: Array; + cards: Array; } export type SampleListener = (sample: number[]) => void; @@ -93,7 +93,7 @@ export default class Apple2IO implements MemoryPages, Restorable this._calcSampleRate(); } - _debug(..._args: any[]) { + _debug(..._args: unknown[]) { // debug.apply(this, arguments); } diff --git a/js/base64.ts b/js/base64.ts index 4fc8e36..7a8566c 100644 --- a/js/base64.ts +++ b/js/base64.ts @@ -125,7 +125,7 @@ export function base64_decode(data: string | null | undefined): memory | undefin const DATA_URL_PREFIX = 'data:application/octet-stream;base64,'; export function base64_json_parse(json: string) { - const reviver = (_key: string, value: any) => { + const reviver = (_key: string, value: unknown) => { if (typeof value ==='string' && value.startsWith(DATA_URL_PREFIX)) { return base64_decode(value.slice(DATA_URL_PREFIX.length)); } @@ -135,8 +135,8 @@ export function base64_json_parse(json: string) { return JSON.parse(json, reviver); } -export function base64_json_stringify(json: any) { - const replacer = (_key: string, value: any) => { +export function base64_json_stringify(json: unknown) { + const replacer = (_key: string, value: unknown) => { if (value instanceof Uint8Array) { return DATA_URL_PREFIX + base64_encode(value); } diff --git a/js/cards/cffa.ts b/js/cards/cffa.ts index 4751f1f..058a9ca 100644 --- a/js/cards/cffa.ts +++ b/js/cards/cffa.ts @@ -152,7 +152,7 @@ export default class CFFA implements Card, MassStorage, Restorable { // Verbose debug method - private _debug(..._args: any[]) { + private _debug(..._args: unknown[]) { // debug.apply(this, arguments); } diff --git a/js/cards/disk2.ts b/js/cards/disk2.ts index 5e98557..a0d717b 100644 --- a/js/cards/disk2.ts +++ b/js/cards/disk2.ts @@ -393,7 +393,7 @@ export default class DiskII implements Card { this.initWorker(); } - private debug(..._args: any[]) { + private debug(..._args: unknown[]) { // debug.apply(this, arguments); } diff --git a/js/cards/langcard.ts b/js/cards/langcard.ts index 76727f3..0d65f9e 100644 --- a/js/cards/langcard.ts +++ b/js/cards/langcard.ts @@ -43,7 +43,7 @@ export default class LanguageCard implements Card, Restorable this.read2 = this.rom; } - private debug(..._args: any[]) { + private debug(..._args: unknown[]) { // debug.apply(null, args); } diff --git a/js/cards/smartport.ts b/js/cards/smartport.ts index b9b5278..8432af5 100644 --- a/js/cards/smartport.ts +++ b/js/cards/smartport.ts @@ -135,7 +135,7 @@ export default class SmartPort implements Card, MassStorage, Restorable private bits: boolean[] = []; private command: byte = COMMANDS.REGHOLD; - private debug(..._args: any[]) { + private debug(..._args: unknown[]) { // debug.apply(this, arguments); } diff --git a/js/cpu6502.ts b/js/cpu6502.ts index 102da50..21b383e 100644 --- a/js/cpu6502.ts +++ b/js/cpu6502.ts @@ -147,7 +147,7 @@ type WriteFn = (val: byte) => void; type ReadAddrFn = (opts?: Opts) => word; type ImpliedFn = () => void; -interface Instruction { +interface Instruction { name: string; mode: Mode; op: (fn: T) => void; diff --git a/js/formats/woz.ts b/js/formats/woz.ts index 5e200ba..17057f4 100644 --- a/js/formats/woz.ts +++ b/js/formats/woz.ts @@ -191,7 +191,7 @@ export class MetaChunk { } interface Chunks { - [key: string]: any; + [key: string]: unknown; info?: InfoChunk; tmap?: TMapChunk; trks?: TrksChunk; diff --git a/js/mmu.ts b/js/mmu.ts index c1bfee5..f214977 100644 --- a/js/mmu.ts +++ b/js/mmu.ts @@ -310,7 +310,7 @@ export default class MMU implements Memory, Restorable { this._iouDisable = true; } - _debug(..._args: any[]) { + _debug(..._args: unknown[]) { // debug.apply(this, _args); } diff --git a/js/types.ts b/js/types.ts index 99a5629..6df4a96 100644 --- a/js/types.ts +++ b/js/types.ts @@ -102,7 +102,7 @@ export interface Card extends Memory, Restorable { export type TapeData = Array<[duration: number, high: boolean]>; -export interface Restorable { +export interface Restorable { getState(): T; setState(state: T): void; } diff --git a/js/ui/screen.ts b/js/ui/screen.ts index 4ed928d..c7e1754 100644 --- a/js/ui/screen.ts +++ b/js/ui/screen.ts @@ -12,7 +12,7 @@ declare global { webkitIsFullScreen: boolean; } interface Element { - webkitRequestFullScreen: (options?: any) => void; + webkitRequestFullScreen: (options?: unknown) => void; } } export class Screen implements OptionHandler { diff --git a/js/util.ts b/js/util.ts index cd74996..51372af 100644 --- a/js/util.ts +++ b/js/util.ts @@ -45,7 +45,7 @@ export function bytify(ary: number[]): memory { } /** Writes to the console. */ -export function debug(...args: any[]): void { +export function debug(...args: unknown[]): void { console.log.apply(console, args); }