Skip to content

Script Description

scripts

Script NameCommandDescription
devvite --openStart the development server and automatically open the application in the default browser.
buildvue-tsc --noEmit && vite buildFirst run TypeScript type checking (without output files), then build the application.
servevite previewPreview the built application, simulating a production environment.
linteslintRun ESLint to check code quality and code style issues.
fixeslint --fixRun ESLint and automatically fix fixable issues.
lint:prettierprettier --write "**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}"Use Prettier to format all specified file types.
lint:stylelintstylelint "**/*.{css,scss,vue}" --fixUse Stylelint to check and automatically fix style issues in CSS, SCSS, and Vue files.
lint:lint-stagedlint-stagedRun lint-staged to only check staged files, ensuring code quality before commits.
preparehuskySet up Husky Git hooks for running scripts before Git operations.
commitgit-czUse Commitizen to standardize commit messages, ensuring consistent commit formats.

Detailed Description

  1. dev

    • Command: vite --open
    • Description: Start the Vite development server and automatically open the application in the default browser for development and debugging.
  2. build

    • Command: vue-tsc --noEmit && vite build
    • Description: First run TypeScript type checking (without generating output files) to ensure code type safety. Then use Vite to build the production version of the application.
  3. serve

    • Command: vite preview
    • Description: Preview the built application, simulating a production environment, convenient for viewing build results locally.
  4. lint

    • Command: eslint
    • Description: Run the ESLint tool to check for potential errors and code standard violations in the code.
  5. fix

    • Command: eslint --fix
    • Description: Run ESLint and automatically fix fixable issues in the code, such as formatting problems and simple errors.
  6. lint:prettier

    • Command: prettier --write "**/*.{js,cjs,ts,json,tsx,css,less,scss,vue,html,md}"
    • Description: Use the Prettier tool to format all specified file types in the project, ensuring consistent code style.
  7. lint:stylelint

    • Command: stylelint "**/*.{css,scss,vue}" --fix
    • Description: Use the Stylelint tool to check and automatically fix style issues in CSS, SCSS, and Vue files, ensuring style code meets standards.
  8. lint:lint-staged

    • Command: lint-staged
    • Description: Run the lint-staged tool to only check and format staged files, ensuring code quality before commits.
  9. prepare

    • Command: husky
    • Description: Set up Husky Git hooks for running predefined scripts before Git operations (such as commit, push), ensuring code quality.
  10. commit

    • Command: git-cz
    • Description: Use the Commitizen tool to standardize commit messages, ensuring consistent commit message formats for easier project maintenance and version management.

Released under the MIT License