backend-manage(40200): 后台管理wallpaper-module-web(40300): 壁纸网站
npm/yarn安装依赖时,存在依赖提升,某个项目使用的依赖,并没有在其 package.json 中声明,也可以直接使用,这种现象为”幽灵依赖“。 随着项目迭代,这个依赖不再被其他项目使用,不再被安装,使用幽灵依赖的项目,会因为无法找到依赖而报错
组件库,工具类结构为 packages shared module module2
- pnpm i xxx -w: 全局安装依赖
- pnpm up: 更新子目录版本依赖已经通过workspace:*
- node >= 18
- pnpm >= 9
- eslint prettier eslint-config-prettier eslint-plugin-prettier @typescript-eslint/parser @typescript-eslint/eslint-plugin pnpm install --save-dev eslint prettier eslint-config-prettier eslint-plugin-prettier
npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react eslint-plugin-react-hooks
npm install --save-dev eslint-plugin-vue vue-eslint-parser
- ESLint 在 v9.0.0 中做了重大变更:
默认配置文件从 .eslintrc.*(旧的 JSON/JS 格式)改为 eslint.config.js(新的扁平配置格式)。
- --save-exact: 固定安装版本
.prettierrc(JSON 格式) .prettierrcon .prettierrc.yaml / .prettierrc.yml .prettierrc.toml package.json 中的 prettier 字段
View -> Appearance -> Show Main Menu in Separate Toolbar
搜索virtual space -> Show virtual space at the bottom of the file
- One Dark Theme
- .ignore
set-ExecutionPolicy RemoteSigned
ElMessage 这种 API 根本不会被 unplugin-auto-import 的 ElementPlusResolver 自动生成,这是插件本身的限制(它对大部分组件 OK,但对 message/notification 这种“函数 API”支持不完整)。
npx prettier --write .
旧版本(<2.0)可能默认使用 auto 策略(跟随系统换行符) 新版本(≥2.0)在未明确配置时,可能更严格地校验换行符,导致 Windows 系统的 CRLF(\r\n)被视为错误
- https://prettier.io/docs/options#end-of-line
- First available in v1.15.0, default value changed from auto to lf in v2.0.0
设置 -> files.eol -> \n
在TypeScript中,“typings”和“types”都用于管理类型声明文件,但“typings”是早期的命名规范,而“types”是官方推荐的方式。
pnpm i @poly/shared@workspace:* -D