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..7aa8fa9e5 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 js,jsx,ts,tsx", "lint:style": "stylelint --fix ./css/*", "preinstall": "node ./scripts/engines-check.js", "test": "jest", diff --git a/scripts/.eslintrc.js b/scripts/.eslintrc.js index 21584d6dc..f3c3c56bc 100644 --- a/scripts/.eslintrc.js +++ b/scripts/.eslintrc.js @@ -19,112 +19,52 @@ module.exports = { "getWithoutSet": false } ], - "array-bracket-newline": [ - "error" - ], - "array-bracket-spacing": [ - "error" - ], - "array-callback-return": [ - "error" - ], - "array-element-newline": [ - "error" - ], - "arrow-body-style": [ - "error" - ], - "arrow-parens": [ - "error" - ], - "arrow-spacing": [ - "error" - ], - "block-scoped-var": [ - "error" - ], - "block-spacing": [ - "error" - ], - "brace-style": [ - "error" - ], - "callback-return": [ - "error" - ], - "camelcase": [ - "error" - ], - "capitalized-comments": [ - "error" - ], - "class-methods-use-this": [ - "error" - ], - "comma-dangle": [ - "error" - ], - "comma-spacing": [ - "error" - ], + "array-bracket-newline": ["error"], + "array-bracket-spacing": ["error"], + "array-callback-return": ["error"], + "array-element-newline": ["error"], + "arrow-body-style": ["error"], + "arrow-parens": ["error"], + "arrow-spacing": ["error"], + "block-scoped-var": ["error"], + "block-spacing": ["error"], + "brace-style": ["error"], + "callback-return": ["error"], + "camelcase": ["error"], + "capitalized-comments": ["error"], + "class-methods-use-this": ["error"], + "comma-dangle": ["error"], + "comma-spacing": ["error"], "comma-style": [ "error", "last" ], - "complexity": [ - "error" - ], + "complexity": ["error"], "computed-property-spacing": [ "error", "never" ], - "consistent-return": [ - "error" - ], - "consistent-this": [ - "error" - ], - "constructor-super": [ - "error" - ], - "curly": [ - "error" - ], - "default-case": [ - "error" - ], + "consistent-return": ["error"], + "consistent-this": ["error"], + "constructor-super": ["error"], + "curly": ["error"], + "default-case": ["error"], "dot-location": [ "error", "property" ], - "dot-notation": [ - "error" - ], - "eol-last": [ - "error" - ], - "eqeqeq": [ - "error" - ], - "for-direction": [ - "error" - ], - "func-call-spacing": [ - "error" - ], - "func-name-matching": [ - "error" - ], + "dot-notation": ["error"], + "eol-last": ["error"], + "eqeqeq": ["error"], + "for-direction": ["error"], + "func-call-spacing": ["error"], + "func-name-matching": ["error"], "func-names": [ "error", "never" ], - "func-style": [ - "error" - ], - "function-paren-newline": [ - "error" - ], + "func-style": ["error"], + "function-paren-newline": ["error"], "generator-star-spacing": [ "error", "before" @@ -135,24 +75,12 @@ module.exports = { "allowImplicit": false } ], - "global-require": [ - "error" - ], - "guard-for-in": [ - "error" - ], - "handle-callback-err": [ - "error" - ], - "id-blacklist": [ - "error" - ], - "id-length": [ - "error" - ], - "id-match": [ - "error" - ], + "global-require": ["error"], + "guard-for-in": ["error"], + "handle-callback-err": ["error"], + "id-blacklist": ["error"], + "id-length": ["error"], + "id-match": ["error"], "implicit-arrow-linebreak": [ "error", "beside" @@ -164,34 +92,18 @@ module.exports = { "SwitchCase": 1 } ], - "init-declarations": [ - "error" - ], - "jsx-quotes": [ - "error" - ], - "key-spacing": [ - "error" - ], - "keyword-spacing": [ - "error" - ], - "line-comment-position": [ - "error" - ], + "init-declarations": ["error"], + "jsx-quotes": ["error"], + "key-spacing": ["error"], + "keyword-spacing": ["error"], + "line-comment-position": ["error"], "linebreak-style": [ "error", "windows" ], - "lines-around-comment": [ - "error" - ], - "lines-between-class-members": [ - "error" - ], - "max-depth": [ - "error" - ], + "lines-around-comment": ["error"], + "lines-between-class-members": ["error"], + "max-depth": ["error"], "max-len": [ "error", 160 @@ -203,18 +115,10 @@ module.exports = { "skipComments": true } ], - "max-nested-callbacks": [ - "error" - ], - "max-params": [ - "error" - ], - "max-statements": [ - "error" - ], - "max-statements-per-line": [ - "error" - ], + "max-nested-callbacks": ["error"], + "max-params": ["error"], + "max-statements": ["error"], + "max-statements-per-line": ["error"], "multiline-comment-style": [ "off", "starred-block" @@ -223,127 +127,62 @@ module.exports = { "error", "never" ], - "new-cap": [ - "error" - ], - "new-parens": [ - "error" - ], - "newline-before-return": [ - "error" // TODO: configure this... - ], - "newline-per-chained-call": [ - "error" - ], - "no-alert": [ - "error" - ], - "no-array-constructor": [ - "error" - ], - "no-await-in-loop": [ - "error" - ], - "no-bitwise": [ - "error" - ], - "no-buffer-constructor": [ - "error" - ], - "no-caller": [ - "error" - ], - "no-case-declarations": [ - "error" - ], - "no-catch-shadow": [ - "error" - ], - "no-class-assign": [ - "error" - ], - "no-compare-neg-zero": [ - "error" + "new-cap": ["error"], + "new-parens": ["error"], + "newline-before-return": ["error" // TODO: configure this... ], + "newline-per-chained-call": ["error"], + "no-alert": ["error"], + "no-array-constructor": ["error"], + "no-await-in-loop": ["error"], + "no-bitwise": ["error"], + "no-buffer-constructor": ["error"], + "no-caller": ["error"], + "no-case-declarations": ["error"], + "no-catch-shadow": ["error"], + "no-class-assign": ["error"], + "no-compare-neg-zero": ["error"], "no-cond-assign": [ "error", "except-parens" ], - "no-confusing-arrow": [ - "error" - ], - "no-console": [ - "error" - ], - "no-const-assign": [ - "error" - ], + "no-confusing-arrow": ["error"], + "no-console": ["error"], + "no-const-assign": ["error"], "no-constant-condition": [ "error", { "checkLoops": false } ], - "no-continue": [ - "off" - ], - "no-control-regex": [ - "error" - ], - "no-debugger": [ - "error" - ], - "no-delete-var": [ - "error" - ], - "no-div-regex": [ - "error" - ], - "no-dupe-args": [ - "error" - ], - "no-dupe-class-members": [ - "error" - ], - "no-dupe-keys": [ - "error" - ], - "no-duplicate-case": [ - "error" - ], + "no-continue": ["off"], + "no-control-regex": ["error"], + "no-debugger": ["error"], + "no-delete-var": ["error"], + "no-div-regex": ["error"], + "no-dupe-args": ["error"], + "no-dupe-class-members": ["error"], + "no-dupe-keys": ["error"], + "no-duplicate-case": ["error"], "no-duplicate-imports": [ "error", { "includeExports": true } ], - "no-else-return": [ - "error" - ], + "no-else-return": ["error"], "no-empty": [ "error", { "allowEmptyCatch": false } ], - "no-empty-character-class": [ - "error" - ], - "no-empty-function": [ - "error" - ], - "no-empty-pattern": [ - "error" - ], - "no-eq-null": [ - "error" - ], - "no-ex-assign": [ - "error" - ], - "no-extra-boolean-cast": [ - "error" - ], + "no-empty-character-class": ["error"], + "no-empty-function": ["error"], + "no-empty-pattern": ["error"], + "no-eq-null": ["error"], + "no-ex-assign": ["error"], + "no-extra-boolean-cast": ["error"], "no-extra-parens": [ "error", "all", @@ -351,58 +190,26 @@ module.exports = { "conditionalAssign": false } ], - "no-extra-semi": [ - "error" - ], - "no-eval": [ - "error" - ], - "no-extend-native": [ - "error" - ], - "no-extra-bind": [ - "error" - ], - "no-extra-label": [ - "error" - ], - "no-extra-parens": [ - "error" - ], - "no-fallthrough": [ - "error" - ], - "no-floating-decimal": [ - "error" - ], - "no-func-assign": [ - "error" - ], - "no-global-assign": [ - "error" - ], - "no-implicit-coercion": [ - "error" - ], - "no-implicit-globals": [ - "error" - ], - "no-implied-eval": [ - "error" - ], - "no-inline-comments": [ - "error" - ], + "no-extra-semi": ["error"], + "no-eval": ["error"], + "no-extend-native": ["error"], + "no-extra-bind": ["error"], + "no-extra-label": ["error"], + "no-extra-parens": ["error"], + "no-fallthrough": ["error"], + "no-floating-decimal": ["error"], + "no-func-assign": ["error"], + "no-global-assign": ["error"], + "no-implicit-coercion": ["error"], + "no-implicit-globals": ["error"], + "no-implied-eval": ["error"], + "no-inline-comments": ["error"], "no-inner-declarations": [ "error", "both" ], - "no-invalid-regexp": [ - "error" - ], - "no-invalid-this": [ - "error" - ], + "no-invalid-regexp": ["error"], + "no-invalid-this": ["error"], "no-irregular-whitespace": [ "error", { @@ -412,24 +219,12 @@ module.exports = { "skipTemplates": false } ], - "no-iterator": [ - "error" - ], - "no-label-var": [ - "error" - ], - "no-labels": [ - "error" - ], - "no-lone-blocks": [ - "error" - ], - "no-lonely-if": [ - "error" - ], - "no-loop-func": [ - "error" - ], + "no-iterator": ["error"], + "no-label-var": ["error"], + "no-labels": ["error"], + "no-lone-blocks": ["error"], + "no-lonely-if": ["error"], + "no-loop-func": ["error"], "no-magic-numbers": [ "error", { @@ -441,108 +236,48 @@ module.exports = { "ignoreArrayIndexes": true } ], - "no-mixed-operators": [ - "error" - ], - "no-mixed-requires": [ - "error" - ], - "no-mixed-spaces-and-tabs": [ - "error" - ], - "no-multi-assign": [ - "error" - ], - "no-multi-spaces": [ - "error" - ], - "no-multi-str": [ - "error" - ], + "no-mixed-operators": ["error"], + "no-mixed-requires": ["error"], + "no-mixed-spaces-and-tabs": ["error"], + "no-multi-assign": ["error"], + "no-multi-spaces": ["error"], + "no-multi-str": ["error"], "no-multiple-empty-lines": [ "error", { "max": 1 } ], - "no-native-reassign": [ - "error" - ], - "no-negated-condition": [ - "error" - ], - "no-negated-in-lhs": [ - "error" - ], - "no-nested-ternary": [ - "error" - ], - "no-new": [ - "error" - ], - "no-new-func": [ - "error" - ], - "no-new-object": [ - "error" - ], - "no-new-require": [ - "error" - ], - "no-new-symbol": [ - "error" - ], - "no-new-wrappers": [ - "error" - ], - "no-octal": [ - "error" - ], - "no-octal-escape": [ - "error" - ], - "no-obj-calls": [ - "error" - ], - "no-param-reassign": [ - "error" - ], - "no-path-concat": [ - "error" - ], + "no-native-reassign": ["error"], + "no-negated-condition": ["error"], + "no-negated-in-lhs": ["error"], + "no-nested-ternary": ["error"], + "no-new": ["error"], + "no-new-func": ["error"], + "no-new-object": ["error"], + "no-new-require": ["error"], + "no-new-symbol": ["error"], + "no-new-wrappers": ["error"], + "no-octal": ["error"], + "no-octal-escape": ["error"], + "no-obj-calls": ["error"], + "no-param-reassign": ["error"], + "no-path-concat": ["error"], "no-plusplus": [ "error", { "allowForLoopAfterthoughts": true } ], - "no-process-env": [ - "error" - ], - "no-process-exit": [ - "error" - ], - "no-proto": [ - "error" - ], - "no-prototype-builtins": [ - "error" - ], - "no-redeclare": [ - "error" - ], - "no-regex-spaces": [ - "error" - ], - "no-restricted-globals": [ - "error" - ], - "no-restricted-imports": [ - "error" - ], - "no-restricted-modules": [ - "error" - ], + "no-process-env": ["error"], + "no-process-exit": ["error"], + "no-proto": ["error"], + "no-prototype-builtins": ["error"], + "no-redeclare": ["error"], + "no-regex-spaces": ["error"], + "no-restricted-globals": ["error"], + "no-restricted-imports": ["error"], + "no-restricted-modules": ["error"], "no-restricted-properties": [ "error", { @@ -551,120 +286,48 @@ module.exports = { "message": "'log' is too general, use an appropriate level when logging." } ], - "no-restricted-syntax": [ - "error" - ], - "no-return-assign": [ - "error" - ], - "no-return-await": [ - "error" - ], - "no-script-url": [ - "error" - ], + "no-restricted-syntax": ["error"], + "no-return-assign": ["error"], + "no-return-await": ["error"], + "no-script-url": ["error"], "no-self-assign": [ "error", { "props": false } ], - "no-self-compare": [ - "error" - ], - "no-sequences": [ - "error" - ], - "no-shadow": [ - "error" - ], - "no-shadow-restricted-names": [ - "error" - ], - "no-spaced-func": [ - "error" - ], - "no-sparse-arrays": [ - "error" - ], - "no-sync": [ - "error" - ], - "no-tabs": [ - "error" - ], - "no-template-curly-in-string": [ - "error" - ], - "no-ternary": [ - "off" - ], - "no-this-before-super": [ - "error" - ], - "no-throw-literal": [ - "error" - ], - "no-trailing-spaces": [ - "error" - ], - "no-undef": [ - "error" - ], - "no-undef-init": [ - "error" - ], - "no-undefined": [ - "error" - ], - "no-underscore-dangle": [ - "error" - ], - "no-unexpected-multiline": [ - "error" - ], - "no-unmodified-loop-condition": [ - "error" - ], - "no-unneeded-ternary": [ - "error" - ], - "no-unreachable": [ - "error" - ], - "no-unsafe-finally": [ - "error" - ], - "no-unsafe-negation": [ - "error" - ], - "no-unused-expressions": [ - "error" - ], - "no-unused-labels": [ - "error" - ], - "no-unused-vars": [ - "error" - ], - "no-use-before-define": [ - "error" - ], - "no-useless-call": [ - "error" - ], - "no-useless-computed-key": [ - "error" - ], - "no-useless-concat": [ - "error" - ], - "no-useless-constructor": [ - "error" - ], - "no-useless-escape": [ - "error" - ], + "no-self-compare": ["error"], + "no-sequences": ["error"], + "no-shadow": ["error"], + "no-shadow-restricted-names": ["error"], + "no-spaced-func": ["error"], + "no-sparse-arrays": ["error"], + "no-sync": ["error"], + "no-tabs": ["error"], + "no-template-curly-in-string": ["error"], + "no-ternary": ["off"], + "no-this-before-super": ["error"], + "no-throw-literal": ["error"], + "no-trailing-spaces": ["error"], + "no-undef": ["error"], + "no-undef-init": ["error"], + "no-undefined": ["error"], + "no-underscore-dangle": ["error"], + "no-unexpected-multiline": ["error"], + "no-unmodified-loop-condition": ["error"], + "no-unneeded-ternary": ["error"], + "no-unreachable": ["error"], + "no-unsafe-finally": ["error"], + "no-unsafe-negation": ["error"], + "no-unused-expressions": ["error"], + "no-unused-labels": ["error"], + "no-unused-vars": ["error"], + "no-use-before-define": ["error"], + "no-useless-call": ["error"], + "no-useless-computed-key": ["error"], + "no-useless-concat": ["error"], + "no-useless-constructor": ["error"], + "no-useless-escape": ["error"], "no-useless-rename": [ "error", { @@ -673,149 +336,67 @@ module.exports = { "ignoreImport": false } ], - "no-useless-return": [ - "error" - ], - "no-var": [ - "error" - ], - "no-void": [ - "error" - ], - "no-warning-comments": [ - "error" - ], - "no-whitespace-before-property": [ - "error" - ], - "no-with": [ - "error" - ], + "no-useless-return": ["error"], + "no-var": ["error"], + "no-void": ["error"], + "no-warning-comments": ["error"], + "no-whitespace-before-property": ["error"], + "no-with": ["error"], "nonblock-statement-body-position": [ "error", "below" ], - "object-curly-newline": [ - "error" - ], - "object-curly-spacing": [ - "error" - ], - "object-property-newline": [ - "error" - ], - "object-shorthand": [ - "error" - ], - "one-var": [ - "off" - ], - "one-var-declaration-per-line": [ - "error" - ], - "operator-assignment": [ - "error" - ], + "object-curly-newline": ["error"], + "object-curly-spacing": ["error"], + "object-property-newline": ["error"], + "object-shorthand": ["error"], + "one-var": ["off"], + "one-var-declaration-per-line": ["error"], + "operator-assignment": ["error"], "operator-linebreak": [ "error", "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" - ], + "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" - ], + "require-await": ["error"], + "require-jsdoc": ["off"], + "require-yield": ["error"], "rest-spread-spacing": [ "error", "never" ], - "semi": [ - "error" - ], - "semi-spacing": [ - "error" - ], + "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" - ], + "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", { @@ -823,38 +404,22 @@ module.exports = { "before": false } ], - "symbol-description": [ - "error" - ], - "template-curly-spacing": [ - "error" - ], - "template-tag-spacing": [ - "error" - ], + "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" - ], + "use-isnan": ["error"], + "valid-jsdoc": ["error"], + "valid-typeof": ["error"], + "vars-on-top": ["error"], "wrap-iife": [ "error", "any" ], - "wrap-regex": [ - "error" - ], + "wrap-regex": ["error"], "yield-star-spacing": [ "error", "before" diff --git a/scripts/semver.js b/scripts/semver.js index 755318c31..fc0625052 100644 --- a/scripts/semver.js +++ b/scripts/semver.js @@ -483,7 +483,7 @@ class SemVer { // Numberify any prerelease numeric ids if (matches[4]) { this.prerelease = matches[4].split(".").map((id) => { - if (/^[0-9]+$/.test(id)) { + if ((/^[0-9]+$/).test(id)) { const num = Number(id); if (num >= 0 && num < MAX_SAFE_INTEGER) { return num; 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) => -