vite+vue3.2+setup+elementPlus+eslint+js+stylelint

Overview

前期准备工作,npm包和vscode配置 !!!很重要,关乎整个Vue3开发阶段的代码提示

  1. Volar使用
  • 使用Vue3开发需要禁用vscode插件Vetur
  • 然后安装 Volar(Vue Language Features),这样Vue3代码提示即使是使用js开发也非常友好
  • 如果volar没有任何反应,请一定要更新vscode到最新版本!!一定要更新vscode!! 出现报错就更新vscode!!
  1. stylelint
  • vscode 安装 stylelint 插件,用于规范css书写格式
  • vscode插件扩展中搜索stylelint,然后鼠标右键或者点击小齿轮,选择安装其他版本,需要安装0.87.50.87.6
  • package.json中这几个npm包安装一下版本安装即可!!!(package.json已经指定版本,直接安装即可)
      "devDependencies": {
        "stylelint": "^13.13.1",
        "stylelint-config-standard": "^22.0.0",
        "stylelint-scss": "^3.21.0",
        "stylelint-config-recess-order": "^2.6.0",
      }
    
  • 只有这样,Vue3中的stylelint才会起作用

node版本

  • node > 16.0.0

vue3语法糖使用介绍

  1. Vue3的单文件组件的特殊用法(请看src/components/LookMe.vue) * <script setup> 是一种编译时语法糖,能够极大改善在 SFC(单文件Vue组件) 中使用 Composition API 时的开发者体验。 -- 对应的中文官方文档 https://v3.cn.vuejs.org/api/sfc-script-setup.html#%E5%9F%BA%E6%9C%AC%E8%AF%AD%E6%B3%95
* <style> v-bind 用于在 SFC(单文件Vue组件) <style> 标签中启用组件状态驱动的动态 CSS 值
  -- 对应的中文官方文档 https://v3.cn.vuejs.org/api/sfc-style.html#state-driven-dynamic-css

开发环境

  • npm run dev

项目打包

  • npm run build

检查项目中 eslint 书写不符合规范的地方,并会列举出来

  • npm run eslint

检查项目中 eslint 书写不符合规范的地方,并且直接全部修复

  • npm run eslintfix

检查项目中 style 书写规范不符合规范的地方,并会列举出来

  • npm run stylelint

检查项目中 style 书写不符合规范的地方,并且直接全部修复

  • npm run stylelintfix

文件解析

  • .editorconfig 代码格式和规范要求设定
  • .eslintrc.js ESlint代码规范和代码书写格式
  • .gitignore 配置那些文件不需要上传到git仓库
  • .npmrc npm源配置,私服配置等,一般可以不管
  • .stylelintignore stylelint忽略那些文件的检测
  • .stylelintrc.js stylelint的配置规则
  • jsconfig.json 暂时用来配置点击别名路径import的时候,可以进行文件跳转
  • vite.config.js vite配置
  • .env 相关文件变量会挂载在import.meta.env上面,除特定变量,其他变量需要以VITE_前缀开头才可
You might also like...

使用 vue3 来实现俄罗斯方块

使用 vue3 来实现俄罗斯方块

Tetris-vue3 使用 vue3 实现俄罗斯方块 单机版本实现 联机版本实现 实现原理 采用了 Functional Core, Imperative Shell 模式来实现 提高了可测试性 业务核心逻辑和视图逻辑拆分 可以移植到任意 UI 库 todo 游戏重来 收获 应用程序从 0 到 1

Mar 25, 2022

A text replacer component for vue3.

A text replacer component for Vue 3. Requires Vue 3 as peer-dependency. Installation Install it from npm. npm install vue3-replacer pnpm add vue3-rep

Feb 19, 2022

A API documentation generator for Vue3 single file component.

doc-vue A API documentation generator for Vue3 single file component. Table of Contents Installation Write API Description Command Line Usage Programm

Oct 20, 2022

Vue3 SSR prod-ready multi-languages template

Vue3 SSR prod-ready multi-languages template

vue3-ssr-template About This template is a prod ready starter for your Vue SSR application where you can do what you want at any level, client or serv

Mar 11, 2022

