Package Spotlight: Stylelint

Package Spotlight: Stylelint

TRYTN, not unlike other software companies, has various coding best-practices and standards. But why have CSS/SCSS coding standards? When you have multiple developers on a team and/or want to write code in a readable, scalable way, standards are needed. This is so that every developer on the team writes code in the same format and style. It makes onboarding new developers much easier when you can hand them a list of standards that need to be followed.

But what good is a standards and best-practices document if they aren’t enforced? You might be able to catch some during a code review but this is a manual, tedious task. It’d be better to catch these code standards violations early in the development process. That’s where Stylelint comes in – it automates the code standards adherence checks.

We implemented code standards for CSS/SCSS just like we did for JavaScript and utilize Stylelint to automatically check for issues. An example is alphabetical order for CSS properties. This is a standard we implemented here at TRYTN to make code very easy to read. It’s a pain to manually enforce this rule but Stylelint makes it easy. If properties are out of order a warning is generated any time files are re-generated to let the developer know there’s an issue with line and character number.

What’s also nice is Stylelint also checks for code standards conformity. If an invalid property or value is passed or a syntactic error is found in the CSS/SCSS it will automatically generate an error. The SCSS will then not transpile to CSS and the build will fail. Meaning if there’s a syntax issue in the CSS we aren’t putting a bad build out into production.

Package Name: Stylelint

a man using a laptop computer sitting on top of a table
Feature Announcements

Custom Invoice Emails

We recently enhanced our invoicing capabilities in a big way. Each tour operator has specific business needs and so a one-size-fits-all invoice email just didn’t

Read More »
someone ideating on a white board with comps
Release Notes

July 2021 Release Notes

We’ve spent all of July trying to squash as many bugs as possible while also adding simple enhancements to make the system easier to use.

Read More »

Request a Demonstration