Skip to content

Latest commit

 

History

History

javascript

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

JavaScript

  • Use Prettier to format javascript code. link

  • 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, not snake_case in Javascript link

    Example
    // Bad
    let recipe_link = event.currentTarget
    
    // Good
    let recipeLink = event.currentTarget
  • Leverage progressive enhancement as a development approach. link explanation