style: eslint配置更新

This commit is contained in:
JXDN
2025-09-08 11:35:33 +08:00
parent bbc9176edb
commit 5f6631e18f
3 changed files with 21 additions and 3 deletions
@@ -2,7 +2,6 @@
* 认证相关常量
* @description 定义登录和认证相关的常量
*/
export const LOGIN_METHOD = {
/** 微信登录 */
WECHAT: 3,
+20 -1
View File
@@ -1,9 +1,15 @@
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { config as baseConfig } from "@fastbuildai/config/eslint/base";
import { config as httpConfig } from "@fastbuildai/config/eslint/http";
import vuePlugin from "eslint-plugin-vue";
import tseslint from "typescript-eslint";
import vueParser from "vue-eslint-parser";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
/** @type {import("eslint").Linter.Config} */
export default [
// 忽略规则 - 排除自动生成的代码和构建目录
@@ -12,7 +18,16 @@ export default [
},
// TypeScript 推荐配置
...tseslint.configs.recommended,
...tseslint.configs.recommended.map((config) => ({
...config,
languageOptions: {
...config.languageOptions,
parserOptions: {
...config.languageOptions?.parserOptions,
tsconfigRootDir: __dirname,
},
},
})),
// Vue 相关配置
{
@@ -24,6 +39,7 @@ export default [
parser: vueParser,
parserOptions: {
parser: tseslint.parser,
tsconfigRootDir: __dirname,
extraFileExtensions: [".vue"],
ecmaFeatures: {
jsx: true,
@@ -51,6 +67,9 @@ export default [
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
tsconfigRootDir: __dirname,
},
},
},
+1 -1
View File
@@ -48,7 +48,7 @@ export function useMessage(): MessageService {
const createMessage = (
type: MessageType,
msg: string,
opt: MessageOptions,
opt?: MessageOptions,
): MessageInstance => {
const toastId = toast.add({
...DEFAULT_OPTIONS,