Fixes #1242: reformat files to follow standard#1269
Fixes #1242: reformat files to follow standard#1269Gozala merged 22 commits intobrowserhtml:masterfrom
Conversation
….js and src/Browser/Navigators/Navigator/Assistant/Suggestion.js
…c/Common/Favicon.js
…ers from src/Common/URLHelper.js
…type parameters, namespace XMLHttpRequest with 'window' in src/Devtools/Record.js
…ttpRequest with 'window' in src/Devtools/Replay.js
…ement in src/Lang/Task.js
33ffa90 to
5809efc
Compare
…as for src/Common/Deck.js
5809efc to
62c1a6e
Compare
…y braces for src/Common/Style.js
|
I believe I've been as far as I could with my knowledge of js, flow, standard and the codebase. I'm not sure how to fix the 7 remaining files, and would welcome any tip or help on those. Maybe dealing with those problematic ones in another PR would make sense though, this one is already pretty large. @Gozala any thoughts? |
That is amazing! Thank you so much! I'll try to get through this by end of tomorrow!
I'll definitely try to look into those, but let's get these landed first.
Most certainly! I would rather land formatting changes separate from ones that actually alter code, so that if we introduce some regressions it would be easier to track it down and fix. |
Gozala
left a comment
There was a problem hiding this comment.
Thanks again for all the hard work! I can't wait to get this merged, there are just few things to be addressed.
Feel free to ignore few comments I did about the indentation, I am surprised that it still complies with standard. I am tempted to pass code through prettier before handing it over to standard (as discussed in prettier/prettier#736) just so that code style is more consistent but that's probably better done as followup.
So I think it's just a new String and some code removal and it should be ready to go.
Also my apologies for taking this long with review, it's just this change is huge.
main.js
Outdated
| ? { flag | ||
| , query | ||
| ? { flag, | ||
| query |
There was a problem hiding this comment.
Indentation here is odd, not sure why lint is not catching it, but my understanding of the rules is it should be as:
{
flags,
query
}There was a problem hiding this comment.
I didn't see any indentation "errors" caught by the linter, so I don't think it's even checking it. I'll fix those indentations issues with pleasure ;)
main.js
Outdated
| , query: "" | ||
| ), | ||
| { flag: null, | ||
| query: '' |
main.js
Outdated
| , webPreferences: | ||
| { nodeIntegration: true | ||
| , preload: path.resolve(path.join('.'), 'electron-preload.js') | ||
| mainWindow = new BrowserWindow({ width: 1024, |
There was a problem hiding this comment.
I think width: 1024 should be on next line.
main.js
Outdated
| height: 740, | ||
| frame: false, | ||
| webPreferences: | ||
| { nodeIntegration: true, |
There was a problem hiding this comment.
I think it should be webPreferences: {\n
src/About/Repl/Repl/Cell.js
Outdated
| { id: ID | ||
| , input: Input.Model | ||
| , output: Output.Model | ||
| { id: ID, |
There was a problem hiding this comment.
I think it objects keys should start on a line after { according to standard format.
src/About/Repl/Repl/Host/Window.js
Outdated
|
|
||
|
|
||
| const DELETE = new String('delete'); | ||
| const DELETE = 'delete' |
There was a problem hiding this comment.
It is important for DELETE to be a special unexposed object rather than plain string which is what new String('delete') produced as it's treated as special instruction.
There was a problem hiding this comment.
I'll change it back, but then i'll leave this file in the standard-flow ignore list, as it complains:
standard-flow: Use JavaScript Standard Style (with Flow types) (https://github.com/gozala/standard-flow)
/Users/mathieu/mozilla/browserhtml/src/About/Repl/Repl/Host/Window.js:14:16: Do not use String as a constructor.
/Users/mathieu/mozilla/browserhtml/src/About/Repl/Repl/Host/Window.js:69:57: eval can be harmful.```
| } | ||
| } | ||
|
|
||
| export const update = |
There was a problem hiding this comment.
Why is this function gone now ?
There was a problem hiding this comment.
Can you please keep this function, even if it's not used right now. I would rather remove obsolete code in separate change from formatting one.
|
|
||
|
|
||
| export type Model <model, action> = | ||
| export type Model <model, action> = // eslint-disable-line no-unused-vars |
There was a problem hiding this comment.
Question: Why eslint-disable-line no-unused-vars is necessary here ? exports aren't considered unused are they ?
There was a problem hiding this comment.
It's the model type that is unused, and that's why it's complaining.
Gozala
left a comment
There was a problem hiding this comment.
Can you please undo deletes that I've pointed out so we can land this ?
|
|
||
|
|
||
|
|
||
| export const updateSuggestion = |
There was a problem hiding this comment.
Can you please keep this function, I know it's not used but it's going to be soon. And in any case I'd rather prune obsolete code in separate change.
| } | ||
| } | ||
|
|
||
| export const update = |
There was a problem hiding this comment.
Can you please keep this function, even if it's not used right now. I would rather remove obsolete code in separate change from formatting one.
| (Task.requestAnimationFrame().map(Tick)) | ||
| ] | ||
|
|
||
| const endTransition = <model> |
There was a problem hiding this comment.
Please export this function instead of deleting it.
e0c7cda to
283bcac
Compare
|
I believe I've addressed all your comments, please let me know if I missed something or if you'd need anything else, i'd be happy to help! |
This PR only deals with the easy fixes:
==and!=by===and!==(when not comparing tonullorundefined)