Facebook Engineering Blog
Improving CSS quality at Facebook and beyond

Improving CSS quality at Facebook and beyond

6/13/2016 · Juriy Zaytsev

What this post added

This post details the migration from a homegrown, regex-based CSS linter to a more robust solution using PostCSS and Stylelint. It highlights the benefits of using an Abstract Syntax Tree (AST) for parsing CSS, enabling more sophisticated static analysis, custom rule creation (e.g., for performance-sensitive properties, SVG filters, variable usage, common typos, mobile flexbox compatibility, and internationalization-unfriendly text transformations), and the development of automatic replacement features. The post also emphasizes the importance of unit testing for linters and discusses future plans for gathering codebase statistics and adapting to CSS-in-JS approaches.

Read the original post ↗