Light speed setup for MEVN(Mongo Express Vue Node) Apps

Light speed setup for MEVN(Mongo Express Vue Node)  Apps

Light speed setup for MEVN stack based web-apps Chat: Telegram Donate: PayPal, Open Collective, Patreon A CLI tool for getting started with the MEVN s

Dec 14, 2022

Basic https setup using an automatically generated self-signed certificate

@vitejs/plugin-basic-ssl A plugin to generate untrusted certificates which still allows to access the page after proceeding a wall with warning. In mo

Jan 2, 2023

React.js todo app with authorization, Testing: Cypress(e2e), UI (Chakra UI), Eslint, prettier, git hooks

React TypeScript template with Vite This is a React + TypeScript boilerplate built with Vite. What's inside? ReactJS Vite TypeScript Jest Testing Libr

Jan 28, 2022

Based on vitawind, kowind brings ESLint plugin and some other plugins to it that help you to format your code quickly and efficiently.

🐦 KOWIND v3 🐦 Vite helper based on vitawind 🧰 Easy To Install ⚡️ Automatically open Tailwind JIT Mode ⚙ One-Command Setting 🚀 Automatically config

Nov 26, 2022

A Marko plugin for Vite

A Marko plugin for Vite

@marko/vite A Marko plugin for Vite. Installation npm install @marko/vite Example config import { defineConfig } from "vite"; import marko from "@mark

Nov 26, 2022
Owner
null
vite2.7 + vue3.2 + ts + eslint + prettier

vite-vue-template 一个vue3项目模板 主要依赖 vite 2.7.2 vue 3.2.25 typescript eslint prettier 准备 Windows系统下将编辑器 行尾(eol) 设置为 LF('\n') vscode配置: { "files.eol":

shaaaaaaaa 5 Sep 13, 2022
⏳ vue3 + electron + ts + vite = mini template

v3-electron ?? Electron16 + Vue3 + Vite2 运行项目 # enter the project directory cd v3-electron # install dependency yarn # develop yarn dev # build exe

UNPany 8 Nov 11, 2022
vue3 + vite + typescript template

Vue 3 + Typescript + Vite This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 <script setu

BrowLi 6 Aug 1, 2022
The standard shareable Vue config for Stylelint.

stylelint-config-standard-vue The standard shareable Vue config for Stylelint. This config: extends the stylelint-config-standard shared config and co

Yosuke Ota 10 Dec 13, 2022
Minimal setup for a WebXR project using Vite, Babylon.js, TypeScript, and Vue

WebXR-Vite-Babylon-Simple Minimal setup for WebXR development using: vite typescript vue 3 babylonjs 5 (ES6) Intentionally made minimal changes from t

Josh Sanderson 6 Nov 13, 2022
Vite template with TypeScript, Chakra UI, Eslint Airbnb, Prettier

Vite + Typescript + ChakraUI = ❤️ This is a vite template that combines several technologies: Vite React TypeScript ChakraUI Eslint with eslint-config

Lorenzo Rapetti 3 Mar 26, 2022
Vite-plugin-web-extension - A vite plugin for generating cross browser platform, ES module based web extensions.

vite-plugin-web-extension A vite plugin for generating cross browser platform, ES module based web extensions. Features Manifest V2 & V3 Support Compl

Ruben Medina 81 Dec 31, 2022
Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse

Vite Vue SSR Starter Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse Features ⚡️ Vue 3, Vite 2, TypeScript ?? Domain-Driv

Oleg Koval 10 Aug 2, 2022
🎉🎉使用Vite + Vue3 + TypeScript + Element-plus + Mock开发的后台管理系统🎉🎉

Vite-Vue-Admin 介绍 Cli 配置 vue3.X vuex@4 vue-router@4 vite@2 typescript mock 内置 element-plus 二开封装 upload-file (文件上传,支持指定文件格式,文件大小) powerful-table (多功能表格

PengXiaoShuai 103 Dec 17, 2022
A simple, customization star rating component for your vue3 projects

vue3-star-ratings A simple, customizable component for star ratings Documentation Features Uses svg for the stars, so it can scale without quality los

Abiodun Olunu 14 Oct 7, 2022