Clean up unused variables

This commit is contained in:
Jordan Eldredge 2019-08-18 14:14:13 -07:00
parent e35c85af3c
commit fd4b301427
8 changed files with 30 additions and 30 deletions

View file

@ -2,7 +2,6 @@
"rules": {
// TODO: Turn these all back on
"camelcase": "off",
"@typescript-eslint/no-unused-vars": "off",
"prefer-const": "off",
"no-shadow": "off",
"no-nested-ternary": "off",

View file

@ -1,4 +1,4 @@
import React, { useEffect, useReducer, useState } from "react";
import React, { useEffect, useReducer } from "react";
import "./App.css";
import * as Utils from "./utils";
import * as Actions from "./Actions";
@ -11,7 +11,7 @@ import Debugger from "./debugger";
import Sidebar from "./Sidebar";
function useJsUpdates(node) {
const [ignored, forceUpdate] = useReducer(x => x + 1, 0);
const [, forceUpdate] = useReducer(x => x + 1, 0);
useEffect(() => node.js_listen("js_update", forceUpdate));
}
@ -96,8 +96,8 @@ function GuiObjectEvents({ Component, node, children }) {
onMouseMove={e => handleMouseEventDispatch(node, e, "onMouseMove")}
onMouseEnter={e => handleMouseEventDispatch(node, e, "onEnterArea")}
onMouseLeave={e => handleMouseEventDispatch(node, e, "onLeaveArea")}
onDragEnter={e => node.js_trigger("onDragEnter")}
onDragLeave={e => node.js_trigger("onDragLeave")}
onDragEnter={() => node.js_trigger("onDragEnter")}
onDragLeave={() => node.js_trigger("onDragLeave")}
onDragOver={e => handleMouseEventDispatch(node, e, "onDragOver")}
onKeyUp={e => node.js_trigger("onKeyUp", e.keyCode)}
onKeyDown={e => node.js_trigger("onKeyDown", e.keyCode)}
@ -138,7 +138,7 @@ function Layout({
node,
id,
background,
desktopalpha,
// desktopalpha,
drawBackground,
x,
y,
@ -148,7 +148,7 @@ function Layout({
maximum_h,
minimum_w,
maximum_w,
droptarget,
// droptarget,
children,
}) {
if (drawBackground && background == null) {
@ -265,7 +265,7 @@ function Layer({ node, id, image, children, x, y }) {
function Button({
id,
image,
action,
// action,
x,
y,
downImage,
@ -290,7 +290,7 @@ function Button({
<div
data-node-type="button"
data-node-id={id}
onMouseDown={e => {
onMouseDown={() => {
setDown(true);
document.addEventListener("mouseup", () => {
// TODO: This could be unmounted
@ -379,17 +379,17 @@ function Group(props) {
}
function Text({
node,
// node,
id,
children,
display,
ticker,
antialias,
// ticker,
// antialias,
x,
y,
w,
h,
font,
// font,
fontsize,
color,
align,
@ -452,8 +452,7 @@ const NODE_NO_EVENTS = new Set(["popupmenu"]);
// Given a skin XML node, pick which component to use, and render it.
function XmlNode({ node }) {
const attributes = node.attributes;
const name = node.name;
const { name } = node;
if (
name == null ||
name === "groupdef" ||

View file

@ -1,7 +1,7 @@
import Variable from "./variable";
import { isPromise, unimplementedWarning } from "../utils";
function coerceTypes(var1, var2, val1, val2) {
function coerceTypes(var1, var2, val1 /* val2 */) {
if (var2.type === "INT") {
if (var1.type === "FLOAT" || var1.type === "DOUBLE") {
return Math.floor(val1);

View file

@ -150,10 +150,10 @@ function readVariables({ makiFile, classes }) {
const subClass = makiFile.readUInt16LE();
const uinit1 = makiFile.readUInt16LE();
const uinit2 = makiFile.readUInt16LE();
const uinit3 = makiFile.readUInt16LE();
const uinit4 = makiFile.readUInt16LE();
makiFile.readUInt16LE(); // uinit3
makiFile.readUInt16LE(); //uinit4
const global = makiFile.readUInt8();
const system = makiFile.readUInt8();
makiFile.readUInt8(); // system
if (object) {
const klass = classes[typeOffset];
@ -234,7 +234,7 @@ function readBindings(makiFile) {
return bindings;
}
function decodeCode({ makiFile, classes, variables, methods }) {
function decodeCode({ makiFile }) {
const length = makiFile.readUInt32LE();
const start = makiFile.getPosition();
@ -310,12 +310,7 @@ function parse(buffer) {
const variables = readVariables({ makiFile: makiFile, classes });
readConstants({ makiFile: makiFile, variables });
const bindings = readBindings(makiFile);
const commands = decodeCode({
makiFile,
classes,
variables,
methods,
});
const commands = decodeCode({ makiFile });
// Map binary offsets to command indexes.
// Some bindings/functions ask us to jump to a place in the binary data and

View file

@ -59,8 +59,8 @@ export function run({
});
});
const { commands, variables } = program;
commands.forEach((command, i) => {
const { commands /* variables */ } = program;
commands.forEach((/* command, i*/) => {
// printCommand({ i, command, stack: [], variables });
});

View file

@ -0,0 +1,7 @@
{
"rules": {
// TODO: Turn these all back on
// For now we want to be able to define maki method arguments even though we don't use them.
"@typescript-eslint/no-unused-vars": "off"
}
}

View file

@ -1,5 +1,5 @@
import MakiObject from "./MakiObject";
import { findDescendantByTypeAndId, unimplementedWarning } from "../utils";
import { findDescendantByTypeAndId } from "../utils";
class GuiObject extends MakiObject {
constructor(node, parent) {

View file

@ -1,5 +1,5 @@
import { ModernAppState, ModernAction } from "./types";
import { createStore, applyMiddleware, compose } from "redux";
import { createStore, applyMiddleware } from "redux";
import { composeWithDevTools } from "redux-devtools-extension";
import thunk from "redux-thunk";