morepurplemorebetter / MPMBs-Character-Record-Sheet

MorePurpleMoreBetter's D&D 5e Character Record Sheet
https://www.flapkan.com
GNU General Public License v3.0
372 stars 352 forks source link

Applied a linter to the code to clean things up some. #36

Closed erickrause closed 6 years ago

erickrause commented 6 years ago

https://standardjs.com/ then just ran standard --fix

Basically spaces instead of tabs. no semi colons. Single quotes when able.

Then I modified this gist and ran it against what was left to replace the tabs with spaces. https://gist.github.com/bluefuton/1468061

morepurplemorebetter commented 6 years ago

Thanks but no thanks. I like using tabs, semicolons and double quotes for my strings. I'm still a bit of a novice to coding, so I might be wrong, but aren't semicolons necessary at the end of a var statement, when removing line breaks? Because Acrobat is not so good at keeping line breaks in code.

Your changes also break the syntax files...

erickrause commented 6 years ago

I'll have to check how they might have broken the syntax files. I don't think semi colons are required anywhere. Unless maybe having multiple statements on one line. But I let the linter do all of the semi colons and quotes. I just cleaned up some tabs manually. The issue with tabs is that they can be represented differently based on the file editor. So people have just consolidated by replacing them with tabs. There is even a way to do this in Notepad++.

No worries on not accepting the changes. I'll just turn the linter off while working on your project.

morepurplemorebetter commented 6 years ago

Acrobat sometimes does remove line breaks from code, so that is why the semicolons are important. They probably aren't necessary everywhere I'm using them, though, but I don't know enough to know where they are and aren't ;)

bfg-coding commented 6 years ago

semicolons are a good habit to keep as other languages (if you ever decide to try new languages) require them. Plus it just makes code look nice and easier to read in my opinion

erickrause commented 6 years ago

What other new-ish languages require semi colons? C# still does. I normally code in Ruby on Rails, which doesn't. (It does in some cases when you want to have multiple logical statements on one line) Just looked, Python doesn't. Javascript kind of does, but mostly doesn't.

Personally, I find that semi colons are just more things to type rather than help me speed up development or express my intent in code.

bfg-coding commented 6 years ago

Languages that I use all require it C#, Java, C++, RPG (this one is for work only). I work to keep up the good habit by just adding semicolons unless it is going to cause problems

RobRoseKnows commented 6 years ago

JavaScript doesn't enforce semicolon usage but it's best to use them as there are cases where a lack of a semicolon will break things quietly.