network icon indicating copy to clipboard operation
network copied to clipboard

chore: Formatted with prettier

Open mondoreale opened this issue 1 year ago • 1 comments

Summary

Format all the codes using Prettier and its refreshed config from prettier branch.

@teogeb, attached is the result of npm run eslint with indent enabled.

I've tweaked the branch so that it's the only outstanding rule we have to deal with.

(Note that in this PR the indent rule is on.)

Cheers!

Changes

  • Auto-formatted all the files.
  • Adjusted selected eslint rules to match Prettier's behaviour:
    • Enabled avoidEscape on the quotes rule.
    • Changed @stylistic/member-delimiter-style to semi for singleline types and interfaces (semi is typescript's default, too).

Limitations and future improvements

  • n/a

Checklist before requesting a review

  • [x] Is this a breaking change? If it is, be clear in summary.
  • [x] Read through code myself one more time.
  • [x] Make sure any and all TODO comments left behind are meant to be left in.
  • [x] Has reasonable passing test coverage?
  • [x] Updated changelog if applicable.
  • [x] Updated documentation if applicable.

mondoreale avatar Jan 13 '25 12:01 mondoreale

So I did a bit of a readthru & analysis of the prettier formatting.

  • I went thru all the code in packages utils and trackeless-network .
  • I excluded changes related to white space, trailing commas, and interface/type semicolon (those can easily be enforced with any tool)
  • For the remaining changes, I categorized and tallied them into the three categories based on readability - Good: change improved readability - Neutral: change neither improved or worsened readability - Bad: change worsened readability

So for the scores: utils

Good 24 (23%)
Neutral 74 (70%)
Bad 7 (7%)

trackerless-network

Good 51 (19%)
Neutral 198 (74%)
Bad 19 (7%)

harbu avatar Jan 16 '25 14:01 harbu