Skip to content

Commit b6c06f0

Browse files
committed
Allow using selectedIndex on select element
1 parent c9c2351 commit b6c06f0

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Change Log
2+
## 2025-01-23 (7.37.7)
3+
- bugfix: Allow using 'selectedIndex' attribute on select elements
4+
25
## 2025-01-23 (7.37.6)
36
- bugfix: allow using lowercased variants of semi-synthetic events
47
- bugfix: added intermediate as allowed attribute

lib/rules/no-unknown-property.js

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ const ATTRIBUTE_TAGS_MAP = {
113113
poster: ['video'],
114114
preload: ['audio', 'video'],
115115
scrolling: ['iframe'],
116+
selectedIndex: ['select'],
116117
returnValue: ['dialog'],
117118
webkitDirectory: ['input'],
118119
};

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-inferno",
3-
"version": "7.37.6",
3+
"version": "7.37.7",
44
"description": "Inferno specific linting rules for ESLint",
55
"main": "index.js",
66
"types": "index.d.ts",

tests/lib/rules/no-unknown-property.js

+15
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ ruleTester.run('no-unknown-property', rule, {
4848
{ code: '<App onComponentWillDisappear={foo} />;' },
4949
{ code: '<App onComponentWillMove={foo} />;' },
5050

51+
{ code: '<select selectedIndex={1} />;' },
52+
5153
// Inferno components and their props/attributes should be fine
5254
{ code: '<App class="bar" />;' },
5355
{ code: '<App for="bar" />;' },
@@ -215,6 +217,19 @@ ruleTester.run('no-unknown-property', rule, {
215217
},
216218
]),
217219
invalid: parsers.all([
220+
{
221+
code: '<div selectedIndex={foo} />;',
222+
errors: [
223+
{
224+
messageId: 'invalidPropOnTag',
225+
data: {
226+
name: 'selectedIndex',
227+
tagName: 'div',
228+
allowedTags: 'select',
229+
},
230+
},
231+
],
232+
},
218233
{
219234
code: '<div onComponentWillMount={foo} />;',
220235
errors: [

0 commit comments

Comments
 (0)