-
Avoid using jQuery and jQuery plugins. Prefer solutions based on plain JavaScript or Stimulus. link explanation
Example
// Bad $("#recipe") // Good document.getElementById("recipe")
-
Avoid using
.classes
as selectors (they are for styling). Use[data-behavior~=]
,[data-*]
, or#ids
. link -
Use
camelCase
, notsnake_case
in Javascript linkExample
// Bad let recipe_link = event.currentTarget // Good let recipeLink = event.currentTarget
-
Leverage progressive enhancement as a development approach. link explanation