Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Sep 26, 2025

PR Checklist

Overview

Makes the package public instead of private. Two changes are made to the package to support public use:

  • The dependency on prettier is removed. Consumers will be expected to format using their own formatter.
  • The main export is renamed from the general compile() to the more specific schemaToTypes().

Also adds a docs page under /packages/rule-schema-to-typescript-types with a code sample and auto-generated docs for the one function.

The snapshot file differences are due to the prettier formatting being moved out of compile/schemaToTypes. Formatting previously was only done in some cases inside the function. Now it's always done in the consuming schemas.test.ts.

Co-authored-by: @fasttime

💖

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

@netlify
Copy link

netlify bot commented Sep 26, 2025

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit ea6b7c9
🔍 Latest deploy log https://app.netlify.com/projects/typescript-eslint/deploys/68dfb643583b330008e730ec
😎 Deploy Preview https://deploy-preview-11633--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 84 (🟢 up 6 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@nx-cloud
Copy link

nx-cloud bot commented Sep 26, 2025

View your CI Pipeline Execution ↗ for commit ea6b7c9

Command Status Duration Result
nx test eslint-plugin --coverage=false ✅ Succeeded 5m 15s View ↗
nx run-many -t lint ✅ Succeeded 3m 10s View ↗
nx run-many -t typecheck ✅ Succeeded 2m 3s View ↗
nx test typescript-estree --coverage=false ✅ Succeeded 20s View ↗
nx test eslint-plugin-internal --coverage=false ✅ Succeeded 10s View ↗
nx run types:build ✅ Succeeded 5s View ↗
nx run integration-tests:test ✅ Succeeded 4s View ↗
nx run generate-configs ✅ Succeeded 8s View ↗
Additional runs (29) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2025-10-03 11:55:44 UTC

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review September 26, 2025 13:12
@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.74%. Comparing base (692d4ee) to head (ea6b7c9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #11633      +/-   ##
==========================================
- Coverage   90.96%   90.74%   -0.22%     
==========================================
  Files         506      514       +8     
  Lines       51447    51947     +500     
  Branches     8493     8584      +91     
==========================================
+ Hits        46797    47139     +342     
- Misses       4637     4794     +157     
- Partials       13       14       +1     
Flag Coverage Δ
unittest 90.74% <100.00%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...chema-to-typescript-types/src/generateArrayType.ts 57.89% <100.00%> (ø)
...hema-to-typescript-types/src/generateObjectType.ts 72.91% <100.00%> (ø)
...ule-schema-to-typescript-types/src/generateType.ts 49.52% <100.00%> (ø)
...chema-to-typescript-types/src/generateUnionType.ts 64.28% <100.00%> (ø)
...rule-schema-to-typescript-types/src/optimizeAST.ts 96.42% <100.00%> (ø)
...es/rule-schema-to-typescript-types/src/printAST.ts 80.91% <100.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

Excited to see this coming online!

It looks like these lists could be updated to include rule-schema-to-typescript-types.

options:
- ast-spec
- eslint-plugin
- parser
- project-service
- rule-tester
- scope-manager
- tsconfig-utils
- type-utils
- types
- typescript-eslint
- typescript-estree
- utils
- visitor-keys
- website

options:
- ast-spec
- eslint-plugin
- parser
- project-service
- rule-tester
- scope-manager
- tsconfig-utils
- type-utils
- types
- typescript-eslint
- typescript-estree
- utils
- visitor-keys
- website

That would help users like me to submit issues specifically related to this tool.

@JoshuaKGoldberg
Copy link
Member Author

@JamesHenry perhaps another Nx setup oddity?

eslint.config.mjs(21,22): error TS2307: Cannot find module 'typescript-eslint' or its corresponding type declarations.
> tsc -b tsconfig.repo-config-files.json

kirkwaiblinger
kirkwaiblinger previously approved these changes Sep 30, 2025
Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

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

🎉

kirkwaiblinger
kirkwaiblinger previously approved these changes Sep 30, 2025
@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 30, 2025
@JoshuaKGoldberg
Copy link
Member Author

JoshuaKGoldberg commented Oct 3, 2025

Build failures look to be some kind of Nx dependency shenanigan. I don't reproduce them locally.

> tsc -b tsconfig.repo-config-files.json

packages/type-utils/src/TypeOrValueSpecifier.ts(2,34): error TS2307: Cannot find module '@typescript-eslint/utils/json-schema' or its corresponding type declarations.
packages/type-utils/src/isTypeReadonly.ts(1,34): error TS2307: Cannot find module '@typescript-eslint/utils/json-schema' or its corresponding type declarations.
packages/rule-tester/src/utils/getRuleOptionsSchema.ts(3,34): error TS2307: Cannot find module '@typescript-eslint/utils/json-schema' or its corresponding type declarations.
packages/rule-schema-to-typescript-types/src/generateArrayType.ts(4,8): error TS2307: Cannot find module '@typescript-eslint/utils/json-schema' or its corresponding type declarations.
...

Edit: like the last batch, these went away after merging from main. 🤷

@JoshuaKGoldberg JoshuaKGoldberg merged commit 740a63f into typescript-eslint:main Oct 3, 2025
62 of 65 checks passed
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 8, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.45.0 | 8.46.0 |
| npm        | @typescript-eslint/parser        | 8.45.0 | 8.46.0 |


## [v8.46.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8460-2025-10-06)

##### 🚀 Features

- **eslint-plugin:** \[no-unsafe-member-access] add allowOptionalChaining option ([#11659](typescript-eslint/typescript-eslint#11659))
- **rule-schema-to-typescript-types:** clean up and make public ([#11633](typescript-eslint/typescript-eslint#11633))

##### 🩹 Fixes

- **eslint-plugin:** \[prefer-readonly-parameter-types] ignore tagged primitives ([#11660](typescript-eslint/typescript-eslint#11660))
- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](typescript-eslint/typescript-eslint#11657))
- **eslint-plugin:** removed error type previously deprecated ([#11674](typescript-eslint/typescript-eslint#11674))
- **eslint-plugin:** \[no-deprecated] ignore deprecated `export import`s ([#11603](typescript-eslint/typescript-eslint#11603))
- **eslint-plugin:** \[unbound-method] improve wording around `this: void` and binding ([#11634](typescript-eslint/typescript-eslint#11634))
- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](typescript-eslint/typescript-eslint#11628))
- **eslint-plugin:** \[no-floating-promises] remove excess parentheses in suggestions ([#11487](typescript-eslint/typescript-eslint#11487))

##### ❤️ Thank You

- fisker Cheung [@fisker](https://github.com/fisker)
- Josh Goldberg ✨
- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- Mark de Dios [@peanutenthusiast](https://github.com/peanutenthusiast)
- Richard Torres [@richardtorres314](https://github.com/richardtorres314)
- Victor Genaev [@mainframev](https://github.com/mainframev)

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 8, 2025
| datasource | package                          | from   | to     |
| ---------- | -------------------------------- | ------ | ------ |
| npm        | @typescript-eslint/eslint-plugin | 8.45.0 | 8.46.0 |
| npm        | @typescript-eslint/parser        | 8.45.0 | 8.46.0 |


## [v8.46.0](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#8460-2025-10-06)

##### 🚀 Features

- **eslint-plugin:** \[no-unsafe-member-access] add allowOptionalChaining option ([#11659](typescript-eslint/typescript-eslint#11659))
- **rule-schema-to-typescript-types:** clean up and make public ([#11633](typescript-eslint/typescript-eslint#11633))

##### 🩹 Fixes

- **eslint-plugin:** \[prefer-readonly-parameter-types] ignore tagged primitives ([#11660](typescript-eslint/typescript-eslint#11660))
- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](typescript-eslint/typescript-eslint#11657))
- **eslint-plugin:** removed error type previously deprecated ([#11674](typescript-eslint/typescript-eslint#11674))
- **eslint-plugin:** \[no-deprecated] ignore deprecated `export import`s ([#11603](typescript-eslint/typescript-eslint#11603))
- **eslint-plugin:** \[unbound-method] improve wording around `this: void` and binding ([#11634](typescript-eslint/typescript-eslint#11634))
- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](typescript-eslint/typescript-eslint#11628))
- **eslint-plugin:** \[no-floating-promises] remove excess parentheses in suggestions ([#11487](typescript-eslint/typescript-eslint#11487))

##### ❤️ Thank You

- fisker Cheung [@fisker](https://github.com/fisker)
- Josh Goldberg ✨
- Kirk Waiblinger [@kirkwaiblinger](https://github.com/kirkwaiblinger)
- Mark de Dios [@peanutenthusiast](https://github.com/peanutenthusiast)
- Richard Torres [@richardtorres314](https://github.com/richardtorres314)
- Victor Genaev [@mainframev](https://github.com/mainframev)

You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Turn rule-schema-to-typescript-types into a public reusable package

3 participants