chatch / stellarexplorer

Ledger Explorer for the Stellar Network 🚀
https://steexp.com
Apache License 2.0
435 stars 930 forks source link

apply linter with `npm run lint:fix` #549

Closed jp-ryuji closed 7 months ago

jp-ryuji commented 7 months ago

I keep "comma-dangle": ["warn", "always-multiline"] in this PR.

Here's the diff against apply-linter ( https://github.com/chatch/stellarexplorer/pull/547/files , where comma-dangle" was removed ). Can you choose one of them? If you prefer the other one, please approve this PR: https://github.com/chatch/stellarexplorer/pull/546

$ git diff apply-linter
diff --git a/.eslintrc b/.eslintrc
index 018c00d..6635cf0 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -10,6 +10,7 @@
   "rules": {
     "react/jsx-wrap-multilines": "off",
     "jsx-a11y/anchor-has-content": "off",
+    "comma-dangle": ["warn", "always-multiline"],
     "quotes": ["warn", "single"],
     "semi": ["warn", "never"],
     "prettier/prettier": [
diff --git a/app/components/shared/CustomNetworkButton.tsx b/app/components/shared/CustomNetworkButton.tsx
index c25f6a2..fabd3a7 100644
--- a/app/components/shared/CustomNetworkButton.tsx
+++ b/app/components/shared/CustomNetworkButton.tsx
@@ -73,8 +73,7 @@ const ResourceModalBody = ({
           {networkAddresses.map(
             (address) =>
               address !== networkAddress && (
-                <option key={address}>{address}</option>
-              ),
+                <option key={address}>{address}</option>,
           )}
         </select>
         <br />

The above diff brought a formatter error. So I added this commit to solve it: 537b5e2 The following is diff against the apply-linter branch at the end.

$ git diff apply-linter
diff --git a/.eslintrc b/.eslintrc
index 018c00d..6635cf0 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -10,6 +10,7 @@
   "rules": {
     "react/jsx-wrap-multilines": "off",
     "jsx-a11y/anchor-has-content": "off",
+    "comma-dangle": ["warn", "always-multiline"],
     "quotes": ["warn", "single"],
     "semi": ["warn", "never"],
     "prettier/prettier": [
chatch commented 7 months ago

@jp-ryuji oh sorry i got confused and only just realised there are 2 PRs ... reading the comment above.

i put a couple of commits on the other PR. i'm fine with this one if comma-dangle is working and the error has gone .. you can cherry-pick my commits off the other one if still relevant then merge this.