nuke half the dependencies because they were unused.

This commit is contained in:
Olivier Gagnon 2021-10-14 19:31:17 -04:00
parent 6b114fab7d
commit 89a6bf175d
26 changed files with 2384 additions and 13975 deletions

22
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

14362
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -14,7 +14,6 @@
"@emotion/styled": "^11.3.0", "@emotion/styled": "^11.3.0",
"@monaco-editor/react": "^4.2.2", "@monaco-editor/react": "^4.2.2",
"@mui/icons-material": "^5.0.3", "@mui/icons-material": "^5.0.3",
"@mui/lab": "^5.0.0-alpha.46",
"@mui/material": "^5.0.3", "@mui/material": "^5.0.3",
"@mui/styles": "^5.0.1", "@mui/styles": "^5.0.1",
"@types/escodegen": "^0.0.7", "@types/escodegen": "^0.0.7",
@ -25,47 +24,23 @@
"@types/react-resizable": "^1.7.3", "@types/react-resizable": "^1.7.3",
"acorn": "^8.4.1", "acorn": "^8.4.1",
"acorn-walk": "^8.1.1", "acorn-walk": "^8.1.1",
"ajv": "^5.1.5",
"ajv-keywords": "^2.0.0",
"arg": "^5.0.0", "arg": "^5.0.0",
"async": "^2.6.1",
"autosize": "^4.0.2",
"better-react-mathjax": "^1.0.3", "better-react-mathjax": "^1.0.3",
"brace": "^0.11.1", "clsx": "^1.1.1",
"codemirror": "^5.58.2",
"decimal.js": "7.2.3", "decimal.js": "7.2.3",
"enhanced-resolve": "^4.0.0",
"escodegen": "^1.11.0", "escodegen": "^1.11.0",
"escope": "^3.6.0",
"file-saver": "^1.3.8", "file-saver": "^1.3.8",
"interpret": "^1.0.0",
"jquery": "^3.5.0", "jquery": "^3.5.0",
"jshint": "^2.10.2",
"json-loader": "^0.5.4",
"jsplumb": "^2.6.8",
"jszip": "^3.7.0", "jszip": "^3.7.0",
"loader-runner": "^2.3.0",
"loader-utils": "^1.1.0",
"material-ui-color": "^1.2.0", "material-ui-color": "^1.2.0",
"mathjax-full": "^3.2.0",
"memory-fs": "~0.4.1",
"monaco-editor": "^0.27.0", "monaco-editor": "^0.27.0",
"node-sass": "^6.0.1",
"normalize.css": "^8.0.0",
"notistack": "^2.0.2", "notistack": "^2.0.2",
"numeral": "2.0.6", "numeral": "2.0.6",
"react": "^17.0.2", "react": "^17.0.2",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-draggable": "^4.4.4", "react-draggable": "^4.4.4",
"react-modal": "^3.12.1",
"react-resizable": "^3.0.4", "react-resizable": "^3.0.4",
"sprintf-js": "^1.1.1", "sprintf-js": "^1.1.1"
"tapable": "^1.0.0",
"treant-js": "^1.0.1",
"unused-webpack-plugin": "^2.4.0",
"uuid": "^3.2.1",
"w3c-blob": "0.0.1",
"webpack-deadcode-plugin": "^0.1.15"
}, },
"description": "A cyberpunk-themed incremental game", "description": "A cyberpunk-themed incremental game",
"devDependencies": { "devDependencies": {
@ -76,64 +51,33 @@
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
"@testing-library/cypress": "^8.0.1", "@testing-library/cypress": "^8.0.1",
"@types/file-saver": "^2.0.3", "@types/file-saver": "^2.0.3",
"@types/jest": "^27.0.1",
"@types/lodash": "^4.14.168", "@types/lodash": "^4.14.168",
"@types/node": "^16.9.1",
"@typescript-eslint/eslint-plugin": "^4.22.0", "@typescript-eslint/eslint-plugin": "^4.22.0",
"@typescript-eslint/parser": "^4.22.0", "@typescript-eslint/parser": "^4.22.0",
"babel-jest": "^27.0.6", "babel-jest": "^27.0.6",
"babel-loader": "^8.0.5", "babel-loader": "^8.0.5",
"beautify-lint": "^1.0.3",
"benchmark": "^2.1.1",
"bundle-loader": "~0.5.0",
"css-loader": "^0.28.11",
"cypress": "^8.3.1", "cypress": "^8.3.1",
"electron": "^14.0.1", "electron": "^14.0.1",
"electron-packager": "^15.4.0", "electron-packager": "^15.4.0",
"es6-promise-polyfill": "^1.1.1",
"eslint": "^7.24.0", "eslint": "^7.24.0",
"eslint-plugin-node": "^11.1.0",
"file-loader": "^1.1.11",
"fork-ts-checker-webpack-plugin": "^6.3.3", "fork-ts-checker-webpack-plugin": "^6.3.3",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"http-server": "^13.0.1", "http-server": "^13.0.1",
"i18n-webpack-plugin": "^1.0.0",
"istanbul": "^0.4.5",
"jest": "^27.1.0", "jest": "^27.1.0",
"js-beautify": "^1.5.10", "js-beautify": "^1.5.10",
"jsdom": "^15.0.0", "jsdom": "^15.0.0",
"jsdom-global": "^3.0.2",
"json5": "^1.0.1",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mini-css-extract-plugin": "^0.4.1", "mini-css-extract-plugin": "^0.4.1",
"mkdirp": "^0.5.1",
"null-loader": "^1.0.0",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"raw-loader": "~0.5.0",
"react-refresh": "^0.10.0", "react-refresh": "^0.10.0",
"regenerator-runtime": "^0.13.9", "regenerator-runtime": "^0.13.9",
"sass-loader": "^7.0.3",
"script-loader": "~0.7.0",
"should": "^11.1.1",
"simple-git": "^1.96.0",
"sinon": "^2.3.2",
"source-map": "^0.7.3", "source-map": "^0.7.3",
"start-server-and-test": "^1.14.0", "start-server-and-test": "^1.14.0",
"style-loader": "^0.21.0",
"stylelint": "^9.2.1",
"stylelint-order": "^0.8.1",
"typescript": "^4.2.4", "typescript": "^4.2.4",
"uglify-es": "^3.3.9",
"uglifyjs-webpack-plugin": "^1.3.0",
"url-loader": "^1.0.1",
"watchpack": "^1.6.0",
"webpack": "^4.46.0", "webpack": "^4.46.0",
"webpack-cli": "^3.3.12", "webpack-cli": "^3.3.12",
"webpack-dev-middleware": "^3.7.3", "webpack-dev-middleware": "^3.7.3",
"webpack-dev-server": "^3.11.2", "webpack-dev-server": "^3.11.2"
"worker-loader": "^2.0.0"
}, },
"engines": { "engines": {
"node": ">=8 || <=9" "node": ">=8 || <=9"
@ -157,7 +101,6 @@
"build:dev": "webpack --mode development", "build:dev": "webpack --mode development",
"lint": "npm run lint:jsts & npm run lint:style", "lint": "npm run lint:jsts & npm run lint:style",
"lint:jsts": "eslint --fix . --ext js,jsx,ts,tsx", "lint:jsts": "eslint --fix . --ext js,jsx,ts,tsx",
"lint:style": "stylelint --fix ./css/*",
"preinstall": "node ./scripts/engines-check.js", "preinstall": "node ./scripts/engines-check.js",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",

@ -2,366 +2,433 @@ const numSpaces = 4;
const maxLineLength = 160; const maxLineLength = 160;
module.exports = { module.exports = {
env: { "env": {
es6: true, "es6": true,
node: true, "node": true
},
extends: "eslint:recommended",
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
}, },
ecmaVersion: 8, "extends": "eslint:recommended",
sourceType: "module", "parserOptions": {
}, "ecmaFeatures": {
rules: { "experimentalObjectRestSpread": true
"accessor-pairs": [ },
"error", "ecmaVersion": 8,
{ "sourceType": "module"
getWithoutSet: false, },
setWithoutGet: true, "rules": {
}, "accessor-pairs": [
], "error",
"array-bracket-newline": ["error"], {
"array-bracket-spacing": ["error"], "getWithoutSet": false,
"array-callback-return": ["error"], "setWithoutGet": true
"array-element-newline": ["error"], }
"arrow-body-style": ["error"], ],
"arrow-parens": ["error"], "array-bracket-newline": ["error"],
"arrow-spacing": ["error"], "array-bracket-spacing": ["error"],
"block-scoped-var": ["error"], "array-callback-return": ["error"],
"block-spacing": ["error"], "array-element-newline": ["error"],
"brace-style": ["error"], "arrow-body-style": ["error"],
"callback-return": ["error"], "arrow-parens": ["error"],
camelcase: ["error"], "arrow-spacing": ["error"],
"capitalized-comments": ["error"], "block-scoped-var": ["error"],
"class-methods-use-this": ["error"], "block-spacing": ["error"],
"comma-dangle": ["error"], "brace-style": ["error"],
"comma-spacing": ["error"], "callback-return": ["error"],
"comma-style": ["error", "last"], "camelcase": ["error"],
complexity: ["error"], "capitalized-comments": ["error"],
"computed-property-spacing": ["error", "never"], "class-methods-use-this": ["error"],
"consistent-return": ["error"], "comma-dangle": ["error"],
"consistent-this": ["error"], "comma-spacing": ["error"],
"constructor-super": ["error"], "comma-style": [
curly: ["error"], "error",
"default-case": ["error"], "last"
"dot-location": ["error", "property"], ],
"dot-notation": ["error"], "complexity": ["error"],
"eol-last": ["error"], "computed-property-spacing": [
eqeqeq: ["error"], "error",
"for-direction": ["error"], "never"
"func-call-spacing": ["error"], ],
"func-name-matching": ["error"], "consistent-return": ["error"],
"func-names": ["error", "never"], "consistent-this": ["error"],
"func-style": ["error"], "constructor-super": ["error"],
"function-paren-newline": ["error"], "curly": ["error"],
"generator-star-spacing": ["error", "before"], "default-case": ["error"],
"getter-return": [ "dot-location": [
"error", "error",
{ "property"
allowImplicit: false, ],
}, "dot-notation": ["error"],
], "eol-last": ["error"],
"global-require": ["error"], "eqeqeq": ["error"],
"guard-for-in": ["error"], "for-direction": ["error"],
"handle-callback-err": ["error"], "func-call-spacing": ["error"],
"id-blacklist": ["error"], "func-name-matching": ["error"],
"id-length": ["error"], "func-names": [
"id-match": ["error"], "error",
"implicit-arrow-linebreak": ["error", "beside"], "never"
indent: [ ],
"error", "func-style": ["error"],
numSpaces, "function-paren-newline": ["error"],
{ "generator-star-spacing": [
SwitchCase: 1, "error",
}, "before"
], ],
"init-declarations": ["error"], "getter-return": [
"jsx-quotes": ["error"], "error",
"key-spacing": ["error"], {
"keyword-spacing": ["error"], "allowImplicit": false
"line-comment-position": ["error"], }
"linebreak-style": ["error", "windows"], ],
"lines-around-comment": ["error"], "global-require": ["error"],
"lines-between-class-members": ["error"], "guard-for-in": ["error"],
"max-depth": ["error"], "handle-callback-err": ["error"],
"max-len": ["error", maxLineLength], "id-blacklist": ["error"],
"max-lines": [ "id-length": ["error"],
"error", "id-match": ["error"],
{ "implicit-arrow-linebreak": [
skipBlankLines: true, "error",
skipComments: true, "beside"
}, ],
], "indent": [
"max-nested-callbacks": ["error"], "error",
"max-params": ["error"], numSpaces,
"max-statements": ["error"], {
"max-statements-per-line": ["error"], "SwitchCase": 1
"multiline-comment-style": ["off", "starred-block"], }
"multiline-ternary": ["error", "never"], ],
"new-cap": ["error"], "init-declarations": ["error"],
"new-parens": ["error"], "jsx-quotes": ["error"],
// TODO: configure this... "key-spacing": ["error"],
"newline-before-return": ["error"], "keyword-spacing": ["error"],
"newline-per-chained-call": ["error"], "line-comment-position": ["error"],
"no-alert": ["error"], "linebreak-style": [
"no-array-constructor": ["error"], "error",
"no-await-in-loop": ["error"], "windows"
"no-bitwise": ["error"], ],
"no-buffer-constructor": ["error"], "lines-around-comment": ["error"],
"no-caller": ["error"], "lines-between-class-members": ["error"],
"no-case-declarations": ["error"], "max-depth": ["error"],
"no-catch-shadow": ["error"], "max-len": [
"no-class-assign": ["error"], "error",
"no-compare-neg-zero": ["error"], maxLineLength
"no-cond-assign": ["error", "except-parens"], ],
"no-confusing-arrow": ["error"], "max-lines": [
"no-console": ["error"], "error",
"no-const-assign": ["error"], {
"no-constant-condition": [ "skipBlankLines": true,
"error", "skipComments": true
{ }
checkLoops: false, ],
}, "max-nested-callbacks": ["error"],
], "max-params": ["error"],
"no-continue": ["off"], "max-statements": ["error"],
"no-control-regex": ["error"], "max-statements-per-line": ["error"],
"no-debugger": ["error"], "multiline-comment-style": [
"no-delete-var": ["error"], "off",
"no-div-regex": ["error"], "starred-block"
"no-dupe-args": ["error"], ],
"no-dupe-class-members": ["error"], "multiline-ternary": [
"no-dupe-keys": ["error"], "error",
"no-duplicate-case": ["error"], "never"
"no-duplicate-imports": [ ],
"error", "new-cap": ["error"],
{ "new-parens": ["error"],
includeExports: true, // TODO: configure this...
}, "newline-before-return": ["error"],
], "newline-per-chained-call": ["error"],
"no-else-return": ["error"], "no-alert": ["error"],
"no-empty": [ "no-array-constructor": ["error"],
"error", "no-await-in-loop": ["error"],
{ "no-bitwise": ["error"],
allowEmptyCatch: false, "no-buffer-constructor": ["error"],
}, "no-caller": ["error"],
], "no-case-declarations": ["error"],
"no-empty-character-class": ["error"], "no-catch-shadow": ["error"],
"no-empty-function": ["error"], "no-class-assign": ["error"],
"no-empty-pattern": ["error"], "no-compare-neg-zero": ["error"],
"no-eq-null": ["error"], "no-cond-assign": [
"no-eval": ["error"], "error",
"no-ex-assign": ["error"], "except-parens"
"no-extend-native": ["error"], ],
"no-extra-bind": ["error"], "no-confusing-arrow": ["error"],
"no-extra-boolean-cast": ["error"], "no-console": ["error"],
"no-extra-label": ["error"], "no-const-assign": ["error"],
"no-extra-parens": [ "no-constant-condition": [
"error", "error",
"all", {
{ "checkLoops": false
conditionalAssign: false, }
}, ],
], "no-continue": ["off"],
"no-extra-semi": ["error"], "no-control-regex": ["error"],
"no-fallthrough": ["error"], "no-debugger": ["error"],
"no-floating-decimal": ["error"], "no-delete-var": ["error"],
"no-func-assign": ["error"], "no-div-regex": ["error"],
"no-global-assign": ["error"], "no-dupe-args": ["error"],
"no-implicit-coercion": ["error"], "no-dupe-class-members": ["error"],
"no-implicit-globals": ["error"], "no-dupe-keys": ["error"],
"no-implied-eval": ["error"], "no-duplicate-case": ["error"],
"no-inline-comments": ["error"], "no-duplicate-imports": [
"no-inner-declarations": ["error", "both"], "error",
"no-invalid-regexp": ["error"], {
"no-invalid-this": ["error"], "includeExports": true
"no-irregular-whitespace": [ }
"error", ],
{ "no-else-return": ["error"],
skipComments: false, "no-empty": [
skipRegExps: false, "error",
skipStrings: false, {
skipTemplates: false, "allowEmptyCatch": false
}, }
], ],
"no-iterator": ["error"], "no-empty-character-class": ["error"],
"no-label-var": ["error"], "no-empty-function": ["error"],
"no-labels": ["error"], "no-empty-pattern": ["error"],
"no-lone-blocks": ["error"], "no-eq-null": ["error"],
"no-lonely-if": ["error"], "no-eval": ["error"],
"no-loop-func": ["error"], "no-ex-assign": ["error"],
"no-magic-numbers": [ "no-extend-native": ["error"],
"error", "no-extra-bind": ["error"],
{ "no-extra-boolean-cast": ["error"],
ignore: [-1, 0, 1], "no-extra-label": ["error"],
ignoreArrayIndexes: true, "no-extra-parens": [
}, "error",
], "all",
"no-mixed-operators": ["error"], {
"no-mixed-requires": ["error"], "conditionalAssign": false
"no-mixed-spaces-and-tabs": ["error"], }
"no-multi-assign": ["error"], ],
"no-multi-spaces": ["error"], "no-extra-semi": ["error"],
"no-multi-str": ["error"], "no-fallthrough": ["error"],
"no-multiple-empty-lines": [ "no-floating-decimal": ["error"],
"error", "no-func-assign": ["error"],
{ "no-global-assign": ["error"],
max: 1, "no-implicit-coercion": ["error"],
}, "no-implicit-globals": ["error"],
], "no-implied-eval": ["error"],
"no-native-reassign": ["error"], "no-inline-comments": ["error"],
"no-negated-condition": ["error"], "no-inner-declarations": [
"no-negated-in-lhs": ["error"], "error",
"no-nested-ternary": ["error"], "both"
"no-new": ["error"], ],
"no-new-func": ["error"], "no-invalid-regexp": ["error"],
"no-new-object": ["error"], "no-invalid-this": ["error"],
"no-new-require": ["error"], "no-irregular-whitespace": [
"no-new-symbol": ["error"], "error",
"no-new-wrappers": ["error"], {
"no-obj-calls": ["error"], "skipComments": false,
"no-octal": ["error"], "skipRegExps": false,
"no-octal-escape": ["error"], "skipStrings": false,
"no-param-reassign": ["error"], "skipTemplates": false
"no-path-concat": ["error"], }
"no-plusplus": [ ],
"error", "no-iterator": ["error"],
{ "no-label-var": ["error"],
allowForLoopAfterthoughts: true, "no-labels": ["error"],
}, "no-lone-blocks": ["error"],
], "no-lonely-if": ["error"],
"no-process-env": ["error"], "no-loop-func": ["error"],
"no-process-exit": ["error"], "no-magic-numbers": [
"no-proto": ["error"], "error",
"no-prototype-builtins": ["error"], {
"no-redeclare": ["error"], "ignore": [
"no-regex-spaces": ["error"], -1,
"no-restricted-globals": ["error"], 0,
"no-restricted-imports": ["error"], 1
"no-restricted-modules": ["error"], ],
"no-restricted-properties": [ "ignoreArrayIndexes": true
"error", }
{ ],
message: "'log' is too general, use an appropriate level when logging.", "no-mixed-operators": ["error"],
object: "console", "no-mixed-requires": ["error"],
property: "log", "no-mixed-spaces-and-tabs": ["error"],
}, "no-multi-assign": ["error"],
], "no-multi-spaces": ["error"],
"no-restricted-syntax": ["error"], "no-multi-str": ["error"],
"no-return-assign": ["error"], "no-multiple-empty-lines": [
"no-return-await": ["error"], "error",
"no-script-url": ["error"], {
"no-self-assign": [ "max": 1
"error", }
{ ],
props: false, "no-native-reassign": ["error"],
}, "no-negated-condition": ["error"],
], "no-negated-in-lhs": ["error"],
"no-self-compare": ["error"], "no-nested-ternary": ["error"],
"no-sequences": ["error"], "no-new": ["error"],
"no-shadow": ["error"], "no-new-func": ["error"],
"no-shadow-restricted-names": ["error"], "no-new-object": ["error"],
"no-spaced-func": ["error"], "no-new-require": ["error"],
"no-sparse-arrays": ["error"], "no-new-symbol": ["error"],
"no-sync": ["error"], "no-new-wrappers": ["error"],
"no-tabs": ["error"], "no-obj-calls": ["error"],
"no-template-curly-in-string": ["error"], "no-octal": ["error"],
"no-ternary": ["off"], "no-octal-escape": ["error"],
"no-this-before-super": ["error"], "no-param-reassign": ["error"],
"no-throw-literal": ["error"], "no-path-concat": ["error"],
"no-trailing-spaces": ["error"], "no-plusplus": [
"no-undef": ["error"], "error",
"no-undef-init": ["error"], {
"no-undefined": ["error"], "allowForLoopAfterthoughts": true
"no-underscore-dangle": ["error"], }
"no-unexpected-multiline": ["error"], ],
"no-unmodified-loop-condition": ["error"], "no-process-env": ["error"],
"no-unneeded-ternary": ["error"], "no-process-exit": ["error"],
"no-unreachable": ["error"], "no-proto": ["error"],
"no-unsafe-finally": ["error"], "no-prototype-builtins": ["error"],
"no-unsafe-negation": ["error"], "no-redeclare": ["error"],
"no-unused-expressions": ["error"], "no-regex-spaces": ["error"],
"no-unused-labels": ["error"], "no-restricted-globals": ["error"],
"no-unused-vars": ["error"], "no-restricted-imports": ["error"],
"no-use-before-define": ["error"], "no-restricted-modules": ["error"],
"no-useless-call": ["error"], "no-restricted-properties": [
"no-useless-computed-key": ["error"], "error",
"no-useless-concat": ["error"], {
"no-useless-constructor": ["error"], "message": "'log' is too general, use an appropriate level when logging.",
"no-useless-escape": ["error"], "object": "console",
"no-useless-rename": [ "property": "log"
"error", }
{ ],
ignoreDestructuring: false, "no-restricted-syntax": ["error"],
ignoreExport: false, "no-return-assign": ["error"],
ignoreImport: false, "no-return-await": ["error"],
}, "no-script-url": ["error"],
], "no-self-assign": [
"no-useless-return": ["error"], "error",
"no-var": ["error"], {
"no-void": ["error"], "props": false
"no-warning-comments": ["error"], }
"no-whitespace-before-property": ["error"], ],
"no-with": ["error"], "no-self-compare": ["error"],
"nonblock-statement-body-position": ["error", "below"], "no-sequences": ["error"],
"object-curly-newline": ["error"], "no-shadow": ["error"],
"object-curly-spacing": ["error"], "no-shadow-restricted-names": ["error"],
"object-property-newline": ["error"], "no-spaced-func": ["error"],
"object-shorthand": ["error"], "no-sparse-arrays": ["error"],
"one-var": ["off"], "no-sync": ["error"],
"one-var-declaration-per-line": ["error"], "no-tabs": ["error"],
"operator-assignment": ["error"], "no-template-curly-in-string": ["error"],
"operator-linebreak": ["error", "none"], "no-ternary": ["off"],
"padded-blocks": ["off"], "no-this-before-super": ["error"],
"padding-line-between-statements": ["error"], "no-throw-literal": ["error"],
"prefer-arrow-callback": ["error"], "no-trailing-spaces": ["error"],
"prefer-const": ["error"], "no-undef": ["error"],
"prefer-destructuring": ["off"], "no-undef-init": ["error"],
"prefer-numeric-literals": ["error"], "no-undefined": ["error"],
"prefer-promise-reject-errors": ["off"], "no-underscore-dangle": ["error"],
"prefer-reflect": ["error"], "no-unexpected-multiline": ["error"],
"prefer-rest-params": ["error"], "no-unmodified-loop-condition": ["error"],
"prefer-spread": ["error"], "no-unneeded-ternary": ["error"],
"prefer-template": ["error"], "no-unreachable": ["error"],
"quote-props": ["error"], "no-unsafe-finally": ["error"],
quotes: ["error"], "no-unsafe-negation": ["error"],
radix: ["error", "as-needed"], "no-unused-expressions": ["error"],
"require-await": ["error"], "no-unused-labels": ["error"],
"require-jsdoc": ["off"], "no-unused-vars": ["error"],
"require-yield": ["error"], "no-use-before-define": ["error"],
"rest-spread-spacing": ["error", "never"], "no-useless-call": ["error"],
semi: ["error"], "no-useless-computed-key": ["error"],
"semi-spacing": ["error"], "no-useless-concat": ["error"],
"semi-style": ["error", "last"], "no-useless-constructor": ["error"],
"sort-imports": ["error"], "no-useless-escape": ["error"],
"sort-keys": ["error"], "no-useless-rename": [
"sort-vars": ["error"], "error",
"space-before-blocks": ["error"], {
"space-before-function-paren": ["off"], "ignoreDestructuring": false,
"space-in-parens": ["error"], "ignoreExport": false,
"space-infix-ops": ["error"], "ignoreImport": false
"space-unary-ops": ["error"], }
"spaced-comment": ["error"], ],
strict: ["error"], "no-useless-return": ["error"],
"switch-colon-spacing": [ "no-var": ["error"],
"error", "no-void": ["error"],
{ "no-warning-comments": ["error"],
after: true, "no-whitespace-before-property": ["error"],
before: false, "no-with": ["error"],
}, "nonblock-statement-body-position": [
], "error",
"symbol-description": ["error"], "below"
"template-curly-spacing": ["error"], ],
"template-tag-spacing": ["error"], "object-curly-newline": ["error"],
"unicode-bom": ["error", "never"], "object-curly-spacing": ["error"],
"use-isnan": ["error"], "object-property-newline": ["error"],
"valid-jsdoc": ["error"], "object-shorthand": ["error"],
"valid-typeof": ["error"], "one-var": ["off"],
"vars-on-top": ["error"], "one-var-declaration-per-line": ["error"],
"wrap-iife": ["error", "any"], "operator-assignment": ["error"],
"wrap-regex": ["error"], "operator-linebreak": [
"yield-star-spacing": ["error", "before"], "error",
yoda: ["error", "never"], "none"
}, ],
"padded-blocks": ["off"],
"padding-line-between-statements": ["error"],
"prefer-arrow-callback": ["error"],
"prefer-const": ["error"],
"prefer-destructuring": ["off"],
"prefer-numeric-literals": ["error"],
"prefer-promise-reject-errors": ["off"],
"prefer-reflect": ["error"],
"prefer-rest-params": ["error"],
"prefer-spread": ["error"],
"prefer-template": ["error"],
"quote-props": ["error"],
"quotes": ["error"],
"radix": [
"error",
"as-needed"
],
"require-await": ["error"],
"require-jsdoc": ["off"],
"require-yield": ["error"],
"rest-spread-spacing": [
"error",
"never"
],
"semi": ["error"],
"semi-spacing": ["error"],
"semi-style": [
"error",
"last"
],
"sort-imports": ["error"],
"sort-keys": ["error"],
"sort-vars": ["error"],
"space-before-blocks": ["error"],
"space-before-function-paren": ["off"],
"space-in-parens": ["error"],
"space-infix-ops": ["error"],
"space-unary-ops": ["error"],
"spaced-comment": ["error"],
"strict": ["error"],
"switch-colon-spacing": [
"error",
{
"after": true,
"before": false
}
],
"symbol-description": ["error"],
"template-curly-spacing": ["error"],
"template-tag-spacing": ["error"],
"unicode-bom": [
"error",
"never"
],
"use-isnan": ["error"],
"valid-jsdoc": ["error"],
"valid-typeof": ["error"],
"vars-on-top": ["error"],
"wrap-iife": [
"error",
"any"
],
"wrap-regex": ["error"],
"yield-star-spacing": [
"error",
"before"
],
"yoda": [
"error",
"never"
]
}
}; };

