Skip to content

Commit e323221

Browse files
authored
fix: Preserve extensible union semantics in TS schemas (#215)
1 parent 2adee0f commit e323221

13 files changed

Lines changed: 1660 additions & 135 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ src/*.js.map
1313

1414
# TypeDoc generated documentation
1515
src/docs/
16+
17+
# Transient dirs of scripts/generate.js (left behind only on failure)
18+
src/.schema-*/

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ src/examples/README.md
33
.release-please-manifest.json
44
release-please-config.json
55
CHANGELOG.md
6+
7+
src/.schema-*/

eslint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default [
1515
"*.config.js",
1616
".github/",
1717
"src/schema.ts",
18+
"src/.schema-*/",
1819
],
1920
},
2021
js.configs.recommended,
@@ -46,6 +47,11 @@ export default [
4647
],
4748
"no-console": "off",
4849
"no-constant-condition": "off",
50+
// TS checks redeclaration itself (ts2451), and the core rule false-positives
51+
// on same-name type + value declarations (schema/guards.gen.ts merges a type
52+
// and a const per extensible union). Matches typescript-eslint's own
53+
// eslint-recommended override; the TS-aware variant also flags this pattern.
54+
"no-redeclare": "off",
4955
"default-case": "error",
5056
"prefer-const": "error",
5157
"no-var": "error",

0 commit comments

Comments
 (0)