Skip to content

Commit

Permalink
chore: fix lint config and error reporting again (#35)
Browse files Browse the repository at this point in the history
* chore: fix lint config and error reporting again

* fix: format
  • Loading branch information
MaikoTan authored Mar 12, 2024
1 parent 138caa8 commit 07bc561
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
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) {},
})

0 comments on commit 07bc561

Please sign in to comment.