Skip to content

Commit dd23730

Browse files
committed
Add more property constraints to reduce any in TS
1 parent b2b6762 commit dd23730

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

schemas/data.schema.json

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@
143143
"$ref": "#/definitions/Discouraged"
144144
}
145145
},
146-
"required": ["name", "description", "description_html", "spec", "status"]
146+
"required": ["name", "description", "description_html", "spec", "status"],
147+
"additionalProperties": false
147148
},
148149
"GroupData": {
149150
"type": "object",
@@ -208,22 +209,22 @@
208209
},
209210
"StatusHeadline": {
210211
"type": "object",
211-
"allOf": [
212-
{ "$ref": "#/definitions/Status" },
213-
{
212+
"allOf": [{ "$ref": "#/definitions/Status" }],
213+
"properties": {
214+
"baseline": {},
215+
"baseline_high_date": {},
216+
"baseline_low_date": {},
217+
"support": {},
218+
"by_compat_key": {
219+
"description": "Statuses for each key in the feature's compat_features list, if applicable. Not available to the npm release of web-features.",
214220
"type": "object",
215-
"properties": {
216-
"by_compat_key": {
217-
"description": "Statuses for each key in the feature's compat_features list, if applicable. Not available to the npm release of web-features.",
218-
"type": "object",
219-
"additionalProperties": {
220-
"$ref": "#/definitions/Status"
221-
}
222-
}
221+
"additionalProperties": {
222+
"$ref": "#/definitions/Status"
223223
}
224224
}
225-
],
226-
"required": ["baseline", "support"]
225+
},
226+
"required": ["baseline", "support"],
227+
"additionalProperties": false
227228
},
228229
"Release": {
229230
"description": "Browser release information",
@@ -253,7 +254,8 @@
253254
"$ref": "#/definitions/URL"
254255
}
255256
},
256-
"required": ["name", "spec"]
257+
"required": ["name", "spec"],
258+
"additionalProperties": false
257259
},
258260
"StringOrStrings": {
259261
"oneOf": [

types.quicktype.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export interface FeatureData {
103103
* that status
104104
*/
105105
status: StatusHeadline;
106-
[property: string]: any;
107106
}
108107

109108
/**
@@ -130,10 +129,6 @@ export interface StatusHeadline {
130129
* Whether the feature is Baseline (low substatus), Baseline (high substatus), or not (false)
131130
*/
132131
baseline: boolean | BaselineEnum;
133-
/**
134-
* Browser versions that most-recently introduced the feature
135-
*/
136-
support: Support;
137132
/**
138133
* Date the feature achieved Baseline high status
139134
*/
@@ -147,7 +142,10 @@ export interface StatusHeadline {
147142
* to the npm release of web-features.
148143
*/
149144
by_compat_key?: { [key: string]: Status };
150-
[property: string]: any;
145+
/**
146+
* Browser versions that most-recently introduced the feature
147+
*/
148+
support: Support;
151149
}
152150

153151
export type BaselineEnum = "high" | "low";
@@ -205,5 +203,4 @@ export interface SnapshotData {
205203
* Specification
206204
*/
207205
spec: string;
208-
[property: string]: any;
209206
}

0 commit comments

Comments
 (0)