-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proper linting #1058
Proper linting #1058
Conversation
Related to the error: eslint/eslint#8767 |
Can we deal with this one somehow? /Users/lipis/work/wire/wire-desktop/electron/main.js
127:5 error Parsing error: 'return' outside of function
✖ 1 problem (1 error, 0 warnings)
https://github.com/wireapp/wire-desktop/blob/lint/electron/main.js#L127-L129 |
@lipis Is this still an issue with |
it's not the prettier.. but the Eslint.. for the retrun outside of a function |
Thanks for the clarification. Can't we simply add a single line ignore on this one to move forward with code formatting? |
No it doesn't work as it's not linting issues.. is parsing error.. I've read the whole internet the other day (twice) to skip this line.. but couldn't figure out a way.. and since the behaviour is affecting the Windows update I couldn't test it properly in case of changing the code. |
electron/main.js
Outdated
@@ -439,7 +439,7 @@ fs.readdir(LOG_DIR, (error, contents) => { | |||
.filter(file => { | |||
try { | |||
return fs.statSync(file).isFile(); | |||
} catch (error) { | |||
} catch (err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the more readable variable, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid variable shadowing.. maybe error_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. Then I think better would be statError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you can also rename the first error to readError
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much better..
@@ -1,3 +1,4 @@ | |||
/* eslint-disable sort-keys */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why disable sorting keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they were too many and I wanted to do it once this PR is merged to avoid future conflicts.. Maybe I'll add a TODO to do it in a separate PR after we merge this .
What if we replace the line https://github.com/wireapp/wire-desktop/blob/master/electron/main.js#L128 with |
* 'lint' of github.com:wireapp/wire-desktop: ,
electron/main.js
Outdated
@@ -416,7 +416,7 @@ class ElectronWrapperInit { | |||
} | |||
}; | |||
|
|||
app.on('web-contents-created', (event, contents) => { | |||
app.on('web-contents-created', (createdEvent, contents) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ffflorian if you have a better name.. let me know! because of the shadowing the line 422
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it
electron/main.js
Outdated
@@ -425,7 +416,7 @@ class ElectronWrapperInit { | |||
} | |||
}; | |||
|
|||
app.on('web-contents-created', (event, contents) => { | |||
app.on('web-contents-created', (createdEvent, contents) => { | |||
switch (contents.getType()) { | |||
case 'window': | |||
contents.on('will-attach-webview', (event, webPreferences, params) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webviewEvent
Nice |
No description provided.