diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 661302ed..00000000 --- a/.eslintrc.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": 2020, - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "brace-rules" - ], - "rules": { - "no-caller": 1, - "no-cond-assign": 1, - "no-constant-condition": [ - "error", - { - "checkLoops": false - } - ], - "no-dupe-args": 1, - "no-dupe-keys": 1, - "no-duplicate-case": 1, - "no-empty": 1, - "no-extra-boolean-cast": 0, - "no-extra-parens": 0, - "no-extra-semi": 1, - "no-floating-decimal": 1, - "no-func-assign": 1, - "no-negated-in-lhs": 1, - "no-obj-calls": 1, - "no-unreachable": 1, - "use-isnan": 1, - "valid-jsdoc": 0, - "valid-typeof": 1, - "block-scoped-var": 0, - "consistent-return": 1, - "default-case": 1, - "dot-notation": 1, - "no-else-return": 1, - "no-invalid-this": 1, - "no-loop-func": 0, - "no-multi-spaces": [ - "warn", - { - "ignoreEOLComments": true - } - ], - "no-new": 1, - "no-redeclare": 0, - "no-return-assign": 1, - "no-self-assign": 1, - "no-self-compare": 1, - "no-unmodified-loop-condition": 1, - "no-unused-expressions": 1, - "no-unused-labels": 1, - "no-useless-concat": 0, - "yoda": 1, - "no-delete-var": 1, - "no-label-var": 1, - "no-shadow-restricted-names": 1, - "no-undef": 0, - "no-undef-init": 1, - "no-unused-vars": 0, - "comma-spacing": 1, - "indent": [ - "warn", - "tab", - { - "outerIIFEBody": 0 - } - ], - "key-spacing": 1, - "new-cap": 0, - "new-parens": 1, - "no-mixed-spaces-and-tabs": [ - "warn", - "smart-tabs" - ], - "no-multi-assign": 1, - "no-trailing-spaces": 1, - "no-unneeded-ternary": 1, - "no-irregular-whitespace": 1, - "object-curly-spacing": [ - "warn", - "always" - ], - "operator-assignment": 1, - "operator-linebreak": [ - "warn", - "after" - ], - "quote-props": 1, - "semi": 1, - "semi-spacing": 1, - "space-before-function-paren": [ - "warn", - "never" - ], - "space-in-parens": 1, - "space-unary-ops": 1, - "spaced-comment": [ - "warn", - "always" - ], - "space-infix-ops":1, - "no-class-assign": 1, - "no-const-assign": 1, - "no-dupe-class-members": 1, - "prefer-const": 1, - - "quotes": [ - "warn", - "double", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "comma-dangle": 1, - "arrow-parens": [ - "warn", - "as-needed" - ], - // https://typescript-eslint.io/rules/no-use-before-define/ - "no-use-before-define": "off", - "@typescript-eslint/no-use-before-define": [ - "error", - "nofunc" - ], - // https://typescript-eslint.io/rules/no-shadow/ - "no-shadow": "off", - "@typescript-eslint/no-shadow": [ - "error" - ], - "@typescript-eslint/no-unused-vars": 0, - "brace-rules/brace-on-same-line": [ - "warn", - { - "FunctionDeclaration": "never", - "FunctionExpression": "ignore", - "ArrowFunctionExpression": "always", - "IfStatement": "never", - "TryStatement": "ignore", - "CatchClause": "ignore", - "DoWhileStatement": "never", - "WhileStatement": "never", - "ForStatement": "never", - "ForInStatement": "never", - "ForOfStatement": "never", - "SwitchStatement": "never" - }, - { - "allowSingleLine": true - } - ] - } -} diff --git a/.github/README.md b/.github/README.md index 5370b6fb..248ae0a5 100644 --- a/.github/README.md +++ b/.github/README.md @@ -129,7 +129,7 @@ vale sync

