mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-06 08:32:51 +08:00
🔧 完善格式化配置
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
semi: true
|
|
||||||
singleQuote: false
|
|
||||||
printWidth: 100
|
|
||||||
useTabs: false
|
|
||||||
tabWidth: 2
|
|
||||||
bracketSpacing: true
|
bracketSpacing: true
|
||||||
endOfLine: auto
|
endOfLine: auto
|
||||||
|
printWidth: 100
|
||||||
|
semi: true
|
||||||
|
singleQuote: false
|
||||||
|
tabWidth: 2
|
||||||
trailingComma: all
|
trailingComma: all
|
||||||
|
useTabs: false
|
||||||
|
|||||||
@@ -1,20 +1,42 @@
|
|||||||
|
customSyntax: postcss-html
|
||||||
extends:
|
extends:
|
||||||
- stylelint-high-performance-animation
|
- stylelint-high-performance-animation
|
||||||
- stylelint-order
|
- stylelint-order
|
||||||
- stylelint-declaration-block-no-ignored-properties
|
- stylelint-declaration-block-no-ignored-properties
|
||||||
- stylelint-config-standard-vue
|
- stylelint-config-standard-vue
|
||||||
|
- stylelint-config-standard-scss
|
||||||
- stylelint-config-idiomatic-order
|
- stylelint-config-idiomatic-order
|
||||||
|
overrides:
|
||||||
|
- customSyntax: postcss-scss
|
||||||
|
files:
|
||||||
|
- "*.scss"
|
||||||
plugins:
|
plugins:
|
||||||
- stylelint-scss
|
- stylelint-scss
|
||||||
- stylelint-prettier
|
- stylelint-prettier
|
||||||
- stylelint-order
|
- stylelint-order
|
||||||
- "@btmuli/stylelint-plugin-color"
|
- "@btmuli/stylelint-plugin-color"
|
||||||
rules:
|
rules:
|
||||||
property-no-vendor-prefix:
|
|
||||||
- true
|
|
||||||
- ignoreProperties: [backdrop-filter]
|
|
||||||
color-hex-length: long
|
color-hex-length: long
|
||||||
prettier/prettier: true
|
|
||||||
color/format:
|
color/format:
|
||||||
- true
|
- true
|
||||||
- hexa
|
- hexa
|
||||||
|
import-notation: string
|
||||||
|
no-descending-specificity:
|
||||||
|
- true
|
||||||
|
- severity: warning
|
||||||
|
order/order:
|
||||||
|
- custom-properties
|
||||||
|
- declarations
|
||||||
|
- rules
|
||||||
|
- at-rules
|
||||||
|
prettier/prettier: true
|
||||||
|
property-no-vendor-prefix:
|
||||||
|
- true
|
||||||
|
- ignoreProperties: [backdrop-filter]
|
||||||
|
rule-empty-line-before:
|
||||||
|
- always
|
||||||
|
- except: ["first-nested"]
|
||||||
|
selector-class-pattern: null
|
||||||
|
selector-pseudo-class-no-unknown:
|
||||||
|
- true
|
||||||
|
- ignorePseudoClasses: ["deep"]
|
||||||
|
|||||||
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Debug",
|
"name": "Debug",
|
||||||
@@ -9,5 +8,6 @@
|
|||||||
"skipFiles": ["<node_internals>/**"],
|
"skipFiles": ["<node_internals>/**"],
|
||||||
"type": "node"
|
"type": "node"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"version": "0.2.0"
|
||||||
}
|
}
|
||||||
|
|||||||
30
.vscode/settings.json
vendored
30
.vscode/settings.json
vendored
@@ -1,33 +1,33 @@
|
|||||||
{
|
{
|
||||||
"editor.tabSize": 2,
|
|
||||||
"eslint.format.enable": true,
|
|
||||||
"eslint.quiet": false,
|
|
||||||
"eslint.lintTask.enable": true,
|
|
||||||
"eslint.validate": ["typescript", "vue"],
|
|
||||||
"stylelint.enable": true,
|
|
||||||
"stylelint.validate": ["css", "less", "postcss"],
|
|
||||||
"css.validate": false,
|
|
||||||
"less.validate": false,
|
|
||||||
"scss.validate": false,
|
|
||||||
"[vue]": {
|
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
|
||||||
},
|
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
},
|
},
|
||||||
"[javascriptreact]": {
|
"[javascriptreact]": {
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
},
|
},
|
||||||
|
"[scss]": {
|
||||||
|
"editor.defaultFormatter": "stylelint.vscode-stylelint"
|
||||||
|
},
|
||||||
"[typescript]": {
|
"[typescript]": {
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
},
|
},
|
||||||
"[typescriptreact]": {
|
"[typescriptreact]": {
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
},
|
},
|
||||||
"[scss]": {
|
"[vue]": {
|
||||||
"editor.defaultFormatter": "stylelint.vscode-stylelint"
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
},
|
},
|
||||||
|
"css.validate": false,
|
||||||
"editor.rulers": [80, 120],
|
"editor.rulers": [80, 120],
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"eslint.format.enable": true,
|
||||||
|
"eslint.lintTask.enable": true,
|
||||||
|
"eslint.quiet": false,
|
||||||
|
"eslint.validate": ["typescript", "vue"],
|
||||||
|
"less.validate": false,
|
||||||
|
"scss.validate": false,
|
||||||
|
"stylelint.enable": true,
|
||||||
|
"stylelint.validate": ["css", "less", "postcss"],
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
"typescript.tsdk": "node_modules/typescript/lib",
|
||||||
"vue.features.codeActions.enable": false
|
"vue.features.codeActions.enable": false
|
||||||
}
|
}
|
||||||
|
|||||||
4
.vscode/tasks.json
vendored
4
.vscode/tasks.json
vendored
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "2.0.0",
|
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"type": "npm",
|
"type": "npm",
|
||||||
@@ -7,5 +6,6 @@
|
|||||||
"problemMatcher": ["$eslint-compact", "$eslint-stylish"],
|
"problemMatcher": ["$eslint-compact", "$eslint-stylish"],
|
||||||
"label": "npm: lint:code"
|
"label": "npm: lint:code"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"version": "2.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
import eslint_jsonc from "eslint-plugin-jsonc";
|
/**
|
||||||
import eslint_js from "@eslint/js";
|
* @file eslint.config.mjs
|
||||||
import eslint_ts from "typescript-eslint";
|
* @description ESLint配置文件
|
||||||
import eslint_vue from "eslint-plugin-vue";
|
* @since 2025-05-29
|
||||||
|
*/
|
||||||
|
import eslintPluginJsonc from "eslint-plugin-jsonc";
|
||||||
|
import eslintPluginJs from "@eslint/js";
|
||||||
|
import eslintPluginTs from "typescript-eslint";
|
||||||
|
import eslintPluginVue from "eslint-plugin-vue";
|
||||||
|
|
||||||
import { jsonEslintConfig } from "./eslint/jsonEslint.js";
|
import eslintConfigJson from "./eslint/jsonEslint.js";
|
||||||
import { vueEslintConfig } from "./eslint/vueEslint.js";
|
import eslintConfigVue from "./eslint/vueEslint.js";
|
||||||
import ymlEslintConfig from "./eslint/ymlEslint.js";
|
import eslintConfigYml from "./eslint/ymlEslint.js";
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
eslint_js.configs.recommended,
|
eslintPluginJs.configs.recommended,
|
||||||
...eslint_jsonc.configs["flat/recommended-with-jsonc"],
|
...eslintPluginJsonc.configs["flat/recommended-with-jsonc"],
|
||||||
...eslint_ts.configs.recommended,
|
...eslintPluginTs.configs.recommended,
|
||||||
...eslint_vue.configs["flat/essential"],
|
...eslintPluginVue.configs["flat/essential"],
|
||||||
...jsonEslintConfig,
|
...eslintConfigJson,
|
||||||
...vueEslintConfig,
|
...eslintConfigVue,
|
||||||
ymlEslintConfig,
|
eslintConfigYml,
|
||||||
{
|
{
|
||||||
ignores: [
|
ignores: [
|
||||||
"dist",
|
"dist",
|
||||||
@@ -24,10 +29,7 @@ export default [
|
|||||||
"src-tauri/tauri.conf.json",
|
"src-tauri/tauri.conf.json",
|
||||||
"src-tauri/**/*.json",
|
"src-tauri/**/*.json",
|
||||||
"qodana.yaml",
|
"qodana.yaml",
|
||||||
".github",
|
".github"
|
||||||
".vscode",
|
|
||||||
".prettierrc.yml",
|
|
||||||
".stylelintrc.yml",
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* @file eslint/jsonEslint.js
|
||||||
|
* @description JSON相关的ESLint配置
|
||||||
|
* @since Beta v0.7.7
|
||||||
|
*/
|
||||||
|
|
||||||
import pluginJsonc from "eslint-plugin-jsonc";
|
import pluginJsonc from "eslint-plugin-jsonc";
|
||||||
import parserJsonc from "jsonc-eslint-parser";
|
import parserJsonc from "jsonc-eslint-parser";
|
||||||
|
|
||||||
@@ -66,4 +72,6 @@ const jsoncConfig = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const jsonEslintConfig = [pkgJsonConfig, tscJsonConfig, jsoncConfig];
|
const eslintConfigJson = [pkgJsonConfig, tscJsonConfig, jsoncConfig];
|
||||||
|
|
||||||
|
export default eslintConfigJson;
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* @file eslint/vueEslint.js
|
||||||
|
* @description Vue相关的ESLint配置
|
||||||
|
* @since Beta v0.7.7
|
||||||
|
*/
|
||||||
import pluginImport from "eslint-plugin-import";
|
import pluginImport from "eslint-plugin-import";
|
||||||
import pluginPrettier from "eslint-plugin-prettier";
|
import pluginPrettier from "eslint-plugin-prettier";
|
||||||
import pluginVue from "eslint-plugin-vue";
|
import pluginVue from "eslint-plugin-vue";
|
||||||
@@ -49,4 +54,7 @@ const vueConfig = {
|
|||||||
rules: { ...tsConfigRules, "vue/multi-word-component-names": "off" },
|
rules: { ...tsConfigRules, "vue/multi-word-component-names": "off" },
|
||||||
};
|
};
|
||||||
|
|
||||||
export const vueEslintConfig = [tsConfig, vueConfig];
|
const eslintConfigVue = [tsConfig, vueConfig];
|
||||||
|
|
||||||
|
export default eslintConfigVue;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* @file eslint/ymlEslint.js
|
||||||
|
* @description YAML相关的ESLint配置
|
||||||
|
* @since Beta v0.7.7
|
||||||
|
*/
|
||||||
import pluginYml from "eslint-plugin-yml";
|
import pluginYml from "eslint-plugin-yml";
|
||||||
import parserYml from "yaml-eslint-parser";
|
import parserYml from "yaml-eslint-parser";
|
||||||
|
|
||||||
const ymlEslintConfig = {
|
const eslintConfigYml = {
|
||||||
files: ["**/*.yml", "**/*.yaml"],
|
files: ["**/*.yml", "**/*.yaml"],
|
||||||
plugins: { yml: pluginYml },
|
plugins: { yml: pluginYml },
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
@@ -16,4 +21,4 @@ const ymlEslintConfig = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ymlEslintConfig;
|
export default eslintConfigYml;
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -40,7 +40,8 @@
|
|||||||
"prettier --write",
|
"prettier --write",
|
||||||
"stylelint --fix"
|
"stylelint --fix"
|
||||||
],
|
],
|
||||||
"*.{yml,json,md}": [
|
"*.{yml,json}": [
|
||||||
|
"eslint --fix",
|
||||||
"prettier --write"
|
"prettier --write"
|
||||||
],
|
],
|
||||||
"*.rs": [
|
"*.rs": [
|
||||||
@@ -94,11 +95,11 @@
|
|||||||
"qrcode.vue": "^3.6.0",
|
"qrcode.vue": "^3.6.0",
|
||||||
"sass-embedded": "^1.89.0",
|
"sass-embedded": "^1.89.0",
|
||||||
"uuid": "^11.1.0",
|
"uuid": "^11.1.0",
|
||||||
"vue": "^3.5.14",
|
"vue": "^3.5.16",
|
||||||
"vue-echarts": "^7.0.3",
|
"vue-echarts": "^7.0.3",
|
||||||
"vue-json-pretty": "^2.4.0",
|
"vue-json-pretty": "^2.4.0",
|
||||||
"vue-router": "^4.5.1",
|
"vue-router": "^4.5.1",
|
||||||
"vuetify": "^3.8.6",
|
"vuetify": "^3.8.7",
|
||||||
"wcag-color": "^1.1.1",
|
"wcag-color": "^1.1.1",
|
||||||
"xml-js": "^1.6.11"
|
"xml-js": "^1.6.11"
|
||||||
},
|
},
|
||||||
@@ -110,9 +111,9 @@
|
|||||||
"@types/color-convert": "^2.0.4",
|
"@types/color-convert": "^2.0.4",
|
||||||
"@types/fs-extra": "^11.0.4",
|
"@types/fs-extra": "^11.0.4",
|
||||||
"@types/js-md5": "^0.7.2",
|
"@types/js-md5": "^0.7.2",
|
||||||
"@types/node": "^22.15.21",
|
"@types/node": "^22.15.24",
|
||||||
"@types/uuid": "^10.0.0",
|
"@types/uuid": "^10.0.0",
|
||||||
"@typescript-eslint/parser": "^8.32.1",
|
"@typescript-eslint/parser": "^8.33.0",
|
||||||
"@vitejs/plugin-vue": "^5.2.4",
|
"@vitejs/plugin-vue": "^5.2.4",
|
||||||
"concurrently": "^9.1.2",
|
"concurrently": "^9.1.2",
|
||||||
"eslint": "^9.27.0",
|
"eslint": "^9.27.0",
|
||||||
@@ -125,11 +126,12 @@
|
|||||||
"globals": "^16.2.0",
|
"globals": "^16.2.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"jsonc-eslint-parser": "^2.4.0",
|
"jsonc-eslint-parser": "^2.4.0",
|
||||||
"lint-staged": "^16.0.0",
|
"lint-staged": "^16.1.0",
|
||||||
"oxlint": "^0.16.12",
|
"oxlint": "^0.16.12",
|
||||||
"prettier": "3.5.3",
|
"prettier": "3.5.3",
|
||||||
"stylelint": "^16.19.1",
|
"stylelint": "^16.19.1",
|
||||||
"stylelint-config-idiomatic-order": "^10.0.0",
|
"stylelint-config-idiomatic-order": "^10.0.0",
|
||||||
|
"stylelint-config-standard-scss": "^15.0.1",
|
||||||
"stylelint-config-standard-vue": "^1.0.0",
|
"stylelint-config-standard-vue": "^1.0.0",
|
||||||
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
|
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
|
||||||
"stylelint-high-performance-animation": "^1.11.0",
|
"stylelint-high-performance-animation": "^1.11.0",
|
||||||
@@ -138,7 +140,7 @@
|
|||||||
"stylelint-scss": "^6.12.0",
|
"stylelint-scss": "^6.12.0",
|
||||||
"tsx": "^4.19.4",
|
"tsx": "^4.19.4",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.8.3",
|
||||||
"typescript-eslint": "^8.32.1",
|
"typescript-eslint": "^8.33.0",
|
||||||
"vite": "^6.3.5",
|
"vite": "^6.3.5",
|
||||||
"vite-plugin-vue-devtools": "^7.7.6",
|
"vite-plugin-vue-devtools": "^7.7.6",
|
||||||
"vite-plugin-vuetify": "^2.1.1",
|
"vite-plugin-vuetify": "^2.1.1",
|
||||||
|
|||||||
1033
pnpm-lock.yaml
generated
1033
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -45,7 +45,9 @@
|
|||||||
"scripts/*.ts",
|
"scripts/*.ts",
|
||||||
"tsconfig.json",
|
"tsconfig.json",
|
||||||
"vite.config.ts",
|
"vite.config.ts",
|
||||||
"eslint.config.mjs"
|
"eslint.config.mjs",
|
||||||
],
|
".prettierrc.yml",
|
||||||
"exclude": ["node_modules"]
|
".stylelintrc.yml",
|
||||||
|
"eslint/*.js"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user