]> Untitled Git - lemmy-ui.git/commitdiff
Lint fix (#1035)
authorSleeplessOne1917 <abias1122@gmail.com>
Tue, 23 May 2023 22:55:36 +0000 (22:55 +0000)
committerGitHub <noreply@github.com>
Tue, 23 May 2023 22:55:36 +0000 (18:55 -0400)
* User HTTP instead of HTTPS when fetching icon in docker internal network

* Add debug statement.

* Revert "Add debug statement."

This reverts commit 7fbb12a4bde29d72c1bf55e0d0a954f19c863b4a.

* Revert "User HTTP instead of HTTPS when fetching icon in docker internal network"

This reverts commit 498de660bac1bffe15fef74a898c6d669794196a.

* Always replace host with internal host

* Fix lint script

* Remove prettier from pre-commit

---------

Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
13 files changed:
.babelrc
.eslintignore
.eslintrc.json
.github/ISSUE_TEMPLATE/BUG_REPORT.md
.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
.github/ISSUE_TEMPLATE/QUESTION.md
.github/ISSUE_TEMPLATE/hexbear.md
.prettierignore
.woodpecker.yml
README.md
package.json
src/server/index.tsx
tsconfig.json

index 2da0dea16b7f17831c116a967d2efef2b67c40a1..b96976f8c88eb00953bcf7fcd235d715a9723039 100644 (file)
--- a/.babelrc
+++ b/.babelrc
         }
       }
     ],
-    ["@babel/typescript", {"isTSX": true, "allExtensions": true}]
+    ["@babel/typescript", { "isTSX": true, "allExtensions": true }]
   ],
   "plugins": [
     "@babel/plugin-transform-runtime",
-    ["babel-plugin-inferno", { "imports": true }], 
-    ["@babel/plugin-proposal-class-properties", { "loose": true }],
+    ["babel-plugin-inferno", { "imports": true }],
+    ["@babel/plugin-proposal-class-properties", { "loose": true }]
   ]
 }
index 439fa035a6c6783acb712946cf5ec33534588b6c..26ddcb5513db206a12296bdfb148752f79094a7c 100644 (file)
@@ -1,3 +1,7 @@
 generate_translations.js
 webpack.config.js
 src/api_tests
+**/*.png
+**/*.svg
+**/*.css
+**/*.scss
\ No newline at end of file
index 0c9a5f46f8beaa3b9298e456c0207b2a88228d1e..cc1bff1e83feb51fca6aa08778c348971bc2335f 100644 (file)
@@ -3,9 +3,7 @@
   "env": {
     "browser": true
   },
