Skip to content

Commit 908e35f

Browse files
committed
fix: disallow extra properties in rule options
1 parent e30615e commit 908e35f

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

src/rules/alt-text.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ const rule: Rule.RuleModule = {
9191
}
9292
}),
9393
{}
94-
)
94+
),
95+
additionalProperties: false
9596
}
9697
]
9798
},

src/rules/anchor-has-content.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ const rule: Rule.RuleModule = {
3535
type: "array",
3636
items: { type: "string" }
3737
}
38-
}
38+
},
39+
additionalProperties: false
3940
}
4041
]
4142
},

src/rules/form-control-has-label.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ const rule: Rule.RuleModule = {
8383
},
8484
uniqueItems: true
8585
}
86-
}
86+
},
87+
additionalProperties: false
8788
}
8889
]
8990
},

src/rules/heading-has-content.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const rule: Rule.RuleModule = {
3636
type: "array",
3737
items: { type: "string" }
3838
}
39-
}
39+
},
40+
additionalProperties: false
4041
}
4142
]
4243
},

src/rules/interactive-supports-focus.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ const rule: InteractiveSupportsFocus = {
108108
uniqueItems: true,
109109
additionalItems: false
110110
}
111-
}
111+
},
112+
additionalProperties: false
112113
}
113114
]
114115
},

src/rules/label-has-for.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ const rule: Rule.RuleModule = {
116116
uniqueItems: true
117117
}
118118
},
119-
required: ["some"]
119+
required: ["some"],
120+
additionalProperties: false
120121
},
121122
{
122123
type: "object",
@@ -130,14 +131,16 @@ const rule: Rule.RuleModule = {
130131
uniqueItems: true
131132
}
132133
},
133-
required: ["every"]
134+
required: ["every"],
135+
additionalProperties: false
134136
}
135137
]
136138
},
137139
allowChildren: {
138140
type: "boolean"
139141
}
140-
}
142+
},
143+
additionalProperties: false
141144
}
142145
]
143146
},

src/rules/media-has-caption.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ const rule: Rule.RuleModule = {
4646
type: "array",
4747
items: { type: "string" }
4848
}
49-
}
49+
},
50+
additionalProperties: false
5051
}
5152
]
5253
},

0 commit comments

Comments
 (0)