GitShow/antfu/eslint-typegen
antfu

eslint-typegen

Generate types from ESLint rule schemas, with auto-completion and type-checking for rule options.

by antfu
eslinteslint-flat-config
Star on GitHubForknpm

TypeScript

277 stars10 forks9 contributorsQuiet · 4mo agoSince 2024v2.3.1MIT

Meet the team

See all 9 on GitHub →
antfu
antfu70 contributions
hugop95
hugop952 contributions
andreww2012
andreww20121 contribution
CopilotBot
Copilot1 contribution
LIUeng
LIUeng1 contribution
Lpmvb
Lpmvb1 contribution
luxass
luxass1 contribution
hyoban
hyoban1 contribution

Languages

View on GitHub →
TypeScript98%
JavaScript2%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

5 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template✓PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 4mo ago
See all on GitHub →
sardor01
Duplicate interface emitted for unicorn/prevent-abbreviations schema causes TS2374OpenIssue

Describe the bug When generating types for the rule, emits the same interface twice: TypeScript merges interfaces with the same name, but duplicate index signatures collide: The rule's JSON schema references a shape from two distinct subschemas ( and the inner replacements map). The emitter derives the same generated name () for both and writes a full declaration per occurrence instead of deduping by name. Interfaces with only non-index members would merge cleanly, but identical index signatures cannot. Reproduction System Info 2.3.1 64.0.0 TypeScript with Used Package Manager pnpm

sardor01 · 1mo ago
abarani
Type augmentation is broken on ESLint >= 9.38.0OpenIssue

Describe the bug When the option is set the generated code contains the following declaration: In ESLint 9.38.0 is now a type in place of an interface and thus can no longer be extended: https://github.com/eslint/eslint/blob/8fe511b4c0fb74df3290271b29c672c3fbf3be1f/lib/types/index.d.ts#L1328 If I'm getting it correctly the new proposed way to extend config type going forward is: As a side note has been changed too in ESLint 9.39.0. Although it still work as the type is essentially the same, it may be worth importing directly from the @eslint/core module. Reproduction Generate any .d.ts file with set System Info Used Package Manager pnpm Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead. [x] The provided reproduction is a minimal reproducible of the bug. Contributions [x] I am willing to submit a PR to fix this issue [ ] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

abarani · 4mo ago
benedictleejh
Invalid type generated for patternPropertiesOpenIssue

Describe the bug are currently generated as typed keys, and this can cause conflicts with other properties if they have different value types. For example, Vitest's has the following type generated for it's options: This type is problematic, and gives the following errors in Typescript: This is similar to the issue faced in json-schema-to-typescript#671. This can be seen by running the typegen on 's rules. The invalid type is also present in the distributed version of @antfu/eslint-config, in lines 15419-15426 of Reproduction https://www.npmjs.com/package/@antfu/eslint-config?activeTab=code System Info Used Package Manager n/a Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead. [x] The provided reproduction is a minimal reproducible of the bug. Contributions [ ] I am willing to submit a PR to fix this issue [ ] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

benedictleejh · 6mo ago

Recent fixes

View closed PRs →
ShayanTheNerd
Support ESLint v10ClosedIssue

Clear and concise description of the problem After dependency installation, I get this peer dependency mismatch warning: WARN Issues with peer dependencies found However, the types are correctly generated. Suggested solution _package.json_ I'm not sure if this is all that should be changed. (ESLint v10 migration) Alternative _No response_ Additional context _No response_ Validations [x] Follow our Code of Conduct [x] Read the Contributing Guide. [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

ShayanTheNerd · 4mo ago
Copilot
Add ESLint v10 to peer depsMergedPR

ESLint v10 users get an unmet peer dependency warning since only specified . Widen peer dep range to 💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot · 4mo ago
ulrich-kanta
Update @apidevtools/json-schema-ref-parser package in json-schema-to-typescript-liteClosedIssue

I created this issue to let you know that prior to 14.0.0, the package is vulnerable to Server-Side Request Forgery (SSRF) due to the default schema resolver which can potentially fetch requests from tainted urls without further validation. An attacker could exploit this by submitting a malicious schema with $ref pointing to localhost, internal APIs, or cloud metadata services, potentially bypassing network controls and accessing sensitive data. I added this issue here because this package is a fork so i don't know if there is something you can do about it.

ulrich-kanta · 11mo ago
Structured data for AI agents

Repository: antfu/eslint-typegen. Description: Generate types from ESLint rule schemas, with auto-completion and type-checking for rule options. Stars: 277, Forks: 10. Primary language: TypeScript. Languages: TypeScript (98%), JavaScript (2%). License: MIT. Topics: eslint, eslint-flat-config. Latest release: v2.3.1 (4mo ago). Open PRs: 1, open issues: 4. Last activity: 4mo ago. Community health: 85%. Top contributors: antfu, hugop95, andreww2012, Copilot, LIUeng, Lpmvb, luxass, hyoban.

·@ofershap

Replace github.com with gitshow.dev