A Small Guide for Naming Stuff in Front-End Code

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • clean-code-typescript

    Clean Code concepts adapted for TypeScript

  • The general ideas are fine, but the examples are pretty outdated. For modern SPA, CSS naming has become largely obsolete. A lot of the JS code shows the principles it is supposed to well but sadly includes other cruft.

    Here's a guide I would recommend instead: https://github.com/labs42io/clean-code-typescript

  • suit

    Style tools for UI components

  • This is actually super bad practice. I really dislike scoped css.

    When I see devs using scoped css the class names always end up like `.box` or `.name`.

    Having to think about classnames and writing Sass makes me much more aware of the structure of the components I'm styling. Frankly I think only JS oriented devs like scoped CSS and frontend who love html/css and the challenges of architecturing good CSS don't egt any benefit out of styled components (since you're using atomic css like Tailwind and/or BEM-style which always "scopes" classnames with the component name.

    In general any solid guidelines makes CSS instantly 10x better and that's all most projects needs, and it's often what most projects lack.

    SuitCSS works great with Vue in my experience, and can even be linted with postcss-bem-linter :

    https://github.com/suitcss/suit/blob/master/doc/naming-conve...

  • 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.

    SurveyJS logo
  • classnames

    A simple javascript utility for conditionally joining classNames together

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts