Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
- name: Check formatting
run: yarn check:format

- name: Lint
run: yarn lint

- name: Build packages
run: |
yarn workspace @learn6502/6502 run build
Expand Down
55 changes: 55 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"useTabs": false,
"tabWidth": 2,
"printWidth": 120,
"singleQuote": false,
"jsxSingleQuote": false,
"quoteProps": "as-needed",
"trailingComma": "es5",
"semi": true,
"arrowParens": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"ignorePatterns": [
"**/*.json",
"**/*.jsonc",
"**/*.json5",
"**/*.css",
"**/*.scss",
"**/*.sass",
"**/*.less",
"**/*.html",
"**/*.htm",
"**/*.md",
"**/*.mdx",
"**/*.markdown",
"**/*.yml",
"**/*.yaml",
"**/*.toml",
"**/*.blp",
"**/node_modules",
"**/dist",
"**/lib",
"**/build",
"**/build-dir",
"**/builddir",
"**/flatpak-build",
"**/.flatpak-builder",
"**/repo",
"**/coverage",
"**/refs",
"**/references",
"**/@types",
"**/templates",
"**/prebuilds",
"**/.yarn",
"**/_site",
"**/_includes",
"**/platforms",
"packages/app-android/app/i18n",
"**/*.gresource",
"**/*.compiled",
"**/*.metainfo.xml"
]
}
51 changes: 51 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": {
"correctness": "error"
},
"rules": {
"typescript/consistent-type-imports": "warn",
"typescript/no-explicit-any": "warn",
"typescript/no-non-null-assertion": "off",
"unicorn/prefer-node-protocol": "error",
"eslint/no-unused-expressions": [
"error",
{ "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }
],
"typescript/triple-slash-reference": "off",
"eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_"
}
]
},
"ignorePatterns": [
"**/node_modules",
"**/dist",
"**/lib",
"**/build",
"**/build-dir",
"**/builddir",
"**/flatpak-build",
"**/.flatpak-builder",
"**/repo",
"**/coverage",
"**/refs",
"**/references",
"**/@types",
"**/templates",
"**/prebuilds",
"**/.yarn",
"**/_site",
"**/_includes",
"**/platforms",
"packages/app-android/app/i18n",
"**/*.gresource",
"**/*.compiled",
"**/*.metainfo.xml"
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
92 changes: 0 additions & 92 deletions biome.json

This file was deleted.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,10 @@
"start:android": "gjsify workspace @learn6502/app-android start",
"clear": "gjsify foreach -v -p clear && gjsify run _clear",
"_clear": "rm -rf builddir build-dir .flatpak-builder flatpak-build repo eu.jumplink.Learn6502.tar.gz",
"format": "gjsify format",
"fix": "gjsify fix"
"format": "gjsify format --write",
"fix": "gjsify fix",
"lint": "gjsify lint",
"check:lint": "gjsify lint"
},
"author": "Pascal Garber <pascal@mailfreun.de>",
"license": "GPL-3.0",
Expand All @@ -383,8 +385,9 @@
"packages/app-web"
],
"devDependencies": {
"@biomejs/biome": "^2.4.13",
"@gjsify/cli": "^0.4.14",
"@gjsify/cli": "^0.4.37",
"oxfmt": "^0.53.0",
"oxlint": "^1.68.0",
"typescript": "^6.0.3"
},
"packageManager": "yarn@4.13.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/6502/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// We don't want to use the DOM types in the 6502 package to make it cross-platform,
// but we need the interval and timeout functions.
declare function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setInterval(handler: TimerHandler, timeout?: number, ...args: any[]): number;
declare function clearInterval(handle?: number): void;

declare function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number;
declare function setTimeout(handler: TimerHandler, timeout?: number, ...args: any[]): number;
declare function clearTimeout(handle?: number): void;