#### JavaScript -Mirroring the linting process from `0 A.D.` by using `ESLint` and an adopted set of rules defined in the [.eslintrc.json](../.eslintrc.json) file. +Mirroring the linting process from `0 A.D.` by using `ESLint` and an adopted set of rules defined in the [package.json](../package.json) file. * The `.vscode` settings are set up to automatically adjust your code to the rules when you save the document. * An optional installation of the [VSCode ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) runs `ESLint` on each file and display warnings and errors at once. @@ -153,7 +153,7 @@ vale --minAlertLevel=suggestion . ``` #### XML -`Prettier for XML` formats the files according to the rules set in [.prettierrc.json](../.prettierrc.json). +`Prettier for XML` formats the files according to the rules set in [package.json](../package.json). * An optional installation of the [Prettier - Code formatter extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) automatically formats the `XML` file upon saving. * The following command formats all `XML` files with `Prettier` and runs a simple [style sheet](../.github/build_scripts/stylesheet.xsl) over them to ensure that the `xsl:output attributes` have the correct case and form. diff --git a/.github/build_scripts/macOS_installer.sh b/.github/build_scripts/macOS_installer.sh deleted file mode 100644 index cb416750..00000000 --- a/.github/build_scripts/macOS_installer.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# A Git clone of the boonGUI mod will be created in the 0ad mods folder. Once complete, simply open the 0ad app and activate the mod via the mod selection. -echo "Running Installation Script" -cd ~/Library/Application\ Support/0ad/mods/ -git clone https://github.com/LangLangBart/boonGUI.git -echo "installation complete you may run 0 A.D. now" -exit diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 51dfc95e..00000000 --- a/.prettierrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "bracketSameLine": true, - "singleAttributePerLine": false, - "tabWidth": 2, - "xmlSelfClosingSpace": true, - "xmlWhitespaceSensitivity": "ignore" -} diff --git a/package.json b/package.json index 8f35363c..36b98b78 100644 --- a/package.json +++ b/package.json @@ -1,40 +1,189 @@ { "name": "boongui", "version": "1.0.0", - "description": "---", - "private": true, - "devDependencies": { + "dependencies": { "@prettier/plugin-xml": "^2.2.0", - "@typescript-eslint/eslint-plugin": "^5.41.0", - "@typescript-eslint/parser": "^5.41.0", - "eslint": "^8.26.0", + "@typescript-eslint/eslint-plugin": "^5.47.1", + "@typescript-eslint/parser": "^5.47.1", + "eslint": "^8.30.0", "eslint-plugin-brace-rules": "^0.1.6", - "lint-staged": "^13.0.3", - "prettier": "^2.7.1", + "lint-staged": "^13.1.0", + "prettier": "^2.8.1", "simple-git-hooks": "^2.8.1", - "typescript": "^4.8.4" + "typescript": "^4.9.4" }, "scripts": { "testAssets": "pyrogenesis -mod=mod -mod=public -archivebuild=\"$PWD\" -archivebuild-output=/dev/null -archivebuild-compress", "postinstall": "vale sync", - "prettierXML": "./node_modules/.bin/prettier --write ./\\*\\*/\\*.xml", - "xmlStyle": "find . -name '*.xml' -print0 | while IFS= read -r -d '' file; do xsltproc -o $file ./.github/build_scripts/*.xsl $file; done && ./node_modules/.bin/prettier --write ./\\*\\*/\\*.xml" + "prettierXML": "prettier --write ./\\*\\*/\\*.xml", + "xmlStyle": "find . -name '*.xml' -print0 | while IFS= read -r -d '' file; do xsltproc -o $file ./.github/build_scripts/*.xsl $file; done && npm run prettierXML" }, "simple-git-hooks": { "pre-commit": "npx lint-staged && if type vale >/dev/null; then vale .; fi" }, "lint-staged": { - "*.{js,ts}": "eslint --fix", - "./**/*.xml": "./node_modules/.bin/prettier --write" + "*.js": "eslint --fix", + "./**/*.xml": "prettier --write" }, - "repository": { - "type": "git", - "url": "git+https://github.com/LangLangBart/boonGUI.git" + "prettier": { + "bracketSameLine": true, + "singleAttributePerLine": false, + "tabWidth": 2, + "xmlSelfClosingSpace": true, + "xmlWhitespaceSensitivity": "ignore" }, - "author": "", - "license": "ISC", - "bugs": { - "url": "https://github.com/LangLangBart/boonGUI/issues" - }, - "homepage": "https://github.com/LangLangBart/boonGUI#readme" + "eslintConfig": { + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 2020, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint", + "brace-rules" + ], + "rules": { + "no-caller": 1, + "no-cond-assign": 1, + "no-constant-condition": [ + "error", + { + "checkLoops": false + } + ], + "no-dupe-args": 1, + "no-dupe-keys": 1, + "no-duplicate-case": 1, + "no-empty": 1, + "no-extra-boolean-cast": 0, + "no-extra-parens": 0, + "no-extra-semi": 1, + "no-floating-decimal": 1, + "no-func-assign": 1, + "no-negated-in-lhs": 1, + "no-obj-calls": 1, + "no-unreachable": 1, + "use-isnan": 1, + "valid-jsdoc": 0, + "valid-typeof": 1, + "block-scoped-var": 0, + "consistent-return": 1, + "default-case": 1, + "dot-notation": 1, + "no-else-return": 1, + "no-invalid-this": 1, + "no-loop-func": 0, + "no-multi-spaces": [ + "warn", + { + "ignoreEOLComments": true + } + ], + "no-new": 1, + "no-redeclare": 0, + "no-return-assign": 1, + "no-self-assign": 1, + "no-self-compare": 1, + "no-unmodified-loop-condition": 1, + "no-unused-expressions": 1, + "no-unused-labels": 1, + "no-useless-concat": 0, + "yoda": 1, + "no-delete-var": 1, + "no-label-var": 1, + "no-shadow-restricted-names": 1, + "no-undef": 0, + "no-undef-init": 1, + "no-unused-vars": 0, + "comma-spacing": 1, + "indent": [ + "warn", + "tab", + { + "outerIIFEBody": 0 + } + ], + "key-spacing": 1, + "new-cap": 0, + "new-parens": 1, + "no-mixed-spaces-and-tabs": [ + "warn", + "smart-tabs" + ], + "no-multi-assign": 1, + "no-trailing-spaces": 1, + "no-unneeded-ternary": 1, + "no-irregular-whitespace": 1, + "object-curly-spacing": [ + "warn", + "always" + ], + "operator-assignment": 1, + "operator-linebreak": [ + "warn", + "after" + ], + "quote-props": 1, + "semi": 1, + "semi-spacing": 1, + "space-before-function-paren": [ + "warn", + "never" + ], + "space-in-parens": 1, + "space-unary-ops": 1, + "spaced-comment": [ + "warn", + "always" + ], + "space-infix-ops": 1, + "no-class-assign": 1, + "no-const-assign": 1, + "no-dupe-class-members": 1, + "prefer-const": 1, + "quotes": [ + "warn", + "double", + { + "avoidEscape": true, + "allowTemplateLiterals": true + } + ], + "comma-dangle": 1, + "arrow-parens": [ + "warn", + "as-needed" + ], + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": [ + "error", + "nofunc" + ], + "no-shadow": "off", + "@typescript-eslint/no-shadow": [ + "error" + ], + "@typescript-eslint/no-unused-vars": 0, + "brace-rules/brace-on-same-line": [ + "warn", + { + "FunctionDeclaration": "never", + "FunctionExpression": "ignore", + "ArrowFunctionExpression": "always", + "IfStatement": "never", + "TryStatement": "ignore", + "CatchClause": "ignore", + "DoWhileStatement": "never", + "WhileStatement": "never", + "ForStatement": "never", + "ForInStatement": "never", + "ForOfStatement": "never", + "SwitchStatement": "never" + }, + { + "allowSingleLine": true + } + ] + } + } }