Our great sponsors
-
jss
Software development kit for JavaScript developers building web applications with Sitecore Experience Platform (by Sitecore)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I recently cloned the Sitecore JSS project from GitHub, hoping to build my own JSS application. Only a few code changes later and errors appeared. I feared the worst. 😱
But in reality I had not introduced a bug, but I had written ugly code. My lines were too long and improperly indented. I was missing semi-colons. My code was not pretty. The project had the JavaScript library Prettier installed, which marks code that doesn’t match the style guide as an error.
💠You may be thinking: Does Prettier replace my Linter? No. Prettier is installed to make your code pretty. Prettier does not check for unused variables, type checking, not allowing any variable types. For that level of checking, I recommend ESLint to be used alongside Prettier for JavaScript and TypeScript projects.