chore(web): remove prettier, use IDE formatter for code style

Drop prettier, eslint-config-prettier, eslint-plugin-prettier and related
configs. Code formatting is now controlled solely by the IDE (IDEA) via
.editorconfig, eliminating the two-formatter conflict.
This commit is contained in:
pnoker
2026-07-10 00:01:51 +08:00
parent 434034bc0a
commit 4ea339ba14
7 changed files with 14 additions and 200 deletions
+2 -2
View File
@@ -492,8 +492,8 @@ Rules:
- Use `!` for breaking changes and explain the impact in the body.
- For release-note-only commits, use exactly `docs(release): update generated changelog`.
Husky manages Git hooks automatically — no manual install needed. The `pre-commit` hook runs lint-staged (eslint +
prettier) on staged files before each commit. A `commit-msg` hook stub exists (`.husky/_/commit-msg`) but has no
Husky manages Git hooks automatically — no manual install needed. The `pre-commit` hook runs lint-staged (eslint)
on staged files before each commit. A `commit-msg` hook stub exists (`.husky/_/commit-msg`) but has no
validation script attached yet; to enforce conventional-commit format, add a script at `.husky/commit-msg`.
## Testing
-68
View File
@@ -1,68 +0,0 @@
# Dependencies
node_modules
express/node_modules
# Build output
dist
# Docker and deployment
dc3
# Native code
src-tauri
# Static assets
public
*.min.js
*.min.css
*.svg
*.png
*.jpg
*.jpeg
*.gif
*.ico
*.webp
*.woff
*.woff2
*.ttf
*.eot
*.otf
# Lock files
yarn.lock
pnpm-lock.yaml
package-lock.json
# Environment files
.env
.env.local
.env.*.local
# Log files
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.claude
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.history
# GitHub
.github
.husky
# Auto-generated files
components.d.ts
auto-imports.d.ts
# Other
.DS_Store
-30
View File
@@ -1,30 +0,0 @@
/*
* Copyright 2016-present the IoT DC3 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export default {
tabWidth: 2,
printWidth: 120,
semi: true,
singleQuote: true,
endOfLine: 'lf',
trailingComma: 'es5',
bracketSpacing: false,
arrowParens: 'always',
vueIndentScriptAndStyle: true,
htmlWhitespaceSensitivity: 'css',
embeddedLanguageFormatting: 'auto',
proseWrap: 'preserve',
};
+10 -16
View File
@@ -1,25 +1,24 @@
/*
* Copyright 2016-present the IoT DC3 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* https://www.apache.org/licenses/LICENSE-2.0
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import js from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import tsparser from '@typescript-eslint/parser';
import configPrettier from 'eslint-config-prettier/flat';
import {defineConfigWithVueTs, vueTsConfigs} from '@vue/eslint-config-typescript';
import prettier from 'eslint-plugin-prettier';
import vueParser from 'vue-eslint-parser';
import globals from 'globals';
@@ -48,7 +47,6 @@ export default [
js.configs.recommended,
...pluginVue.configs['flat/essential'],
...defineConfigWithVueTs(vueTsConfigs.recommended),
configPrettier,
{
files: ['**/*.mjs'],
languageOptions: {
@@ -79,9 +77,6 @@ export default [
...globals.es2021,
},
},
plugins: {
prettier: prettier,
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
@@ -150,7 +145,6 @@ export default [
'no-case-declarations': 'off',
'eol-last': 'off',
'no-console': 'off',
'prettier/prettier': 'error',
},
},
];
+2 -7
View File
@@ -31,10 +31,8 @@
"preview": "vite preview",
"check": "vue-tsc --noEmit --skipLibCheck",
"type-check": "pnpm run check",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "eslint . --fix && prettier --write .",
"lint:check": "eslint . && prettier --check .",
"lint": "eslint . --fix",
"lint:check": "eslint .",
"test": "vitest run",
"test:unit": "vitest run tests/unit",
"test:api": "vitest run tests/api",
@@ -88,14 +86,11 @@
"@vue/eslint-config-typescript": "^14.9.0",
"@vue/test-utils": "^2.4.11",
"eslint": "^10.6.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.6",
"eslint-plugin-vue": "^10.9.2",
"globals": "^17.7.0",
"happy-dom": "^20.10.6",
"lint-staged": "^17.0.8",
"playwright": "^1.61.1",
"prettier": "^3.9.1",
"sass": "^1.101.0",
"typescript": "~6.0.3",
"unplugin-auto-import": "^21.0.0",
-76
View File
@@ -105,12 +105,6 @@ importers:
eslint:
specifier: ^10.6.0
version: 10.6.0
eslint-config-prettier:
specifier: ^10.1.8
version: 10.1.8(eslint@10.6.0)
eslint-plugin-prettier:
specifier: ^5.5.6
version: 5.5.6(eslint-config-prettier@10.1.8(eslint@10.6.0))(eslint@10.6.0)(prettier@3.9.1)
eslint-plugin-vue:
specifier: ^10.9.2
version: 10.9.2(@typescript-eslint/parser@8.62.0(eslint@10.6.0)(typescript@6.0.3))(eslint@10.6.0)(vue-eslint-parser@10.4.1(eslint@10.6.0))
@@ -126,9 +120,6 @@ importers:
playwright:
specifier: ^1.61.1
version: 1.61.1
prettier:
specifier: ^3.9.1
version: 3.9.1
sass:
specifier: ^1.101.0
version: 1.101.0
@@ -535,10 +526,6 @@ packages:
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'}
'@pkgr/core@0.3.6':
resolution: {integrity: sha512-SEeaJLb3qBNF/OaXnaR1NmmBbFYk1zC0ZH/52fATcRPLFg/p791YrcyFFy44Bo9sLaGuSuLp5Q6axbb/O+v/RA==}
engines: {node: ^14.18.0 || >=16.0.0}
'@playwright/test@1.61.1':
resolution: {integrity: sha512-8nKv6+0RJSL9FE4jYOEGXnPeM/Hg12qZpmqzZjRh3qM0Y7c3z1mrOTfFLids72RDQYVh9WpLEfR5WdpNX4fkig==}
engines: {node: '>=18'}
@@ -1447,26 +1434,6 @@ packages:
resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==}
engines: {node: '>=12'}
eslint-config-prettier@10.1.8:
resolution: {integrity: sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==}
hasBin: true
peerDependencies:
eslint: '>=7.0.0'
eslint-plugin-prettier@5.5.6:
resolution: {integrity: sha512-ifetmTcxWfz+4qRW3pH/ujdTq2jQIj59AxJMIN26K5avYgU8dxycUETQonWiW+wPrYXA0j3Try0l1CnwVQtDqQ==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
'@types/eslint': '>=8.0.0'
eslint: '>=8.0.0'
eslint-config-prettier: '>= 7.0.0 <10.0.0 || >=10.1.0'
prettier: '>=3.0.0'
peerDependenciesMeta:
'@types/eslint':
optional: true
eslint-config-prettier:
optional: true
eslint-plugin-vue@10.9.2:
resolution: {integrity: sha512-4g7ZP3pYcuqd7Zp0pzUKcos0W+RkjBz4EGdhJ92FcYk6v03Ti/GK5NwjgsjxHK+98eXDbHeK7VtX1az7/8doZA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
@@ -1542,9 +1509,6 @@ packages:
fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
fast-diff@1.3.0:
resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==}
fast-glob@3.3.3:
resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==}
engines: {node: '>=8.6.0'}
@@ -2167,15 +2131,6 @@ packages:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
prettier-linter-helpers@1.0.1:
resolution: {integrity: sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg==}
engines: {node: '>=6.0.0'}
prettier@3.9.1:
resolution: {integrity: sha512-ppiDo2CSwexck1eyZUwJHg/N3nf1+6IRCv7W/VJ5vaLnVCmB7+3CdRfMwoCHBBX6xTrREDTksZ4OZl5SSf4zXA==}
engines: {node: '>=14'}
hasBin: true
proto-list@1.2.4:
resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==}
@@ -2347,10 +2302,6 @@ packages:
svg-path-parser@1.1.0:
resolution: {integrity: sha512-jGCUqcQyXpfe38R7RFfhrMyfXcBmpMNJI/B+4CE9/Unkh98UporAc461GTthv+TVDuZXsBx7/WiwJb1Oh4tt4A==}
synckit@0.11.13:
resolution: {integrity: sha512-eNRKgb3z66Yp3D2CixVujOUvXLFUTij/zVnV8KRyvFdQwpz7I5DS8UfRkTeLzb64u+dkzDSdelE24izu+zSSUg==}
engines: {node: ^14.18.0 || >=16.0.0}
text-segmentation@1.0.3:
resolution: {integrity: sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==}
@@ -3182,8 +3133,6 @@ snapshots:
'@pkgjs/parseargs@0.11.0':
optional: true
'@pkgr/core@0.3.6': {}
'@playwright/test@1.61.1':
dependencies:
playwright: 1.61.1
@@ -4143,19 +4092,6 @@ snapshots:
escape-string-regexp@5.0.0: {}
eslint-config-prettier@10.1.8(eslint@10.6.0):
dependencies:
eslint: 10.6.0
eslint-plugin-prettier@5.5.6(eslint-config-prettier@10.1.8(eslint@10.6.0))(eslint@10.6.0)(prettier@3.9.1):
dependencies:
eslint: 10.6.0
prettier: 3.9.1
prettier-linter-helpers: 1.0.1
synckit: 0.11.13
optionalDependencies:
eslint-config-prettier: 10.1.8(eslint@10.6.0)
eslint-plugin-vue@10.9.2(@typescript-eslint/parser@8.62.0(eslint@10.6.0)(typescript@6.0.3))(eslint@10.6.0)(vue-eslint-parser@10.4.1(eslint@10.6.0)):
dependencies:
'@eslint-community/eslint-utils': 4.9.1(eslint@10.6.0)
@@ -4247,8 +4183,6 @@ snapshots:
fast-deep-equal@3.1.3: {}
fast-diff@1.3.0: {}
fast-glob@3.3.3:
dependencies:
'@nodelib/fs.stat': 2.0.5
@@ -4811,12 +4745,6 @@ snapshots:
prelude-ls@1.2.1: {}
prettier-linter-helpers@1.0.1:
dependencies:
fast-diff: 1.3.0
prettier@3.9.1: {}
proto-list@1.2.4: {}
proxy-from-env@2.1.0: {}
@@ -4977,10 +4905,6 @@ snapshots:
svg-path-parser@1.1.0: {}
synckit@0.11.13:
dependencies:
'@pkgr/core': 0.3.6
text-segmentation@1.0.3:
dependencies:
utrie: 1.0.2
-1
View File
@@ -21,4 +21,3 @@ minimumReleaseAgeExclude:
- '@typescript-eslint/visitor-keys@8.62.0'
- axios@1.18.1
- globals@17.7.0
- prettier@3.9.1