@ -8,74 +8,66 @@ const path = require("path");
const exec = require("child_process").exec; const exec = require("child_process").exec;
const semver = require("./semver"); const semver = require("./semver");
const getPackageJson = () => const getPackageJson = () => new Promise((resolve, reject) => {
new Promise((resolve, reject) => {
try { try {
/* eslint-disable-next-line global-require */ /* eslint-disable-next-line global-require */
resolve(require(path.resolve(process.cwd(), "package.json"))); resolve(require(path.resolve(process.cwd(), "package.json")));
} catch (error) { } catch (error) {
reject(error); reject(error);
} }
}); });
const getEngines = (data) => const getEngines = (data) => new Promise((resolve, reject) => {
new Promise((resolve, reject) => {
let versions = null; let versions = null;
if (data.engines) { if (data.engines) {
versions = data.engines; versions = data.engines;
} }
if (versions) { if (versions) {
resolve(versions); resolve(versions);
} else { } else {
reject("Missing or improper 'engines' property in 'package.json'"); reject("Missing or improper 'engines' property in 'package.json'");
} }
}); });
const checkNpmVersion = (engines) => const checkNpmVersion = (engines) => new Promise((resolve, reject) => {
new Promise((resolve, reject) => {
exec("npm -v", (error, stdout, stderr) => { exec("npm -v", (error, stdout, stderr) => {
if (error) { if (error) {
reject(`Unable to find NPM version\n${stderr}`); reject(`Unable to find NPM version\n${stderr}`);
} }
const npmVersion = stdout.trim(); const npmVersion = stdout.trim();
const engineVersion = engines.npm || ">=0"; const engineVersion = engines.npm || ">=0";
if (semver.satisfies(npmVersion, engineVersion)) { if (semver.satisfies(npmVersion, engineVersion)) {
resolve(); resolve();
} else { } else {
reject( reject(`Incorrect npm version\n'package.json' specifies "${engineVersion}", you are currently running "${npmVersion}".`);
`Incorrect npm version\n'package.json' specifies "${engineVersion}", you are currently running "${npmVersion}".`, }
);
}
}); });
}); });
const checkNodeVersion = (engines) => const checkNodeVersion = (engines) => new Promise((resolve, reject) => {
new Promise((resolve, reject) => {
const nodeVersion = process.version.substring(1); const nodeVersion = process.version.substring(1);
if (semver.satisfies(nodeVersion, engines.node)) { if (semver.satisfies(nodeVersion, engines.node)) {
resolve(engines); resolve(engines);
} else { } else {
reject( reject(`Incorrect node version\n'package.json' specifies "${engines.node}", you are currently running "${process.version}".`);
`Incorrect node version\n'package.json' specifies "${engines.node}", you are currently running "${process.version}".`,
);
} }
}); });
getPackageJson() getPackageJson()
.then(getEngines) .then(getEngines)
.then(checkNodeVersion) .then(checkNodeVersion)
.then(checkNpmVersion) .then(checkNpmVersion)
.then( .then(
() => true, () => true,
(error) => { (error) => {
// Specifically disable these as the error message gets lost in the normal unhandled output. // Specifically disable these as the error message gets lost in the normal unhandled output.
/* eslint-disable no-console, no-process-exit */ /* eslint-disable no-console, no-process-exit */
console.error(error); console.error(error);
process.exit(1); process.exit(1);
}, }
); );

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
import { IBladeburner } from "./IBladeburner"; import { IBladeburner } from "./IBladeburner";
export interface IStatsMultiplier { interface IStatsMultiplier {
[key: string]: number; [key: string]: number;
hack: number; hack: number;

@ -1,4 +1,4 @@
export interface RNG { interface RNG {
random(): number; random(): number;
} }

@ -45,7 +45,7 @@ export function generateRandomContractOnHome(): void {
serv.addContract(contract); serv.addContract(contract);
} }
export interface IGenerateContractParams { interface IGenerateContractParams {
problemType?: string; problemType?: string;
server?: string; server?: string;
fn?: string; fn?: string;

@ -4,7 +4,7 @@ import { IPlayerOrSleeve } from "../PersonObjects/IPlayerOrSleeve";
import { IRouter } from "../ui/Router"; import { IRouter } from "../ui/Router";
import { WorkerScript } from "../Netscript/WorkerScript"; import { WorkerScript } from "../Netscript/WorkerScript";
export interface IConstructorParams { interface IConstructorParams {
hacking_success_weight?: number; hacking_success_weight?: number;
strength_success_weight?: number; strength_success_weight?: number;
defense_success_weight?: number; defense_success_weight?: number;

@ -5,7 +5,7 @@ import { ITaskParams } from "../ITaskParams";
* Defines the parameters that can be used to initialize and describe a GangMemberTask * Defines the parameters that can be used to initialize and describe a GangMemberTask
* (defined in Gang.js) * (defined in Gang.js)
*/ */
export interface IGangMemberTaskMetadata { interface IGangMemberTaskMetadata {
/** /**
* Description of the task * Description of the task
*/ */

@ -19,7 +19,7 @@ export enum UpgradeType {
* Defines the parameters that can be used to initialize and describe a GangMemberUpgrade * Defines the parameters that can be used to initialize and describe a GangMemberUpgrade
* (defined in Gang.js) * (defined in Gang.js)
*/ */
export interface IGangMemberUpgradeMetadata { interface IGangMemberUpgradeMetadata {
cost: number; cost: number;
mults: IMults; mults: IMults;
name: string; name: string;

@ -69,6 +69,7 @@ export function TechVendorLocation(props: IProps): React.ReactElement {
return ( return (
<> <>
<br />
{purchaseServerButtons} {purchaseServerButtons}
<br /> <br />
<Typography> <Typography>

@ -24,7 +24,7 @@ function bitFlumeRequirements() {
}; };
} }
export interface IProgramCreationParams { interface IProgramCreationParams {
key: string; key: string;
name: string; name: string;
create: IProgramCreate | null; create: IProgramCreate | null;

@ -1,7 +1,7 @@
export type Position = { interface Position {
row: number; row: number;
column: number; column: number;
}; }
class PositionTracker { class PositionTracker {
positions: Map<string, Position>; positions: Map<string, Position>;

@ -1,14 +1,6 @@
import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
import { CONSTANTS } from "../Constants"; import { CONSTANTS } from "../Constants";
export function getStockMarketAccountCost(): number {
return CONSTANTS.WSEAccountCost;
}
export function getStockMarketTixApiCost(): number {
return CONSTANTS.TIXAPICost;
}
export function getStockMarket4SDataCost(): number { export function getStockMarket4SDataCost(): number {
return CONSTANTS.MarketData4SCost * BitNodeMultipliers.FourSigmaMarketDataCost; return CONSTANTS.MarketData4SCost * BitNodeMultipliers.FourSigmaMarketDataCost;
} }

@ -15,7 +15,7 @@ import { IPlayer } from "../../PersonObjects/IPlayer";
import { EventEmitter } from "../../utils/EventEmitter"; import { EventEmitter } from "../../utils/EventEmitter";
type txFn = (stock: Stock, shares: number) => boolean; type txFn = (stock: Stock, shares: number) => boolean;
export type placeOrderFn = ( type placeOrderFn = (
stock: Stock, stock: Stock,
shares: number, shares: number,
price: number, price: number,

@ -39,8 +39,8 @@ enum SelectorOrderType {
Stop = "Stop Order", Stop = "Stop Order",
} }
export type txFn = (stock: Stock, shares: number) => boolean; type txFn = (stock: Stock, shares: number) => boolean;
export type placeOrderFn = ( type placeOrderFn = (
stock: Stock, stock: Stock,
shares: number, shares: number,
price: number, price: number,

@ -16,8 +16,8 @@ import { PositionTypes } from "../data/PositionTypes";
import { IPlayer } from "../../PersonObjects/IPlayer"; import { IPlayer } from "../../PersonObjects/IPlayer";
import { EventEmitter } from "../../utils/EventEmitter"; import { EventEmitter } from "../../utils/EventEmitter";
export type txFn = (stock: Stock, shares: number) => boolean; type txFn = (stock: Stock, shares: number) => boolean;
export type placeOrderFn = ( type placeOrderFn = (
stock: Stock, stock: Stock,
shares: number, shares: number,
price: number, price: number,

@ -12,7 +12,7 @@ export type SolverFunc = (data: any, answer: string) => boolean;
Requires the 'data' of a Contract as input */ Requires the 'data' of a Contract as input */
export type DescriptionFunc = (data: any) => string; export type DescriptionFunc = (data: any) => string;
export interface ICodingContractTypeMetadata { interface ICodingContractTypeMetadata {
desc: DescriptionFunc; desc: DescriptionFunc;
difficulty: number; difficulty: number;
gen: GeneratorFunc; gen: GeneratorFunc;

@ -10,11 +10,6 @@ export interface IMap<T> {
[key: string]: T; [key: string]: T;
} }
/**
* Performs some action, with no returned value.
*/
export type Action = () => void;
/** /**
* Contains a method to initialize itself to a known state. * Contains a method to initialize itself to a known state.
*/ */

@ -4,7 +4,7 @@
type cbFn = (...args: any[]) => any; type cbFn = (...args: any[]) => any;
export interface ISubscriber { interface ISubscriber {
/** /**
* Callback function that will be run when an event is emitted * Callback function that will be run when an event is emitted
*/ */

@ -1,6 +1,6 @@
/* Generic Reviver, toJSON, and fromJSON functions used for saving and loading objects */ /* Generic Reviver, toJSON, and fromJSON functions used for saving and loading objects */
export interface IReviverValue { interface IReviverValue {
ctor: string; ctor: string;
data: any; data: any;
} }

@ -5,7 +5,6 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin");
const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin"); const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin"); const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin");
const DeadCodePlugin = require("webpack-deadcode-plugin");
module.exports = (env, argv) => { module.exports = (env, argv) => {
const isDevServer = (env || {}).devServer === true; const isDevServer = (env || {}).devServer === true;