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: allow unusedLocals in standard-schema example #1068

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

mmkal
Copy link
Contributor

@mmkal mmkal commented Dec 12, 2024

there were a bunch ts-ignores, which looks bad on an example

Personally I prefer policing unused locals via a linter, which helps assign more appropriate "seriousness" to tsc errors, and so unused local errors can be more easily suppressed, but that's just me so I didn't make a sweeping change here.

there were a bunch ts-ignores, which looks bad on an example
Copy link

nx-cloud bot commented Dec 12, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 008ff09. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

Copy link

pkg-pr-new bot commented Dec 12, 2024

Open in Stackblitz

More templates

@tanstack/angular-form

npm i https://pkg.pr.new/@tanstack/angular-form@1068

@tanstack/form-core

npm i https://pkg.pr.new/@tanstack/form-core@1068

@tanstack/react-form

npm i https://pkg.pr.new/@tanstack/react-form@1068

@tanstack/lit-form

npm i https://pkg.pr.new/@tanstack/lit-form@1068

@tanstack/solid-form

npm i https://pkg.pr.new/@tanstack/solid-form@1068

@tanstack/valibot-form-adapter

npm i https://pkg.pr.new/@tanstack/valibot-form-adapter@1068

@tanstack/vue-form

npm i https://pkg.pr.new/@tanstack/vue-form@1068

@tanstack/yup-form-adapter

npm i https://pkg.pr.new/@tanstack/yup-form-adapter@1068

@tanstack/zod-form-adapter

npm i https://pkg.pr.new/@tanstack/zod-form-adapter@1068

commit: 008ff09

Copy link
Member

@Balastrong Balastrong left a comment

Choose a reason for hiding this comment

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

I don't think the ts-ignores look bad in the example, in fact we're intentionally writing wrong code with unused variables for demo purposes.

Another option I evaluated was to keep all the unused stuff commented, but then it meant you had to uncomment both the schema and the import each time, not ideal.

With that said, I see it might cause some confusion so maybe allowing the error at a linter level might make the example easier to read but still, we're allowing an error.

I'll think about it, the example is just about showing how easy it's to swap them, I might merge this. Thanks for the suggestion!

@Balastrong Balastrong merged commit 91eb9ab into TanStack:main Dec 14, 2024
5 checks passed
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.

2 participants