nuxt format

Proxy to prettier or prettier-eslint when passing the --lint flag.

Nuxt Stack's Prettier config only overrides two settings:

  • arrowParens: "always"
  • semi: false

Check out the source for Nuxt Stack's Prettier config here.

Usage: nuxt format <pattern> [options]

Option Default Description
-l, --lint false Use prettier-eslint binary instead of prettier
-v, --version N/A Display nuxt version
-h, --help N/A Display help dialog

Recipes

Format all .js and .vue files:

nuxt format **/*.{js,vue}

Format and overwrite all .js files in the components directory:

nuxt format src/components/**/*.js --write

Format and lint all .scss and .vue files in the source directory:

nuxt format src/**/*.{scss,vue} --lint