We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
atproto_apiに始まるfetch APIを実行するコード中で、*.jsonをインポートして型定義を行っているが、jsonインポートでの型定義は厳密ではない場合が多く、また名前も一定に定まらないため可読性にすぐれない
atproto_api
以下のようなコードは修正されるべきである
import getEndpoint, { com_atproto, app_bsky } from "./base" import mtype from "./models/createRecord.json" import etype from "./models/error.json" const apiName = com_atproto.repo.createRecord const endpoint = getEndpoint(apiName) export const api = async ({ repo, accessJwt, record, }: { repo: string accessJwt: string record: object }): Promise<typeof mtype | typeof etype> => ...
jsonインポートに対応する型は、jsonインポートを利用するts内で型を定義するべきである。外部から型を読み込む場合も、モジュールから型をimportするべきである。
ただし #15 によりそもそもatproto_apiが不要になると思われる、優先度は低く設定している。 ※atproto_api以外の箇所については対応するべきである。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Where and how it seems bad?
atproto_api
に始まるfetch APIを実行するコード中で、*.jsonをインポートして型定義を行っているが、jsonインポートでの型定義は厳密ではない場合が多く、また名前も一定に定まらないため可読性にすぐれない以下のようなコードは修正されるべきである
What it shoud become?
jsonインポートに対応する型は、jsonインポートを利用するts内で型を定義するべきである。外部から型を読み込む場合も、モジュールから型をimportするべきである。
ただし #15 によりそもそも
atproto_api
が不要になると思われる、優先度は低く設定している。※
atproto_api
以外の箇所については対応するべきである。The text was updated successfully, but these errors were encountered: