mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Prohibit any
This commit is contained in:
parent
9a940935af
commit
41015864f2
@ -21,6 +21,7 @@
|
||||
"error"
|
||||
],
|
||||
"semi": "off",
|
||||
"@typescript-eslint/no-explicit-any": "error",
|
||||
"@typescript-eslint/semi": [
|
||||
"error",
|
||||
"always"
|
||||
|
@ -12,7 +12,7 @@ type Annunciators = Record<annunciator, boolean>;
|
||||
|
||||
export interface Apple2IOState {
|
||||
annunciators: Annunciators;
|
||||
cards: Array<any | null>;
|
||||
cards: Array<unknown | null>;
|
||||
}
|
||||
|
||||
export type SampleListener = (sample: number[]) => void;
|
||||
@ -93,7 +93,7 @@ export default class Apple2IO implements MemoryPages, Restorable<Apple2IOState>
|
||||
this._calcSampleRate();
|
||||
}
|
||||
|
||||
_debug(..._args: any[]) {
|
||||
_debug(..._args: unknown[]) {
|
||||
// debug.apply(this, arguments);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ export default class CFFA implements Card, MassStorage, Restorable<CFFAState> {
|
||||
|
||||
// Verbose debug method
|
||||
|
||||
private _debug(..._args: any[]) {
|
||||
private _debug(..._args: unknown[]) {
|
||||
// debug.apply(this, arguments);
|
||||
}
|
||||
|
||||
|
@ -393,7 +393,7 @@ export default class DiskII implements Card {
|
||||
this.initWorker();
|
||||
}
|
||||
|
||||
private debug(..._args: any[]) {
|
||||
private debug(..._args: unknown[]) {
|
||||
// debug.apply(this, arguments);
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ export default class LanguageCard implements Card, Restorable<LanguageCardState>
|
||||
this.read2 = this.rom;
|
||||
}
|
||||
|
||||
private debug(..._args: any[]) {
|
||||
private debug(..._args: unknown[]) {
|
||||
// debug.apply(null, args);
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ export default class SmartPort implements Card, MassStorage, Restorable<SmartPor
|
||||
}
|
||||
}
|
||||
|
||||
private debug(..._args: any[]) {
|
||||
private debug(..._args: unknown[]) {
|
||||
// debug.apply(this, arguments);
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ export default class Thunderclock implements Card, Restorable<ThunderclockState>
|
||||
private bits: boolean[] = [];
|
||||
private command: byte = COMMANDS.REGHOLD;
|
||||
|
||||
private debug(..._args: any[]) {
|
||||
private debug(..._args: unknown[]) {
|
||||
// debug.apply(this, arguments);
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ type WriteFn = (val: byte) => void;
|
||||
type ReadAddrFn = (opts?: Opts) => word;
|
||||
type ImpliedFn = () => void;
|
||||
|
||||
interface Instruction<T = any> {
|
||||
interface Instruction<T = unknown> {
|
||||
name: string;
|
||||
mode: Mode;
|
||||
op: (fn: T) => void;
|
||||
|
@ -191,7 +191,7 @@ export class MetaChunk {
|
||||
}
|
||||
|
||||
interface Chunks {
|
||||
[key: string]: any;
|
||||
[key: string]: unknown;
|
||||
info?: InfoChunk;
|
||||
tmap?: TMapChunk;
|
||||
trks?: TrksChunk;
|
||||
|
@ -310,7 +310,7 @@ export default class MMU implements Memory, Restorable<MMUState> {
|
||||
this._iouDisable = true;
|
||||
}
|
||||
|
||||
_debug(..._args: any[]) {
|
||||
_debug(..._args: unknown[]) {
|
||||
// debug.apply(this, _args);
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ export interface Card extends Memory, Restorable {
|
||||
|
||||
export type TapeData = Array<[duration: number, high: boolean]>;
|
||||
|
||||
export interface Restorable<T = any> {
|
||||
export interface Restorable<T = unknown> {
|
||||
getState(): T;
|
||||
setState(state: T): void;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ declare global {
|
||||
webkitIsFullScreen: boolean;
|
||||
}
|
||||
interface Element {
|
||||
webkitRequestFullScreen: (options?: any) => void;
|
||||
webkitRequestFullScreen: (options?: unknown) => void;
|
||||
}
|
||||
}
|
||||
export class Screen implements OptionHandler {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user