chatch / stellarexplorer

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

fix eslint rule - rm comma-dangle #546

Closed jp-ryuji closed 10 months ago

jp-ryuji commented 10 months ago

Applied the linter with npm run lint:fix. Then got the following error on npm run dev. The server is up and running though.

Realized a comma is added to a weird place due to the "comma-dangle": ["warn", "always-multiline"] eslint config. Removed it (then the default prettier rule is applied), then the error has gone.

$ npm run dev
:
:
💿  remix dev

 warn  The `remix dev` changing in v2
┃ You can use the `v2_dev` future flag to opt-in early.
┃ -> https://remix.run/docs/en/main/pages/v2#dev-server
â”—
💿 Building...
✘ [ERROR] Expected ")" but found "}"

    app/components/layout/NetworkSelector.tsx:71:5:
      71 │     )}
         │      ^
         ╵      )

✘ [ERROR] Build failed with 1 error:
app/components/layout/NetworkSelector.tsx:71:5: ERROR: Expected ")" but found "}" [plugin css-bundle-update-plugin]

    app/root.tsx:4:30:
      4 │ import { cssBundleHref } from '@remix-run/css-bundle';
        ╵                               ~~~~~~~~~~~~~~~~~~~~~~~

  This error came from the "onLoad" callback registered here:

    node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:47:12:
      47 │       build.onLoad({
         ╵             ~~~~~~

    at setup (/Users/ryuji.eguchi/src/github.com/chatch/stellarexplorer/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundlePlugin.js:47:13)
    at handlePlugins (/Users/ryuji.eguchi/src/github.com/chatch/stellarexplorer/node_modules/esbuild/lib/main.js:1279:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)

💿 Rebuilt in 985ms
Remix App Server started at http://localhost:3000 (http://192.168.88.152:3000/)
chatch commented 10 months ago

Is it only the one place where it fails? could use a comment that tells the formatter to ignore the line or lines? and then you could have dangling commas in all the other places ...?

jp-ryuji commented 10 months ago

@chatch

Is it only the one place where it fails? could use a comment that tells the formatter to ignore the line or lines? and then you could have dangling commas in all the other places ...?

It seems to be the one place only. But I can't fix it quickly. It's hard to explain, but you can see what it is like by executing the following on the master branch.

jp-ryuji commented 10 months ago

@chatch

Wait. I think I can fix this by referring to the change in this PR: https://github.com/chatch/stellarexplorer/pull/547/files .

chatch commented 10 months ago

@jp-ryuji i'm not seeing this error. i can npm run dev without any issues.

running node v18.17.0 though not sure if it's related.

jp-ryuji commented 10 months ago

This PR was superseded by https://github.com/chatch/stellarexplorer/pull/549