Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix lint config and error reporting again #35

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
extends:
- '@hamster-bot/eslint-config/typescript'

ignorePatterns:
- 'lib/**/*'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"dev": "yarn build:tsup",
"build:tsup": "tsup",
"test": "mocha -r tsx -r yml-register --extension .spec.ts ./__tests__",
"lint": "eslint src/**/*.ts && yarn prettier --check",
"lint": "eslint './**/*.{js,ts,tsx}' && yarn prettier --check",
"format": "yarn prettier --write",
"prettier": "prettier '**/*.{js,ts,json,yml,yaml,md}' '!dist/**/*'"
},
Expand Down
7 changes: 2 additions & 5 deletions src/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Context, Service } from 'koishi'
import type { SentencesParams } from 'koishi-plugin-hitokoto-sentences'
import { SentencesParams } from 'koishi-plugin-hitokoto-sentences'

import { Config } from '.'

Expand All @@ -13,10 +13,7 @@ export class HitokotoApi extends Service {
private _apiUrl: string
config: Config

constructor(
ctx: Context,
config: Config,
) {
constructor(ctx: Context, config: Config) {
super(ctx, 'hitokoto', true)
this.config = config
this._apiUrl = this.config.sentences ? '' : this.config.apiUrl ?? 'https://v1.hitokoto.cn/'
Expand Down
4 changes: 3 additions & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable import/no-named-as-default-member */
/* eslint-disable import/default */
import yaml from 'esbuild-plugin-yaml'
import { defineConfig } from 'tsup'

Expand All @@ -7,6 +9,6 @@ export default defineConfig({
format: ['cjs'],
clean: true,
outDir: 'lib',
esbuildPlugins: [yaml.yamlPlugin()],
esbuildPlugins: [yaml.yamlPlugin({})],
esbuildOptions(options, context) {},
})
Loading