vue3+ts+vite+pinia 项目搭建

1. 起始,项目搭建

yarn 创建项目

yarn create vite

pnpm 安装依赖(如果没有可以用npm)

// mac安装pnpm
sudo npm i -g yarn
// 安装依赖
pnpm i
//启动项目
yarn dev
//安装一下pretter和eslint
pnpm i prettier eslint eslint-config-prettier eslint-plugin-prettier eslint-plugin-vue vue-eslint-parser @typescript-eslint/eslint-plugin @typescript-eslint/parser -D

创建.eslintrc.json文件

{
    "root": true,
    "env": {
      "es2021": true,
      "node": true,
      "browser": true
    },
    "globals": {
      "node": true
    },
    "extends": [
      //    "plugin:vue/essential",
      /** @see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#recommended-configs */
      //    "plugin:@typescript-eslint/recommended",
      //    "eslint:recommended",
      "plugin:vue/vue3-recommended",
      /**@see https://github.com/prettier/eslint-plugin-prettier#recommended-configuration */
      "plugin:prettier/recommended"
    ],
    "parser": "vue-eslint-parser",
    "parserOptions": {
      "parser": "@typescript-eslint

你可能感兴趣的:(前端,html,typescript,vue.js,javascript)