build(clinical-web): 添加 ESLint 和 Prettier 配置

This commit is contained in:
yelan
2026-08-27 10:51:40 +08:00
parent 3f27d4dd3a
commit 01827bf304
18 changed files with 2784 additions and 34 deletions

View File

@@ -0,0 +1,7 @@
node_modules
dist
coverage
package-lock.json
public
*.min.*
*.tsbuildinfo

View File

@@ -0,0 +1,10 @@
{
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf"
}

View File

@@ -77,7 +77,7 @@ Vitest
Playwright Playwright
``` ```
签字板调用应通过独立的 ```signature-adapter``` 或本地桥接服务封装,业务页面不直接绑定具体厂商 SDK。 签字板调用应通过独立的 `signature-adapter` 或本地桥接服务封装,业务页面不直接绑定具体厂商 SDK。
## 非目标 ## 非目标

View File

@@ -0,0 +1,52 @@
import eslint from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: ['**/dist/**', '**/node_modules/**', '**/coverage/**', '**/*.d.ts'],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...eslintPluginVue.configs['flat/recommended'],
{
files: ['**/*.{ts,tsx,vue}'],
languageOptions: {
globals: globals.browser,
parserOptions: {
parser: tseslint.parser,
},
},
},
{
files: ['**/*.{js,mjs,cjs}'],
languageOptions: {
globals: globals.node,
},
},
{
files: ['vite.config.ts', '*.config.{js,mjs,cjs,ts}'],
languageOptions: {
globals: globals.node,
},
},
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
'vue/multi-word-component-names': 'off',
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
},
},
eslintConfigPrettier,
)

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,11 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vue-tsc -b && vite build", "build": "vue-tsc -b && vite build",
"preview": "vite preview" "preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier . --write",
"format:check": "prettier . --check"
}, },
"dependencies": { "dependencies": {
"axios": "^1.20.0", "axios": "^1.20.0",
@@ -16,10 +20,17 @@
"vue-router": "^5.2.0" "vue-router": "^5.2.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^10.0.1",
"@types/node": "^24.13.3", "@types/node": "^24.13.3",
"@vitejs/plugin-vue": "^6.0.8", "@vitejs/plugin-vue": "^6.0.8",
"@vue/tsconfig": "^0.9.1", "@vue/tsconfig": "^0.9.1",
"eslint": "^10.9.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-vue": "^10.10.0",
"globals": "^17.11.0",
"prettier": "^3.9.6",
"typescript": "~6.0.2", "typescript": "~6.0.2",
"typescript-eslint": "^8.68.0",
"vite": "^8.2.2", "vite": "^8.2.2",
"vue-tsc": "^3.3.11" "vue-tsc": "^3.3.11"
} }

View File

@@ -18,9 +18,7 @@ const count = ref(0)
<h1>Get started</h1> <h1>Get started</h1>
<p>Edit <code>src/App.vue</code> and save to test <code>HMR</code></p> <p>Edit <code>src/App.vue</code> and save to test <code>HMR</code></p>
</div> </div>
<button type="button" class="counter" @click="count++"> <button type="button" class="counter" @click="count++">Count is {{ count }}</button>
Count is {{ count }}
</button>
</section> </section>
<div class="ticks"></div> <div class="ticks"></div>

View File

@@ -8,8 +8,7 @@
--accent-bg: rgba(170, 59, 255, 0.1); --accent-bg: rgba(170, 59, 255, 0.1);
--accent-border: rgba(170, 59, 255, 0.5); --accent-border: rgba(170, 59, 255, 0.5);
--social-bg: rgba(244, 243, 236, 0.5); --social-bg: rgba(244, 243, 236, 0.5);
--shadow: --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
--sans: system-ui, 'Segoe UI', Roboto, sans-serif; --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
--heading: system-ui, 'Segoe UI', Roboto, sans-serif; --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
@@ -41,8 +40,7 @@
--accent-bg: rgba(192, 132, 252, 0.15); --accent-bg: rgba(192, 132, 252, 0.15);
--accent-border: rgba(192, 132, 252, 0.5); --accent-border: rgba(192, 132, 252, 0.5);
--social-bg: rgba(47, 48, 58, 0.5); --social-bg: rgba(47, 48, 58, 0.5);
--shadow: --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
} }
#social .button-icon { #social .button-icon {
@@ -142,8 +140,7 @@ code {
z-index: 1; z-index: 1;
top: 34px; top: 34px;
height: 28px; height: 28px;
transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) scale(1.4);
scale(1.4);
} }
.vite { .vite {
@@ -151,8 +148,7 @@ code {
top: 107px; top: 107px;
height: 26px; height: 26px;
width: auto; width: auto;
transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) scale(0.8);
scale(0.8);
} }
} }

View File