type TimerHandler = string | Function;
22 changes: 11 additions & 11 deletions packages/6502/src/assembler.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Memory } from "./memory.js";
import { Labels } from "./labels.js";
import type { Memory } from "./memory.js";
import type { Labels } from "./labels.js";
import { EventDispatcher } from "./event-dispatcher.js";
import { _, addr2hex, num2hex } from "./utils.js";
import { ADDRESSING_MODES, INSTRUCTION_LENGTH } from "./constants.js";
Expand Down Expand Up @@ -639,7 +639,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^#([\w\$%]+)$/i);
const match_data = param.match(/^#([\w$%]+)$/i);
if (match_data) {
const operand = this.tryParseByteOperand(match_data[1], symbols);
if (operand >= 0) {
Expand Down Expand Up @@ -684,7 +684,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^\(([\w\$]+)\)$/i);
const match_data = param.match(/^\(([\w$]+)\)$/i);
if (match_data) {
const operand = this.tryParseWordOperand(match_data[1], symbols);
if (operand >= 0) {
Expand All @@ -705,7 +705,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^\(([\w\$]+),X\)$/i);
const match_data = param.match(/^\(([\w$]+),X\)$/i);
if (match_data) {
const operand = this.tryParseByteOperand(match_data[1], symbols);
if (operand >= 0) {
Expand All @@ -726,7 +726,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^\(([\w\$]+)\),Y$/i);
const match_data = param.match(/^\(([\w$]+)\),Y$/i);
if (match_data) {
const operand = this.tryParseByteOperand(match_data[1], symbols);
if (operand >= 0) {
Expand Down Expand Up @@ -783,7 +783,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^([\w\$]+),X$/i);
const match_data = param.match(/^([\w$]+),X$/i);
if (match_data) {
const operand = this.tryParseWordOperand(match_data[1], symbols);
if (operand >= 0) {
Expand Down Expand Up @@ -824,7 +824,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^([\w\$]+),Y$/i);
const match_data = param.match(/^([\w$]+),Y$/i);
if (match_data) {
const operand = this.tryParseWordOperand(match_data[1], symbols);
if (operand >= 0) {
Expand Down Expand Up @@ -863,7 +863,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^([\w\$]+),X$/i);
const match_data = param.match(/^([\w$]+),X$/i);
if (match_data) {
const operand = this.tryParseByteOperand(match_data[1], symbols);
if (operand >= 0) {
Expand All @@ -886,7 +886,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^([\w\$]+),Y$/i);
const match_data = param.match(/^([\w$]+),Y$/i);
if (match_data) {
const operand = this.tryParseByteOperand(match_data[1], symbols);
if (operand >= 0) {
Expand All @@ -910,7 +910,7 @@ export class Assembler {
return false;
}

const match_data = param.match(/^([\w\$]+)$/i);
const match_data = param.match(/^([\w$]+)$/i);
if (match_data) {
const operand = this.tryParseWordOperand(match_data[1], symbols);
if (operand >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/6502/src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Memory {
* Creates a new Memory instance.
*/
constructor() {
this.memArray = new Array(0x10000);
this.memArray = Array.from({ length: 0x10000 });

this.storeKeypress = this.storeKeypress.bind(this);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/6502/src/simulator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Memory } from "./memory.js";
import { Labels } from "./labels.js";
import type { Memory } from "./memory.js";
import type { Labels } from "./labels.js";
import { EventDispatcher } from "./event-dispatcher.js";

import type { SimulatorEventsMap } from "./types/index.js";
Expand Down
4 changes: 2 additions & 2 deletions packages/app-android/app/app-root.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EventData } from "@nativescript/core";
import { Frame, Utils } from "@nativescript/core";
import type { EventData, Frame } from "@nativescript/core";
import { Utils } from "@nativescript/core";
import { logger } from "~/utils";
import { themeService } from "~/services";

Expand Down
3 changes: 2 additions & 1 deletion packages/app-android/app/mdx/mdx-view.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ContentView, Builder, HtmlView, View } from "@nativescript/core";
import type { View } from "@nativescript/core";
import { ContentView, Builder, HtmlView } from "@nativescript/core";
import { localize } from "@nativescript/localize";
import { EventDispatcher } from "@learn6502/6502";
import type { SourceViewEventMap, SourceViewCopyEvent } from "@learn6502/common-ui";
Expand Down
3 changes: 2 additions & 1 deletion packages/app-android/app/services/file.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FileService as BaseFileService } from "@learn6502/common-ui";
import { Application, AndroidActivityResultEventData } from "@nativescript/core";
import type { AndroidActivityResultEventData } from "@nativescript/core";
import { Application } from "@nativescript/core";
import { Observable } from "@nativescript/core/data/observable";
import { logger, showError } from "~/utils";

Expand Down
3 changes: 2 additions & 1 deletion packages/app-android/app/services/theme.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import type { ThemeMode } from "@learn6502/common-ui";
import { Application, ApplicationSettings } from "@nativescript/core";
import { systemStates, SystemStates } from "../states";
import { getRootViewWhenReady, restartApp, showError } from "../utils/index";
import { ContrastMode, SETTINGS_THEME, DEFAULT_THEME } from "../constants";
import type { ContrastMode } from "../constants";
import { SETTINGS_THEME, DEFAULT_THEME } from "../constants";
import type { ContrastChangeEvent } from "~/types";
import { logger } from "~/utils";

Expand Down
3 changes: 2 additions & 1 deletion packages/app-android/app/states/system.states.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* Pattern from reference projects: centralized state with EventDispatcher
*/

import { Application, LaunchEventData, type SystemAppearanceChangedEventData, Utils } from "@nativescript/core";
import type { LaunchEventData } from "@nativescript/core";
import { Application, type SystemAppearanceChangedEventData, Utils } from "@nativescript/core";
import { androidLaunchEventLocalizationHandler, overrideLocale } from "@nativescript/localize";
import { EventDispatcher } from "@learn6502/6502";
import { ContrastMode } from "../constants";
Expand Down
Loading