feat: .husky & format

This commit is contained in:
ningmengchongshui 2024-06-08 21:07:07 +08:00
parent ebe968a23c
commit 37712f726a
14 changed files with 58 additions and 58 deletions

View File

@ -17,7 +17,7 @@ module.exports = {
segment: true segment: true
}, },
rules: { rules: {
eqeqeq: ['off'], 'eqeqeq': ['off'],
'prefer-const': ['off'], 'prefer-const': ['off'],
'arrow-body-style': 'off' 'arrow-body-style': 'off'
} }

1
.husky/pre-commit Normal file
View File

@ -0,0 +1 @@
npm run format

View File

@ -1,15 +1,15 @@
{ {
"$schema": "https://json.schemastore.org/prettierrc", "$schema": "https://json.schemastore.org/prettierrc",
"semi": false, "semi": false,
"tabWidth": 2, "tabWidth": 2,
"singleQuote": true, "singleQuote": true,
"printWidth": 80, "printWidth": 80,
"trailingComma": "none", "trailingComma": "none",
"useTabs": false, "useTabs": false,
"proseWrap": "preserve", "proseWrap": "preserve",
"arrowParens": "avoid", "arrowParens": "avoid",
"bracketSpacing": true, "bracketSpacing": true,
"endOfLine": "auto", "endOfLine": "auto",
"quoteProps": "consistent", "quoteProps": "consistent",
"vueIndentScriptAndStyle": true "vueIndentScriptAndStyle": true
} }

View File

@ -16,7 +16,6 @@
该版本将支持TS、TSX环境提供Miao-Yunzai完全的类型声明及其开发文档。 该版本将支持TS、TSX环境提供Miao-Yunzai完全的类型声明及其开发文档。
## 新版目录 ## 新版目录
- 核心源码 - 核心源码
@ -25,7 +24,7 @@ src/core
- 接口板块 - 接口板块
src/mts src/mys
- 工具类 - 工具类
@ -47,7 +46,7 @@ yum groupinstall fonts -y
- libstdc - 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/中 **解压缩后** 的文件放在/usr/lib64/中
@ -73,10 +72,10 @@ node --no-warnings=ExperimentalWarning --loader ts-node/esm alemon.config.ts
## 致谢 ## 致谢
| Nickname | Contribution | | Nickname | Contribution |
|:-------------------------------------------------------------:|------------------| | :-----------------------------------------------------------: | -------------------- |
| [Yunzai v3.0](https://gitee.com/le-niao/Yunzai-Bot) | 乐神的Yunzai-Bot V3 | | [Yunzai v3.0](https://gitee.com/le-niao/Yunzai-Bot) | 乐神的Yunzai-Bot V3 |
| [GardenHamster](https://github.com/GardenHamster/GenshinPray) | 模拟抽卡背景素材来源 | | [GardenHamster](https://github.com/GardenHamster/GenshinPray) | 模拟抽卡背景素材来源 |
| [西风驿站](https://bbs.mihoyo.com/ys/collection/839181) | 角色攻略图来源 | | [西风驿站](https://bbs.mihoyo.com/ys/collection/839181) | 角色攻略图来源 |
| [米游社友人A](https://bbs.mihoyo.com/ys/collection/428421) | 角色突破素材图来源 | | [米游社友人A](https://bbs.mihoyo.com/ys/collection/428421) | 角色突破素材图来源 |
| [icqq](https://github.com/icqqjs/icqq) | ICQQ | | [icqq](https://github.com/icqqjs/icqq) | ICQQ |

View File

@ -9,7 +9,8 @@
"app": "ts-node app.js", "app": "ts-node app.js",
"dev": "ts-node app.js dev", "dev": "ts-node app.js dev",
"login": "ts-node app.js login", "login": "ts-node app.js login",
"format": "prettier --write ." "format": "prettier --write .",
"prepare": "husky"
}, },
"dependencies": { "dependencies": {
"art-template": "^4.13.2", "art-template": "^4.13.2",

View File

@ -1 +1 @@
export * from "#miao" export * from '#miao'

View File

@ -210,4 +210,4 @@ export class plugin {
async renderImg(plugin, tpl, data, cfg) { async renderImg(plugin, tpl, data, cfg) {
return Common.render(plugin, tpl, data, { ...cfg, e: this.e }) return Common.render(plugin, tpl, data, { ...cfg, e: this.e })
} }
} }

View File

@ -15,4 +15,4 @@ export interface EventType extends GroupMessage {
// 函数式回调类型 // 函数式回调类型
export type MessageCallBackType = ( export type MessageCallBackType = (
e: EventType e: EventType
) => Promise<boolean | undefined | void> ) => Promise<boolean | undefined | void>

View File

@ -1,3 +1,3 @@
export * from './core/index.js' export * from './core/index.js'
export * from './mys/index.js' export * from './mys/index.js'
export * from './utils/index.js' export * from './utils/index.js'

View File

@ -1 +1 @@
export {} export {}

View File

@ -1,5 +1,5 @@
/** /**
* *
*/ */
export class BaseConfig<D> { export class BaseConfig<D> {
#data: D = null #data: D = null

View File

@ -1,3 +1,3 @@
export * from './config.js' export * from './config.js'
export * from './puppeteer.js' export * from './puppeteer.js'
export * from './types.js' export * from './types.js'

View File

@ -37,7 +37,7 @@ export class Puppeteer {
#isBrowser = false #isBrowser = false
// 配置 // 配置
#launch: PuppeteerLaunchOptions = PuppeteerLunchConfig.all() #launch: PuppeteerLaunchOptions = PuppeteerLunchConfig.all()
/** /**
* *
* @param val * @param val
@ -154,4 +154,4 @@ export class Puppeteer {
return false return false
} }
} }
} }

View File

@ -1,24 +1,23 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "ESNext",
"noImplicitAny": false, "noImplicitAny": false,
"esModuleInterop": true, "esModuleInterop": true,
"moduleResolution": "node", "moduleResolution": "node",
"removeComments": true, "removeComments": true,
"preserveConstEnums": true, "preserveConstEnums": true,
"ignoreDeprecations": "5.0", "ignoreDeprecations": "5.0",
"jsx": "react", "jsx": "react",
"allowJs": false, "allowJs": false,
"suppressImplicitAnyIndexErrors": true, "suppressImplicitAnyIndexErrors": true,
"typeRoots": ["node_modules/@types"] "typeRoots": ["node_modules/@types"]
}, },
"ts-node": { "ts-node": {
"esm": true, "esm": true,
"transpileOnly": true, "transpileOnly": true,
"experimentalSpecifierResolution": "node" "experimentalSpecifierResolution": "node"
}, },
"include": ["plugins", "lib","src"], "include": ["plugins", "lib", "src"],
"exclude": ["node_modules"] "exclude": ["node_modules"]
} }