@@ -1,7 +1,4 @@
{ {
"files": [], "files": [],
"references": [ "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
} }

View File

@@ -7,6 +7,10 @@
"dev:clinical": "npm --prefix clinical-web run dev", "dev:clinical": "npm --prefix clinical-web run dev",
"dev:patient": "npm --prefix patient-h5 run dev", "dev:patient": "npm --prefix patient-h5 run dev",
"build:clinical": "npm --prefix clinical-web run build", "build:clinical": "npm --prefix clinical-web run build",
"build:patient": "npm --prefix patient-h5 run build" "build:patient": "npm --prefix patient-h5 run build",
"lint": "npm --prefix clinical-web run lint && npm --prefix patient-h5 run lint",
"lint:fix": "npm --prefix clinical-web run lint:fix && npm --prefix patient-h5 run lint:fix",
"format": "npm --prefix clinical-web run format && npm --prefix patient-h5 run format",
"format:check": "npm --prefix clinical-web run format:check && npm --prefix patient-h5 run format:check"
} }
} }

View File

@@ -0,0 +1,7 @@
node_modules
dist
coverage
package-lock.json
public
*.min.*
*.tsbuildinfo

View File

@@ -0,0 +1,10 @@
{
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf"
}

View File

@@ -0,0 +1,52 @@
import eslint from '@eslint/js'
import eslintConfigPrettier from 'eslint-config-prettier'
import eslintPluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{
ignores: ['**/dist/**', '**/node_modules/**', '**/coverage/**', '**/*.d.ts'],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...eslintPluginVue.configs['flat/recommended'],
{
files: ['**/*.{ts,tsx,vue}'],
languageOptions: {
globals: globals.browser,
parserOptions: {
parser: tseslint.parser,
},
},
},
{
files: ['**/*.{js,mjs,cjs}'],
languageOptions: {
globals: globals.node,
},
},
{
files: ['vite.config.ts', '*.config.{js,mjs,cjs,ts}'],
languageOptions: {
globals: globals.node,
},
},
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
'vue/multi-word-component-names': 'off',
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
},
},
eslintConfigPrettier,
)

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,11 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vue-tsc -b && vite build", "build": "vue-tsc -b && vite build",
"preview": "vite preview" "preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier . --write",
"format:check": "prettier . --check"
}, },
"dependencies": { "dependencies": {
"axios": "^1.20.0", "axios": "^1.20.0",
@@ -14,10 +18,17 @@
"vue-router": "^5.2.0" "vue-router": "^5.2.0"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^10.0.1",
"@types/node": "^24.13.3", "@types/node": "^24.13.3",
"@vitejs/plugin-vue": "^6.0.8", "@vitejs/plugin-vue": "^6.0.8",
"@vue/tsconfig": "^0.9.1", "@vue/tsconfig": "^0.9.1",
"eslint": "^10.9.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-vue": "^10.10.0",
"globals": "^17.11.0",
"prettier": "^3.9.6",
"typescript": "~6.0.2", "typescript": "~6.0.2",
"typescript-eslint": "^8.68.0",
"vite": "^8.2.2", "vite": "^8.2.2",
"vue-tsc": "^3.3.11" "vue-tsc": "^3.3.11"
} }

View File

@@ -18,9 +18,7 @@ const count = ref(0)
<h1>Get started</h1> <h1>Get started</h1>
<p>Edit <code>src/App.vue</code> and save to test <code>HMR</code></p> <p>Edit <code>src/App.vue</code> and save to test <code>HMR</code></p>
</div> </div>
<button type="button" class="counter" @click="count++"> <button type="button" class="counter" @click="count++">Count is {{ count }}</button>
Count is {{ count }}
</button>
</section> </section>
<div class="ticks"></div> <div class="ticks"></div>

View File

@@ -8,8 +8,7 @@
--accent-bg: rgba(170, 59, 255, 0.1); --accent-bg: rgba(170, 59, 255, 0.1);
--accent-border: rgba(170, 59, 255, 0.5); --accent-border: rgba(170, 59, 255, 0.5);
--social-bg: rgba(244, 243, 236, 0.5); --social-bg: rgba(244, 243, 236, 0.5);
--shadow: --shadow: rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
--sans: system-ui, 'Segoe UI', Roboto, sans-serif; --sans: system-ui, 'Segoe UI', Roboto, sans-serif;
--heading: system-ui, 'Segoe UI', Roboto, sans-serif; --heading: system-ui, 'Segoe UI', Roboto, sans-serif;
@@ -41,8 +40,7 @@
--accent-bg: rgba(192, 132, 252, 0.15); --accent-bg: rgba(192, 132, 252, 0.15);
--accent-border: rgba(192, 132, 252, 0.5); --accent-border: rgba(192, 132, 252, 0.5);
--social-bg: rgba(47, 48, 58, 0.5); --social-bg: rgba(47, 48, 58, 0.5);
--shadow: --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
} }
#social .button-icon { #social .button-icon {
@@ -142,8 +140,7 @@ code {
z-index: 1; z-index: 1;
top: 34px; top: 34px;
height: 28px; height: 28px;
transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) scale(1.4);
scale(1.4);
} }
.vite { .vite {
@@ -151,8 +148,7 @@ code {
top: 107px; top: 107px;
height: 26px; height: 26px;
width: auto; width: auto;
transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) scale(0.8);
scale(0.8);
} }
} }

View File

@@ -1,7 +1,4 @@
{ {
"files": [], "files": [],
"references": [ "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }]
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
} }