Skip to content

Commit

Permalink
docs(新增笔记): 新增editorconfig文档
Browse files Browse the repository at this point in the history
  • Loading branch information
emmmmmmmm committed Sep 15, 2023
1 parent 02debb7 commit 1951d37
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/usage-other/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- 其他工作相关
- [前端工具函数](docs/usage-other/前端工具函数.md)
- [vscode技巧](docs/usage-other/vscode代码格式化.md)
- [vscode技巧](docs/usage-other/vscode技巧.md)
- [前端渲染pdf](docs/usage-other/前端渲染pdf.md)
- [pdfjs本地化部署](docs/usage-other/pdfjs本地部署.md)
- [docker打包electron](docs/usage-other/Linux-docker打包electron.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/usage-other/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- [其他工作相关](docs/usage-other/README.md)
- [前端工具函数](docs/usage-other/前端工具函数.md)
- [vscode技巧](docs/usage-other/vscode代码格式化.md)
- [vscode技巧](docs/usage-other/vscode技巧.md)
- [前端渲染pdf](docs/usage-other/前端渲染pdf.md)
- [pdfjs本地化部署](docs/usage-other/pdfjs本地部署.md)
- [docker打包electron](docs/usage-other/Linux-docker打包electron.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# vscode技巧

## 插件推荐

- koroFileHeader,自动生成代码文件头注释,函数注释
-

## .vscode目录

定义:存放工作区的项目配置和工具相关文件

目录文件:
- setting.json:会覆盖掉vscode编辑器的全局配置
- extensions.json:用来设置项目用到的插件推荐列表

<!-- tabs:start -->

<!-- tab:setting.json -->
```json
{
 "editor.defaultFormatter": "esbenp.prettier-vscode",
 "editor.formatOnSave": true,
 "editor.codeActionsOnSave": {
   "source.fixAll": true,
   "source.fixAll.eslint": true,
   "source.fixAll.stylelint": true
},
 "stylelint.validate": ["css", "less", "scss", "vue"]
}

```

<!-- tab:extensions.json -->
```json
{
 "recommendations": [
   "dbaeumer.vscode-eslint",
   "esbenp.prettier-vscode",
   "Vue.volar"
]
}

```

<!-- tabs:end -->


## vscode 代码图片

> polacode
Expand Down Expand Up @@ -277,3 +322,11 @@
### 注意事项

1. 在setting.json设置为单引号,去除分号的设置无效,需在`.prettierrc.json`中设置


## setting.json设置

> 参考:
> https://code.visualstudio.com/docs/getstarted/settings
> https://juejin.cn/post/7276628114981388349
1 change: 1 addition & 0 deletions docs/usage-project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [项目启动时依赖安装失败问题汇总](docs/usage-project/项目启动安装依赖失败问题汇总.md)
- [项目package.json介绍](docs/usage-project/项目package.json介绍.md)
- [项目gitignore规则解析](docs/usage-project/gitignore规则.md)
- [项目editorconfig规则解析](docs/usage-project/editorconfig.md)
- [项目npmrc规则解析](docs/usage-project/npmrc规则.md)
- [项目git历史大文件删除追踪](docs/usage-project/git历史大文件删除追踪.md)
- [electron-vue依赖升级](docs/usage-project/electron-vue依赖升级.md)
Expand Down
1 change: 1 addition & 0 deletions docs/usage-project/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [项目启动时依赖安装失败问题汇总](docs/usage-project/项目启动安装依赖失败问题汇总.md)
- [项目package.json介绍](docs/usage-project/项目package.json介绍.md)
- [项目gitignore规则解析](docs/usage-project/gitignore规则.md)
- [项目editorconfig规则解析](docs/usage-project/editorconfig.md)
- [项目npmrc规则解析](docs/usage-project/npmrc规则.md)
- [项目git历史大文件删除追踪](docs/usage-project/git历史大文件删除追踪.md)
- [electron-vue依赖升级](docs/usage-project/electron-vue依赖升级.md)
Expand Down
10 changes: 10 additions & 0 deletions docs/usage-project/editorconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 项目editorconfig配置

定义:帮助开发人员在不同的编辑器和IDE之间定义和维护一致的编码样式,统一编码风格的配置文件。

文件位置:`/root/.editorconfig`

安装插件:EditorConfig for VS Code

注意:
- 如果项目目录中同时存在 Prettier 和 .editorconfig文件,Prettier会将.editorconfig文件中的规则转换为相应的Prettier配置。
2 changes: 1 addition & 1 deletion logs.json

Large diffs are not rendered by default.

0 comments on commit 1951d37

Please sign in to comment.