-  "plugins": [
-    "@typescript-eslint"
-  ],
+  "plugins": ["@typescript-eslint"],
   "extends": [
     "eslint:recommended",
     "plugin:@typescript-eslint/recommended",
index 83c2ffaed3a2b585cd6ee39be14630ab244b430a..69b116fd29ddb859a224f7e23b3b6d5b3e5705cc 100644 (file)
@@ -1,10 +1,9 @@
 ---
 name: "\U0001F41E Bug Report"
 about: Create a report to help us improve Lemmy
-title: ''
+title: ""
 labels: bug
-assignees: ''
-
+assignees: ""
 ---
 
 Found a bug? Please fill out the sections below. 👍
@@ -15,7 +14,6 @@ For backend issues, use [lemmy](https://github.com/LemmyNet/lemmy)
 
 A summary of the bug.
 
-
 ### Steps to Reproduce
 
 1. (for example) I clicked login, and an endless spinner show up.
@@ -24,6 +22,6 @@ A summary of the bug.
 
 ### Technical details
 
-* Please post your log: `sudo docker-compose logs > lemmy_log.out`.
-* What OS are you trying to install lemmy on? 
-* Any browser console errors?
+- Please post your log: `sudo docker-compose logs > lemmy_log.out`.
+- What OS are you trying to install lemmy on?
+- Any browser console errors?
index 9886d8ad7fc50cd9eb5a1afb39c1255eb14be86a..bfeca29afc1a0b8b15db534eff32be6a6c24cde5 100644 (file)
@@ -1,10 +1,9 @@
 ---
 name: "\U0001F680 Feature request"
 about: Suggest an idea for improving Lemmy
-title: ''
+title: ""
 labels: enhancement
-assignees: ''
-
+assignees: ""
 ---
 
 For backend issues, use [lemmy](https://github.com/LemmyNet/lemmy)
index b45f8f1e52a3c23a7c6878bfd4375c0e54fbe9ca..15325873c6113518ffb75d9b99ec86aa5f502b21 100644 (file)
@@ -1,10 +1,9 @@
 ---
 name: "? Question"
 about: General questions about Lemmy
-title: ''
+title: ""
 labels: question
-assignees: ''
-
+assignees: ""
 ---
 
 What's the question you have about lemmy?
index 3bb062399eb32ce570dde0a361c2f5edbc8307aa..65483df82f2a246bc73a7c5afe1d22ada0c9c00f 100644 (file)
@@ -1,10 +1,9 @@
 ---
 name: Hexbear
 about: For hexbear issues
-title: ''
+title: ""
 labels: hexbear
-assignees: ''
-
+assignees: ""
 ---
 
 For hexbear-related issues
index a14ae90ec13bbfe5695c5205b137b41f21c440da..e7a0d20ec6abab0923aa3ce261ceafc787fe4aa6 100644 (file)
@@ -1 +1,2 @@
-src/shared/translations
\ No newline at end of file
+src/shared/translations
+lemmy-translations
\ No newline at end of file
index d9e3fa7e77ba0a8edd75f5a38c5ea7e959b25020..8d3c6f1c7d330086bb7ad7a4b52fe689bde2c495 100644 (file)
@@ -69,7 +69,7 @@ pipeline:
 
   publish_release_docker_manifest:
     image: plugins/manifest
-    settings: 
+    settings:
       username:
         from_secret: docker_username
       password:
@@ -85,7 +85,7 @@ pipeline:
 
   publish_latest_release_docker_manifest:
     image: plugins/manifest
-    settings: 
+    settings:
       username:
         from_secret: docker_username
       password:
index e1e6e1fda2e8051367d01ecc79eb9b5ff02fd612..6c9ef63affee4d81033ec7a5eec4f1ba6d48cbfc 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,21 +1,21 @@
-# lemmy-ui\r
-\r
-The official web app for [Lemmy](https://github.com/LemmyNet/lemmy), written in inferno.\r
-\r
-Based off of MrFoxPro's [inferno-isomorphic-template](https://github.com/MrFoxPro/inferno-isomorphic-template).\r
-\r
-## Configuration\r
-\r
-The following environment variables can be used to configure lemmy-ui:\r
-\r
-`ENV_VAR` | type | default | description\r
---- | --- | --- | ---\r
-`LEMMY_UI_HOST` | `string` | `0.0.0.0:1234` | The IP / port that the lemmy-ui isomorphic node server is hosted at.\r
-`LEMMY_UI_LEMMY_INTERNAL_HOST` | `string` | `0.0.0.0:8536` | The internal IP / port that lemmy is hosted at. Often `lemmy:8536` if using docker.\r
-`LEMMY_UI_LEMMY_EXTERNAL_HOST` | `string` | `0.0.0.0:8536` | The external IP / port that lemmy is hosted at. Often `DOMAIN.TLD`.\r
-`LEMMY_UI_LEMMY_WS_HOST` | `string` | `0.0.0.0:8536` | An alternate location for lemmy's websocket address. Not usually necessary.\r
-`LEMMY_UI_HTTPS` | `bool` | `false` | Whether to use https.\r
-`LEMMY_UI_EXTRA_THEMES_FOLDER` | `string` | `./extra_themes` | A location for additional lemmy css themes.\r
-`LEMMY_UI_DEBUG` | `bool` | `false` | Loads the [Eruda](https://github.com/liriliri/eruda) debugging utility.\r
-`LEMMY_UI_DISABLE_CSP` | `bool` | `false` | Disables CSP security headers\r
-`LEMMY_UI_CUSTOM_HTML_HEADER` | `string` | | Injects a custom script into `<head>`.\r
+# lemmy-ui
+
+The official web app for [Lemmy](https://github.com/LemmyNet/lemmy), written in inferno.
+
+Based off of MrFoxPro's [inferno-isomorphic-template](https://github.com/MrFoxPro/inferno-isomorphic-template).
+
+## Configuration
+
+The following environment variables can be used to configure lemmy-ui:
+
+| `ENV_VAR`                      | type     | default          | description                                                                         |
+| ------------------------------ | -------- | ---------------- | ----------------------------------------------------------------------------------- |
+| `LEMMY_UI_HOST`                | `string` | `0.0.0.0:1234`   | The IP / port that the lemmy-ui isomorphic node server is hosted at.                |
+| `LEMMY_UI_LEMMY_INTERNAL_HOST` | `string` | `0.0.0.0:8536`   | The internal IP / port that lemmy is hosted at. Often `lemmy:8536` if using docker. |
+| `LEMMY_UI_LEMMY_EXTERNAL_HOST` | `string` | `0.0.0.0:8536`   | The external IP / port that lemmy is hosted at. Often `DOMAIN.TLD`.                 |
+| `LEMMY_UI_LEMMY_WS_HOST`       | `string` | `0.0.0.0:8536`   | An alternate location for lemmy's websocket address. Not usually necessary.         |
+| `LEMMY_UI_HTTPS`               | `bool`   | `false`          | Whether to use https.                                                               |
+| `LEMMY_UI_EXTRA_THEMES_FOLDER` | `string` | `./extra_themes` | A location for additional lemmy css themes.                                         |
+| `LEMMY_UI_DEBUG`               | `bool`   | `false`          | Loads the [Eruda](https://github.com/liriliri/eruda) debugging utility.             |
+| `LEMMY_UI_DISABLE_CSP`         | `bool`   | `false`          | Disables CSP security headers                                                       |
+| `LEMMY_UI_CUSTOM_HTML_HEADER`  | `string` |                  | Injects a custom script into `<head>`.                                              |
index 641a87aa7e03d4bf03511e6f4ef5f3a92db6c0d8..62993df6f2739e61340b5679b9d82dc786fb7608 100644 (file)
@@ -12,7 +12,7 @@
     "build:prod": "webpack --mode=production",
     "clean": "yarn run rimraf dist",
     "dev": "yarn start",
-    "lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx src && prettier --check \"src/**/*.{ts,tsx,js,css,scss}\"",
+    "lint": "node generate_translations.js && tsc --noEmit && eslint --report-unused-disable-directives --ext .js,.ts,.tsx \"src/**\" && prettier --check \"src/**/*.{ts,tsx,js,css,scss}\"",
     "prepare": "husky install",
     "start": "yarn build:dev --watch"
   },
index 05988cf76c7d03287059f6f143b5f646ecdf2fc9..9d91f14db00fe84429b14d4af275fb1f12b8d152 100644 (file)
@@ -356,7 +356,7 @@ export async function generateManifestBase64(site: Site) {
 
 async function fetchIconPng(iconUrl: string) {
   return await fetch(
-    iconUrl.replace(/https?:\/\/localhost:\d+/g, getHttpBaseInternal())
+    iconUrl.replace(/https?:\/\/[^\/]+/g, getHttpBaseInternal())
   )
     .then(res => res.blob())
     .then(blob => blob.arrayBuffer());
index d7c880303bba6d6860a8ea7551c9604711eb20d3..3b7d3e41049b11e75a1cb10910b39aef10882afc 100644 (file)
@@ -1,29 +1,28 @@
-{\r
-       "compilerOptions": {\r
-               "pretty": true,\r
-               "target": "esnext",\r
-               "module": "esnext",\r
-               "allowSyntheticDefaultImports": true,\r
-               "preserveConstEnums": true,\r
-               "sourceMap": true,\r
-               "moduleResolution": "node",\r
-               "lib": ["es2017", "dom"],\r
-               "types": [\r
-                       "inferno"\r
-               ],\r
-               "jsx": "preserve",\r
-               "noUnusedLocals": true,\r
-               "baseUrl": "./src",\r
-               "noEmit": true,\r
-               "skipLibCheck": true,\r
-               "noUnusedParameters": true,\r
-               "noImplicitReturns": true,\r
-    "experimentalDecorators": true,\r
-    "strictNullChecks": true,\r
-    "noFallthroughCasesInSwitch": true\r
-       },\r
-       "include": [\r
-               "src/**/*",\r
-               "node_modules/inferno/dist/index.d.ts"\r
-       ]\r
-}\r
+{
+  "compilerOptions": {
+    "pretty": true,
+    "target": "esnext",
+    "module": "esnext",
+    "allowSyntheticDefaultImports": true,
+    "preserveConstEnums": true,
+    "sourceMap": true,
+    "moduleResolution": "node",
+    "lib": ["es2017", "dom"],
+    "types": ["inferno"],
+    "jsx": "preserve",
+    "noUnusedLocals": true,
+    "baseUrl": "./src",
+    "noEmit": true,
+    "skipLibCheck": true,
+    "noUnusedParameters": true,
+    "noImplicitReturns": true,
+    "experimentalDecorators": true,
+    "strictNullChecks": true,
+    "noFallthroughCasesInSwitch": true
+  },
+  "include": [
+    "src/**/*.ts",
+    "src/**/*.tsx",
+    "node_modules/inferno/dist/index.d.ts"
+  ]
+}