diff --git a/.eslintignore b/.eslintignore index 7cb0ed0e8..e60718de5 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,6 +3,4 @@ doc/build/ dist/ tests/*.bundle.* src/ThirdParty/* -src/ScriptEditor/CodeMirrorNetscriptMode.js -src/ScriptEditor/CodeMirrorNetscriptLint.js src/JSInterpreter.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 2812ebcbf..f729e0acb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -69,29 +69,9 @@ module.exports = { "class-methods-use-this": [ "off", ], - "comma-dangle": [ - "error", { - "arrays": "always-multiline", - "objects": "always-multiline", - "imports": "always-multiline", - "exports": "always-multiline", - "functions": "always-multiline", - }, - ], - "comma-spacing": [ - "off", - ], - "comma-style": [ - "error", - "last", - ], "complexity": [ "off", ], - "computed-property-spacing": [ - "off", - "never", - ], "consistent-return": [ "off", ], @@ -107,10 +87,6 @@ module.exports = { "default-case": [ "off", ], - "dot-location": [ - "error", - "property", - ], "dot-notation": [ "off", ], @@ -139,10 +115,6 @@ module.exports = { "function-paren-newline": [ "off", ], - "generator-star-spacing": [ - "error", - "before", - ], "getter-return": [ "error", { @@ -180,9 +152,6 @@ module.exports = { "init-declarations": [ "off", ], - "jsx-quotes": [ - "error", - ], "key-spacing": [ "off", ], diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..0a8c737e6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +node_modules +package.json +dist +doc/build/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..e391e9ad6 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "trailingComma": "all", + "tabWidth": 2 +} diff --git a/css/casino.scss b/css/casino.scss index aceb02f17..ccb371740 100644 --- a/css/casino.scss +++ b/css/casino.scss @@ -4,14 +4,14 @@ background-color: white; display: inline-block; border-radius: 10px; - font-size: 14pt; + font-size: 18.5px; text-align: center; margin: 3px; font-weight: bold; } .casino-card .value { - font-size: 15pt; + font-size: 20px; font-family: sans-serif; } diff --git a/css/infiltration.scss b/css/infiltration.scss index c8b8da4e0..b15c68782 100644 --- a/css/infiltration.scss +++ b/css/infiltration.scss @@ -1,56 +1,56 @@ @import "theme"; .blinking-cursor { - font-weight: 100; - color: #2E3D48; - -webkit-animation: 1s cursorblink step-end infinite; - -moz-animation: 1s cursorblink step-end infinite; - -ms-animation: 1s cursorblink step-end infinite; - -o-animation: 1s cursorblink step-end infinite; - animation: 1s cursorblink step-end infinite; + font-weight: 100; + color: #2e3d48; + -webkit-animation: 1s cursorblink step-end infinite; + -moz-animation: 1s cursorblink step-end infinite; + -ms-animation: 1s cursorblink step-end infinite; + -o-animation: 1s cursorblink step-end infinite; + animation: 1s cursorblink step-end infinite; } -@keyframes "cursorblink" { - from, to { - color: transparent; - } - 50% { - color: $hacker-green; - } +@keyframes cursorblink { + from, to { + color: transparent; + } + 50% { + color: $hacker-green; + } } @-moz-keyframes cursorblink { - from, to { - color: transparent; - } - 50% { - color: $hacker-green; - } + from, to { + color: transparent; + } + 50% { + color: $hacker-green; + } } -@-webkit-keyframes "cursorblink" { - from, to { - color: transparent; - } - 50% { - color: $hacker-green; - } +@-webkit-keyframes cursorblink { + from, to { + color: transparent; + } + 50% { + color: $hacker-green; + } } -@-ms-keyframes "cursorblink" { - from, to { - color: transparent; - } - 50% { - color: $hacker-green; - } +@-ms-keyframes cursorblink { + from, to { + color: transparent; + } + 50% { + color: $hacker-green; + } } -@-o-keyframes "cursorblink" { - from, to { - color: transparent; - } - 50% { - color: $hacker-green; - } -} \ No newline at end of file +@-o-keyframes cursorblink { + from, to { + color: transparent; + } + 50% { + color: $hacker-green; + } +} diff --git a/css/interactivetutorial.scss b/css/interactivetutorial.scss index f6e0cebe4..7842bd3e3 100644 --- a/css/interactivetutorial.scss +++ b/css/interactivetutorial.scss @@ -87,4 +87,4 @@ color: #e6e6e6; padding: 3px; box-shadow: 0 0 3px #000; -} \ No newline at end of file +} diff --git a/css/popupboxes.scss b/css/popupboxes.scss index febd5ef4b..269cc089e 100644 --- a/css/popupboxes.scss +++ b/css/popupboxes.scss @@ -72,7 +72,6 @@ border: 5px solid var(--my-highlight-color); } - .log-box-container { display: flex; flex-flow: column; @@ -157,7 +156,7 @@ } .dialog-box-close-button:hover, -.dialog-box-close-button:focus,{ +.dialog-box-close-button:focus { color: #fff; text-decoration: none; cursor: pointer; diff --git a/css/scripteditor.scss b/css/scripteditor.scss index ce3add27e..287dbf3fe 100644 --- a/css/scripteditor.scss +++ b/css/scripteditor.scss @@ -104,4 +104,4 @@ flex: row nowrap; align-items: center; justify-content: start; -} \ No newline at end of file +} diff --git a/css/styles.scss b/css/styles.scss index 0377e2865..57786449e 100644 --- a/css/styles.scss +++ b/css/styles.scss @@ -346,7 +346,7 @@ a:visited { } .unbuyable { - color: #66CFBC; + color: #66cfbc; } .failure { diff --git a/doc/source/ystatic/agogo.css b/doc/source/ystatic/agogo.css index 3ff9bd04b..5112d7fcc 100644 --- a/doc/source/ystatic/agogo.css +++ b/doc/source/ystatic/agogo.css @@ -512,7 +512,7 @@ table.modindextable td { .viewcode-back { float: right; - font-family:: "Verdana", Arial, sans-serif; + font-family: "Verdana", Arial, sans-serif; } div.viewcode-block:target { diff --git a/package-lock.json b/package-lock.json index 1504c8dfc..1eeeaf3cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "bitburner", "version": "0.52.9", "hasInstallScript": true, "license": "SEE LICENSE IN license.txt", @@ -85,6 +86,7 @@ "mini-css-extract-plugin": "^0.4.1", "mkdirp": "^0.5.1", "null-loader": "^1.0.0", + "prettier": "^2.3.2", "raw-loader": "~0.5.0", "regenerator-runtime": "^0.13.9", "sass-loader": "^7.0.3", @@ -8184,6 +8186,7 @@ "version": "3.2.25", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "peer": true, "engines": { "node": ">=6" } @@ -14997,6 +15000,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/mathjax-full/-/mathjax-full-3.2.0.tgz", "integrity": "sha512-D2EBNvUG+mJyhn+M1C858k0f2Fc4KxXvbEX2WCMXroV10212JwfYqaBJ336ECBSz5X9L5LRoamxb7AJtg3KaJA==", + "peer": true, "dependencies": { "esm": "^3.2.25", "mhchemparser": "^4.1.0", @@ -15231,7 +15235,8 @@ "node_modules/mhchemparser": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/mhchemparser/-/mhchemparser-4.1.1.tgz", - "integrity": "sha512-R75CUN6O6e1t8bgailrF1qPq+HhVeFTM3XQ0uzI+mXTybmphy3b6h4NbLOYhemViQ3lUs+6CKRkC3Ws1TlYREA==" + "integrity": "sha512-R75CUN6O6e1t8bgailrF1qPq+HhVeFTM3XQ0uzI+mXTybmphy3b6h4NbLOYhemViQ3lUs+6CKRkC3Ws1TlYREA==", + "peer": true }, "node_modules/micromatch": { "version": "3.1.10", @@ -15484,7 +15489,8 @@ "node_modules/mj-context-menu": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/mj-context-menu/-/mj-context-menu-0.6.1.tgz", - "integrity": "sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==" + "integrity": "sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==", + "peer": true }, "node_modules/mkdirp": { "version": "0.5.1", @@ -17768,6 +17774,18 @@ "node": ">=0.10.0" } }, + "node_modules/prettier": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", + "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/pretty-error": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", @@ -20076,6 +20094,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/speech-rule-engine/-/speech-rule-engine-3.3.3.tgz", "integrity": "sha512-0exWw+0XauLjat+f/aFeo5T8SiDsO1JtwpY3qgJE4cWt+yL/Stl0WP4VNDWdh7lzGkubUD9lWP4J1ASnORXfyQ==", + "peer": true, "dependencies": { "commander": ">=7.0.0", "wicked-good-xpath": "^1.3.0", @@ -20089,6 +20108,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz", "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==", + "peer": true, "engines": { "node": ">= 12" } @@ -23548,7 +23568,8 @@ "node_modules/wicked-good-xpath": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/wicked-good-xpath/-/wicked-good-xpath-1.3.0.tgz", - "integrity": "sha1-gbDpXoZQ5JyUsiKY//hoa1VTz2w=" + "integrity": "sha1-gbDpXoZQ5JyUsiKY//hoa1VTz2w=", + "peer": true }, "node_modules/wide-align": { "version": "1.1.3", @@ -23695,6 +23716,7 @@ "version": "0.1.31", "resolved": "https://registry.npmjs.org/xmldom-sre/-/xmldom-sre-0.1.31.tgz", "integrity": "sha512-f9s+fUkX04BxQf+7mMWAp5zk61pciie+fFLC9hX9UVvCeJQfNHRHXpeo5MPcR0EUf57PYLdt+ZO4f3Ipk2oZUw==", + "peer": true, "engines": { "node": ">=0.1" } @@ -30301,7 +30323,8 @@ "esm": { "version": "3.2.25", "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==" + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "peer": true }, "espree": { "version": "7.3.1", @@ -35644,6 +35667,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/mathjax-full/-/mathjax-full-3.2.0.tgz", "integrity": "sha512-D2EBNvUG+mJyhn+M1C858k0f2Fc4KxXvbEX2WCMXroV10212JwfYqaBJ336ECBSz5X9L5LRoamxb7AJtg3KaJA==", + "peer": true, "requires": { "esm": "^3.2.25", "mhchemparser": "^4.1.0", @@ -35655,9 +35679,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/mathjax-react/-/mathjax-react-1.0.6.tgz", "integrity": "sha512-GlkPAhaY0FKc95TMdo33mxNZHb+3xRgfgc3YcnQ0cZxvnM1UaF0o8mRI5y5xIwi3JnioeYuukZJWCbIZkACIVw==", - "requires": { - "mathjax-full": "^3.0.4" - } + "requires": {} }, "mathml-tag-names": { "version": "2.1.0", @@ -35822,7 +35844,8 @@ "mhchemparser": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/mhchemparser/-/mhchemparser-4.1.1.tgz", - "integrity": "sha512-R75CUN6O6e1t8bgailrF1qPq+HhVeFTM3XQ0uzI+mXTybmphy3b6h4NbLOYhemViQ3lUs+6CKRkC3Ws1TlYREA==" + "integrity": "sha512-R75CUN6O6e1t8bgailrF1qPq+HhVeFTM3XQ0uzI+mXTybmphy3b6h4NbLOYhemViQ3lUs+6CKRkC3Ws1TlYREA==", + "peer": true }, "micromatch": { "version": "3.1.10", @@ -36031,7 +36054,8 @@ "mj-context-menu": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/mj-context-menu/-/mj-context-menu-0.6.1.tgz", - "integrity": "sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==" + "integrity": "sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==", + "peer": true }, "mkdirp": { "version": "0.5.1", @@ -37938,6 +37962,12 @@ "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", "dev": true }, + "prettier": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.2.tgz", + "integrity": "sha512-lnJzDfJ66zkMy58OL5/NY5zp70S7Nz6KqcKkXYzn2tMVrNxvbqaBpg7H3qHaLxCJ5lNMsGuM8+ohS7cZrthdLQ==", + "dev": true + }, "pretty-error": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", @@ -39922,6 +39952,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/speech-rule-engine/-/speech-rule-engine-3.3.3.tgz", "integrity": "sha512-0exWw+0XauLjat+f/aFeo5T8SiDsO1JtwpY3qgJE4cWt+yL/Stl0WP4VNDWdh7lzGkubUD9lWP4J1ASnORXfyQ==", + "peer": true, "requires": { "commander": ">=7.0.0", "wicked-good-xpath": "^1.3.0", @@ -39931,7 +39962,8 @@ "commander": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz", - "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==" + "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==", + "peer": true } } }, @@ -42796,7 +42828,8 @@ "wicked-good-xpath": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/wicked-good-xpath/-/wicked-good-xpath-1.3.0.tgz", - "integrity": "sha1-gbDpXoZQ5JyUsiKY//hoa1VTz2w=" + "integrity": "sha1-gbDpXoZQ5JyUsiKY//hoa1VTz2w=", + "peer": true }, "wide-align": { "version": "1.1.3", @@ -42923,7 +42956,8 @@ "xmldom-sre": { "version": "0.1.31", "resolved": "https://registry.npmjs.org/xmldom-sre/-/xmldom-sre-0.1.31.tgz", - "integrity": "sha512-f9s+fUkX04BxQf+7mMWAp5zk61pciie+fFLC9hX9UVvCeJQfNHRHXpeo5MPcR0EUf57PYLdt+ZO4f3Ipk2oZUw==" + "integrity": "sha512-f9s+fUkX04BxQf+7mMWAp5zk61pciie+fFLC9hX9UVvCeJQfNHRHXpeo5MPcR0EUf57PYLdt+ZO4f3Ipk2oZUw==", + "peer": true }, "xregexp": { "version": "4.0.0", diff --git a/package.json b/package.json index 9e0550073..4c0480682 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,7 @@ "mini-css-extract-plugin": "^0.4.1", "mkdirp": "^0.5.1", "null-loader": "^1.0.0", + "prettier": "^2.3.2", "raw-loader": "~0.5.0", "regenerator-runtime": "^0.13.9", "sass-loader": "^7.0.3", @@ -118,13 +119,14 @@ "url": "git+https://github.com/danielyxie/bitburner.git" }, "scripts": { + "format": "prettier --write .", "start:dev": "webpack-dev-server --progress --env.devServer --mode development", "start:container": "webpack-dev-server --progress --env.devServer --mode development --env.runInContainer", "build": "webpack --mode production", "build:dev": "webpack --mode development", "build:test": "webpack --config webpack.config-test.js", "lint": "npm run lint:jsts & npm run lint:style", - "lint:jsts": "eslint --fix '*.{js,jsx,ts,tsx}' './src/**/*.{js,jsx,ts,tsx}' './test/**/*.{js,jsx,ts,tsx}' './utils/**/*.{js,jsx,ts,tsx}'", + "lint:jsts": "eslint --fix . --ext ts,tsx", "lint:style": "stylelint --fix ./css/*", "preinstall": "node ./scripts/engines-check.js", "test": "jest", diff --git a/src/Corporation/ui/CityTabs.tsx b/src/Corporation/ui/CityTabs.tsx index fa2b5d3e7..17cc606f1 100644 --- a/src/Corporation/ui/CityTabs.tsx +++ b/src/Corporation/ui/CityTabs.tsx @@ -31,8 +31,7 @@ export function CityTabs(props: IProps): React.ReactElement { return <> { - Object.keys(props.onClicks).map((cityName: string) => - , + Object.keys(props.onClicks).map((cityName: string) => , ) } ); } - function Mult(props: {name: string, mult: number}): React.ReactElement { + function Mult(props: {name: string; mult: number}): React.ReactElement { if(props.mult <= 1) return (<>); return (

{props.name}{numeralWrapper.format(props.mult, "0.000")}

); } @@ -287,8 +287,7 @@ export function Overview(props: IProps): React.ReactElement { { Object.values(CorporationUnlockUpgrades) .filter((upgrade: CorporationUnlockUpgrade) => props.corp.unlockUpgrades[upgrade[0]] === 0) - .map((upgrade: CorporationUnlockUpgrade) => -