{"id":30,"date":"2022-05-02T08:59:53","date_gmt":"2022-05-02T08:59:53","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/?p=30"},"modified":"2022-05-02T08:59:53","modified_gmt":"2022-05-02T08:59:53","slug":"why-you-should-lint","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/2022\/05\/02\/why-you-should-lint\/","title":{"rendered":"Why You Should Lint"},"content":{"rendered":"\n<p>I know what you are thinking, but no, this article is not about cleaning out your dryer or belly button. A linter, when it comes to software development, is actually a tool that is meant to automate the cleanup of your code. A linter can do many different things, from catching bugs to cleaning up indentation.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"566\" height=\"218\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image.png\" alt=\"\" class=\"wp-image-31\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image.png 566w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image-300x116.png 300w\" sizes=\"auto, (max-width: 566px) 100vw, 566px\" \/><figcaption>Linters can catch console statements that you may not want to include in production<\/figcaption><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Possible Linter Features<\/h4>\n\n\n\n<p>As we hinted at above, linters are capable of many different things. Most are independent tools built by third parties, so the features can vary significantly. At a minimum, a linter will usually be able to maintain consistent formatting and industry conventions for whatever language you are coding in. From there, they can get as detailed as picking up type errors or recommending that you don\u2019t define string literals deep in your code.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Linter Options<\/h4>\n\n\n\n<p>There are many different linters available, and typically multiple for whatever language you are using. JSLint and ESLint are popular for Javascript. Pylint and Flake8 are commonly used linters for Python. Most languages will have many linter options, so I recommend looking up the most popular linters for the language you are writing in and trying one of those out that has good reviews and many users!<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"291\" height=\"291\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image-1.png\" alt=\"\" class=\"wp-image-32\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image-1.png 291w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image-1-150x150.png 150w\" sizes=\"auto, (max-width: 291px) 100vw, 291px\" \/><figcaption>ESLint is a popular linter for Javascript.<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"310\" height=\"100\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image-3.png\" alt=\"\" class=\"wp-image-34\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image-3.png 310w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5356\/files\/2022\/05\/image-3-300x97.png 300w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><figcaption>Pylint is a popular linter for Python.<\/figcaption><\/figure><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Why Should I Use One? <\/h4>\n\n\n\n<p>Although it may seem like a pain to constantly have a tool looking over your shoulder and correcting you, it is very important to maintain code consistency and quality. Often times we cannot be trusted to always uphold our own standards we would like to have, so it is good to put tools in place that will not let us overlook the small but important details. If you can entrench these small details into your every day workflow, then over time the linter will barely be doing any work in the first place!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I know what you are thinking, but no, this article is not about cleaning out your dryer or belly button. A linter, when it comes to software development, is actually a tool that is meant to automate the cleanup of your code. A linter can do many different things, from catching bugs to cleaning up [&hellip;]<\/p>\n","protected":false},"author":12208,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/users\/12208"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":2,"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":36,"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/posts\/30\/revisions\/36"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/welcometomytechtalk\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}