Prohibit any

This commit is contained in:
Will Scullin 2022-05-17 19:08:28 -07:00
parent 9a940935af
commit 41015864f2
No known key found for this signature in database
GPG Key ID: 26DCD1042C6638CD
14 changed files with 17 additions and 16 deletions

View File

@ -21,6 +21,7 @@
"error"
],
"semi": "off",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/semi": [
"error",
"always"

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -393,7 +393,7 @@ export default class DiskII implements Card {
this.initWorker();
}
private debug(..._args: any[]) {
private debug(..._args: unknown[]) {
// debug.apply(this, arguments);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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;

View File

@ -191,7 +191,7 @@ export class MetaChunk {
}
interface Chunks {
[key: string]: any;
[key: string]: unknown;
info?: InfoChunk;
tmap?: TMapChunk;
trks?: TrksChunk;

View File

@ -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);
}

View File

@ -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;
}

View File

@ -12,7 +12,7 @@ declare global {
webkitIsFullScreen: boolean;
}
interface Element {
webkitRequestFullScreen: (options?: any) => void;
webkitRequestFullScreen: (options?: unknown) => void;
}
}
export class Screen implements OptionHandler {

View File

@ -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);
}