Skip to content

Commit

Permalink
开发环境更新
Browse files Browse the repository at this point in the history
改用 Vite 打包, 添加 env 环境, 修改 vscode launch 配置, 更新 eslint 配置, 修复 BUG: 文件夹右键格式化却只能格式化根目录
  • Loading branch information
xiaohuohumax committed Mar 24, 2024
1 parent 2060100 commit 2bc72a2
Show file tree
Hide file tree
Showing 26 changed files with 845 additions and 419 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-guests-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"format-files-by-ignores": minor
---

改用 Vite 打包, 添加 env 环境, 修改 vscode launch 配置, 更新 eslint 配置, 修复 BUG: 文件夹右键格式化却只能格式化根目录
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
out/
65 changes: 35 additions & 30 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
2
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [
"camelCase",
"PascalCase"
]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-empty": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
12 changes: 6 additions & 6 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
}
32 changes: 16 additions & 16 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
16 changes: 8 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
"files.exclude": {
"out": false // set this to true to hide the "out" folder with the compiled JS files
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
45 changes: 28 additions & 17 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"label": "npm: watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "vite",
"pattern": {
"regexp": ""
},
"background": {
"activeOnStart": true,
"beginsPattern": "^build started\\.\\.\\.$",
"endsPattern": "^built in (\\d+ms)"
}
}
}
]
}
3 changes: 3 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.vscode/**
.vscode-test/**
src/**
images/**
env/**
types/**
.gitignore
.yarnrc
vsc-extension-quickstart.md
Expand Down
6 changes: 6 additions & 0 deletions env/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 日志等级
VITE_LOG_LEVEL = Debug
# 日志打印格式
VITE_LOG_FORMAT = :time :level: :msg
# 输出窗口名称
VITE_OUTPUT_CHANNEL_NAME = Format Files By Ignores
4 changes: 4 additions & 0 deletions env/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 生产发布

# 日志打印格式
VITE_LOG_LEVEL = Info
Loading

0 comments on commit 2bc72a2

Please sign in to comment.