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
Issue #72 -- Add a Linter #83
Conversation
Apparently there is no way to do this in the configuration file. (http://eslint.org/docs/user-guide/configuring#specifying-file-extensions-to-lint)
More eslint configuration & code cleaning
.editorconfig
Outdated
# Styling applicable to the file extension given | ||
[*.js, *.jsx] | ||
# This is due to the fact that github allows only 119 columns of space to view | ||
max_line_length = 119 |
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 would really discuss this one
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.
Actually this is a widely observed standard in many open source projects
max_line_length = 119
This is done so that there is no need for horizontal scrolling while reading the code as github provides only 119 columns worth of space to read the code. But I can change if it seems too restricting.
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.
@Treora makes the final decision, I wouldn't have this rule
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.
The reason here is actually 120, but minus 1 char for the diff view. Why 120 I don't get because it seems pretty much browser specific, and people just choose a round number, see:
(source Django developers discussion)
For more random numbers, see this stackoverflow thread.
I do agree setting line lengths to something higher than 80, but 119 and binding that to Github web view and some browser specifics and then rounding that number seems pretty ... arbitrary.
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 understand github diff works on this length, I'm not discussing the number, I'm dicussing having any number there.
If tomorrow (real life story) I need to put an svg encoded icon somewhere I do want it on one line and I don't care if you have to scroll.
I'm not really worried of a dev writing a very very long line, why would it do that? So I consider this rule more a possible issue than a safeguard.
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.
Point noted, I shall remove this line immediately. Or would you like another value to takes its place?
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 intended to ask about it too; adjusting rules to Github's presentation seems somewhat arbitrary (or submissive ;) ) indeed.
I have myself tried to keep things at a soft limit of 80 characters, though I'd be fine with a larger number too. As said it is nice to be able to make longer lines if needed; I am not sure whether editors interpret such a rule as soft or hard.
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.
If we have a linter it will probably stops you from committing if you have linter errors, so I would say it will be pretty hard :)
There are 10(5 warnings and 5 errors) persisting errors that I cannot resolve as they require some big design decisions. It would be really helpful if someone could help me with them. no-unused-vars errorThis error finds its source. It is currently set to warning. Places of occurrence
react/no-unused-prop-types errorThis error finds it source. It is currently set to warning. Places of occurrence.
prefer-promise-reject-errors errorThis error finds its source. It is currently set to error. Places of occurrence
promise/catch-or-return errorThis error finds its source. It is currently set to error. Places of occurrence
handle-callback-err errorThis error finds its source. It is currently set to error. Places of occurrence
These are all the errors that are still there. If we could remove all the errors or remove their lint rules then the code will be fully clean. I will continue looking for more rules that can help make the project more consistent. Thanks. Once the rules are finalized and integrated I will continue to add the git hook. |
Thanks for the PR. I will do another round of changes to remove (or suppress) the remaining warnings/errors. |
Done & merged. GitHub seems not to have detected that, so closing this manually. Thanks for the effort! |
@Treora thanks for all the help!! |
Features of the PR.
@Treora Please take into account that the PR still has some errors. Please either remove the errors or remove the lint itself. Please check and see if the rules are to the maintainers liking, or they can always be changed. Thanks.
USAGE