GuildCrafts / web-development-js

Craft repository for Web Development with JavaScript
http://jsdev.learnersguild.org/
Other
1 stars 1 forks source link

JRob JS Linter #94

Closed Moniarchy closed 7 years ago

Moniarchy commented 7 years ago

Description

How often do you work with @jrob8577 and he doesn't give you excellent feedback on how to make your code cleaner and keep it up to standard? Now you can always have his attention to detail without him actually being present. This goal is for creating a linter that will check for various things, including places where there is too much/too little whitespace, code that uses tabs or more than two spaces, variables that are potentially named unmeaningfully, functions that may be getting too large, and more.

Context

This goal's importance is multifold-- it allows the people who develop it to become aware of what good, clean code looks like AND the actual coding that will go into this project will be challenging because it must check for many different cases. Particularly ambitious developers can make the linter check for more than what the current specifications are because the ones below are minimum requirements. Finally, this should be an ongoing, open source project because as Javascript, its frameworks, and libraries evolve, linters should too. Developers will learn to work cooperatively, maintain good gitflow, and will have to ensure the quality of their work.

Specifications

What are some appropriate quality objectives for this goal? These are statements about the internal characteristics of the product that demonstrate fine design and craftspersonship, not its external features.


Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Moniarchy commented 7 years ago

@tannerwelsh @shereefb @deadlyicon @deonna @prattsj is this a good goal? How can I flesh this out/add to this? I'm aware that linters have way more rules than this which is why this should be an ongoing project, and I'm not quite sure of the difficulty this project would present, but I had the idea today and I'd like to work on it with some guidance. Thanks!

jrob8577 commented 7 years ago

I think this is an interesting goal, but would be fairly advanced given that players would need to understand lexical analysis and parsing in order to either create software that can do this, or add features to existing software like ESLint. To provide context, I can safely say that this is in the upper limits of my ZPD, where defining the "Do you hate whitespace, me, or both" rule would probably be on the order of a week for me, much of which would be spent reading documentation.

deonna commented 7 years ago

I like this goal, though I think it's ambitious.

One thing that I'd encourage you to explore is creating an Atom package that learners can apm install with a keymapping that allows for Atom to reformat the code.

Look at this file in the JSBeautify project to give you an idea of how to do something like this.

As far as Atom packages go, atom-beautify and its Ctrl + Alt + B keymapping may serve as good inspiration.

Adding this functionality would involve a lot of string parsing and manipulation: lemme know if you think this could be achievable with your current spec list.

Moniarchy commented 7 years ago

@jrob8577 @deonna So maybe not a goal for the near future, and maybe needs to be scaled back fairly much. Sounds good to me. So, potentially an achievable goal further down the road and with a smaller scope? Are there any other resources that I or anyone else who is interested in this project should be looking into? Thank you for such quick responses. :)

deonna commented 7 years ago

@Moniarchy - no problem! I'd say definitely take a look at the implementation in JSBeautify I linked to with specific emphasis on the features you want to implement (e.g., indentation) to see if you think this project is in your ZPD.

jrob8577 commented 7 years ago

@Moniarchy @deonna I read the intent as linting, not code formatting (although ESLint provides formatting options for rule specification), so I think the resources provided (ESLint v. JSBeautify) are pointing at two different options depending on the intent of the goal.

deonna commented 7 years ago

@jrob8577 - thanks for pointing that out! My last comment was in reference to the code formatting add-on suggestion (with a keymapping in Atom), not the linting itself.

@Moniarchy - Jrob's ESLint link above is a great resource for your original specification. :)

tannerwelsh commented 7 years ago

(not much to add here other than 👍 @deonna and @jrob8577's comments :)