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

package.jsonの加筆 #27

Merged
merged 16 commits into from
Feb 25, 2024
Merged

package.jsonの加筆 #27

merged 16 commits into from
Feb 25, 2024

Conversation

oER4
Copy link
Contributor

@oER4 oER4 commented Feb 20, 2024

openapi-typescript導入+package.jsonに記載
ただ生成した.tsから型を自動的に決めるコードの実装の仕方が一向にわからない

@oER4 oER4 marked this pull request as draft February 20, 2024 13:08
@oER4 oER4 marked this pull request as ready for review February 22, 2024 15:34
.eslintrc.js Outdated
@@ -18,6 +18,7 @@ module.exports = {
'vue/eqeqeq': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'vue/require-default-prop': 'off',
'@typescript-eslint/no-explicit-any': 'off',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これを書くと、手で書いたファイルを含めてすべてのファイルにおいてany型を許容してしまうことになりそうです。
src/apis/openAPI.ts のみでany型を許容しないようにするために、.eslintignore にsrc/apis/openAPI.tsを含めるのがよさそう

Copy link

@Pugma Pugma Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/apis/openAPI.tsで永久にany型が自動生成され続けるので、openAPI.tsのみでany型を許容するほうがパット見良さそう…?
ただ、oneOfが他のところでも使われている以上、他のファイルでもany型はそこそこ出てきそうな気はします

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLintのoverridesフィールドを使うと良さそうです
https://blog.popweb.dev/programming/javascript/eslint-overrides/

Copy link
Contributor

@cp-20 cp-20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細かいですが確認お願いします:pray:

package.json Outdated Show resolved Hide resolved

// global configuration
fetcher.configure({
baseUrl: '', //どのURLを参照するかわからなかったので空にした
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

環境変数から読み込むのが良さそう

package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@cp-20 cp-20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細々としたところで申し訳ないんですが修正お願いします!🙇

.eslintrc.js Outdated Show resolved Hide resolved
.eslintrc.js Outdated Show resolved Hide resolved
.eslintignore Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/apis/client.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@cp-20 cp-20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

良さそうです~ 何度も修正提案しちゃってごめんなさい!お疲れさまでした!

@cp-20 cp-20 merged commit 67a7950 into main Feb 25, 2024
5 checks passed
@cp-20 cp-20 deleted the setAPI branch February 25, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants