testing javascript logo
    Loading

    Validate All Files are Properly Formatted with Prettier

    1. You can’t force everyone on your project to use the prettier integration for their editor, so let’s add a validation script to verify that prettier has been run on all project files.
    2. Fortunately for us, Prettier accepts a --list-different flag that you can use that will throw an error when code is not up to the standard of your project.

    Transcript

    Validate All Files are Properly Formatted with Prettier

    module imageStatic Analysis Testing JavaScript Applications
    • 1.
      Intro to Static Analysis Testing JavaScript Applications
    • 2.
      Lint JavaScript by Configuring and Running ESLint
    • 3.
      Use the ESLint Extension for VSCode
    • 4.
      Use pre-built ESLint Configuration using extends
    • 5.
      Run ESLint with npm Scripts
    • 6.
      Format Code by Installing and Running Prettier
    • 7.
      Configure Prettier
    • 8.
      Use the Prettier Extension for VSCode
    • 9.
      Disable Unnecessary ESLint Stylistic Rules with eslint-config-prettier
    • 10.
      Validate All Files are Properly Formatted with Prettier
    • 11.
      Avoid Common Errors by Installing and Configuring TypeScript
    • 12.
      Make ESLint Support TypeScript Files
    • 13.
      Validate Code in a pre-commit git Hook with husky
    • 14.
      Auto-format All Files and Validate Relevant Files in a precommit Script with lint-staged
    • 15.
      Run Multiple npm Scripts in Parallel with npm-run-all