diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e052c26..d79b0f3 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -17,7 +17,7 @@ module.exports = { segment: true }, rules: { - eqeqeq: ['off'], + 'eqeqeq': ['off'], 'prefer-const': ['off'], 'arrow-body-style': 'off' } diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..b7807b0 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run format \ No newline at end of file diff --git a/.prettierrc.json b/.prettierrc.json index 4d12705..020097a 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,15 +1,15 @@ { - "$schema": "https://json.schemastore.org/prettierrc", - "semi": false, - "tabWidth": 2, - "singleQuote": true, - "printWidth": 80, - "trailingComma": "none", - "useTabs": false, - "proseWrap": "preserve", - "arrowParens": "avoid", - "bracketSpacing": true, - "endOfLine": "auto", - "quoteProps": "consistent", - "vueIndentScriptAndStyle": true - } \ No newline at end of file + "$schema": "https://json.schemastore.org/prettierrc", + "semi": false, + "tabWidth": 2, + "singleQuote": true, + "printWidth": 80, + "trailingComma": "none", + "useTabs": false, + "proseWrap": "preserve", + "arrowParens": "avoid", + "bracketSpacing": true, + "endOfLine": "auto", + "quoteProps": "consistent", + "vueIndentScriptAndStyle": true +} diff --git a/README.md b/README.md index d7cd11f..c546ec1 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,6 @@ 该版本将支持TS、TSX环境,提供Miao-Yunzai完全的类型声明及其开发文档。 - ## 新版目录 - 核心源码 @@ -25,7 +24,7 @@ src/core - 接口板块 -src/mts +src/mys - 工具类 @@ -47,7 +46,7 @@ yum groupinstall fonts -y - libstdc -下载 [libstdc++.so.6.0.29.zip](https://baiyin1314.lanzouq.com/i8Nr21ig8hyf) +下载 [libstdc++.so.6.0.29.zip](https://baiyin1314.lanzouq.com/i8Nr21ig8hyf) 将 **解压缩后** 的文件放在/usr/lib64/中 @@ -73,10 +72,10 @@ node --no-warnings=ExperimentalWarning --loader ts-node/esm alemon.config.ts ## 致谢 -| Nickname | Contribution | -|:-------------------------------------------------------------:|------------------| -| [Yunzai v3.0](https://gitee.com/le-niao/Yunzai-Bot) | 乐神的Yunzai-Bot V3 | -| [GardenHamster](https://github.com/GardenHamster/GenshinPray) | 模拟抽卡背景素材来源 | -| [西风驿站](https://bbs.mihoyo.com/ys/collection/839181) | 角色攻略图来源 | -| [米游社友人A](https://bbs.mihoyo.com/ys/collection/428421) | 角色突破素材图来源 | -| [icqq](https://github.com/icqqjs/icqq) | ICQQ | +| Nickname | Contribution | +| :-----------------------------------------------------------: | -------------------- | +| [Yunzai v3.0](https://gitee.com/le-niao/Yunzai-Bot) | 乐神的Yunzai-Bot V3 | +| [GardenHamster](https://github.com/GardenHamster/GenshinPray) | 模拟抽卡背景素材来源 | +| [西风驿站](https://bbs.mihoyo.com/ys/collection/839181) | 角色攻略图来源 | +| [米游社友人A](https://bbs.mihoyo.com/ys/collection/428421) | 角色突破素材图来源 | +| [icqq](https://github.com/icqqjs/icqq) | ICQQ | diff --git a/package.json b/package.json index 44a0f3c..7111065 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "app": "ts-node app.js", "dev": "ts-node app.js dev", "login": "ts-node app.js login", - "format": "prettier --write ." + "format": "prettier --write .", + "prepare": "husky" }, "dependencies": { "art-template": "^4.13.2", diff --git a/src/core/local.js b/src/core/local.js index bf058f7..b7100fa 100644 --- a/src/core/local.js +++ b/src/core/local.js @@ -1 +1 @@ -export * from "#miao" +export * from '#miao' diff --git a/src/core/plugin.ts b/src/core/plugin.ts index b4ff544..81793ea 100644 --- a/src/core/plugin.ts +++ b/src/core/plugin.ts @@ -210,4 +210,4 @@ export class plugin { async renderImg(plugin, tpl, data, cfg) { return Common.render(plugin, tpl, data, { ...cfg, e: this.e }) } -} \ No newline at end of file +} diff --git a/src/core/types.ts b/src/core/types.ts index e6d00dd..c624c13 100644 --- a/src/core/types.ts +++ b/src/core/types.ts @@ -15,4 +15,4 @@ export interface EventType extends GroupMessage { // 函数式回调类型 export type MessageCallBackType = ( e: EventType -) => Promise \ No newline at end of file +) => Promise diff --git a/src/index.ts b/src/index.ts index 8b3ea21..b689073 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ export * from './core/index.js' export * from './mys/index.js' -export * from './utils/index.js' \ No newline at end of file +export * from './utils/index.js' diff --git a/src/mys/index.ts b/src/mys/index.ts index 693da49..336ce12 100644 --- a/src/mys/index.ts +++ b/src/mys/index.ts @@ -1 +1 @@ -export {} \ No newline at end of file +export {} diff --git a/src/utils/config.ts b/src/utils/config.ts index 68f7f40..064ed87 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,5 +1,5 @@ /** - * + * */ export class BaseConfig { #data: D = null diff --git a/src/utils/index.ts b/src/utils/index.ts index 240aa95..487ee37 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,3 +1,3 @@ export * from './config.js' export * from './puppeteer.js' -export * from './types.js' \ No newline at end of file +export * from './types.js' diff --git a/src/utils/puppeteer.ts b/src/utils/puppeteer.ts index 296cc9e..76df64f 100644 --- a/src/utils/puppeteer.ts +++ b/src/utils/puppeteer.ts @@ -37,7 +37,7 @@ export class Puppeteer { #isBrowser = false // 配置 #launch: PuppeteerLaunchOptions = PuppeteerLunchConfig.all() - + /** * 设置 * @param val @@ -154,4 +154,4 @@ export class Puppeteer { return false } } -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index 1e33198..fcd7851 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,23 @@ { - "compilerOptions": { - "target": "ESNext", - "module": "ESNext", - "noImplicitAny": false, - "esModuleInterop": true, - "moduleResolution": "node", - "removeComments": true, - "preserveConstEnums": true, - "ignoreDeprecations": "5.0", - "jsx": "react", - "allowJs": false, - "suppressImplicitAnyIndexErrors": true, - "typeRoots": ["node_modules/@types"] - }, - "ts-node": { - "esm": true, - "transpileOnly": true, - "experimentalSpecifierResolution": "node" - }, - "include": ["plugins", "lib","src"], - "exclude": ["node_modules"] - } - \ No newline at end of file + "compilerOptions": { + "target": "ESNext", + "module": "ESNext", + "noImplicitAny": false, + "esModuleInterop": true, + "moduleResolution": "node", + "removeComments": true, + "preserveConstEnums": true, + "ignoreDeprecations": "5.0", + "jsx": "react", + "allowJs": false, + "suppressImplicitAnyIndexErrors": true, + "typeRoots": ["node_modules/@types"] + }, + "ts-node": { + "esm": true, + "transpileOnly": true, + "experimentalSpecifierResolution": "node" + }, + "include": ["plugins", "lib", "src"], + "exclude": ["node_modules"] +}