Skip to content

Commit de4a61c

Browse files
committed
Added support for InfernoJs optimization flags
1 parent 1a8e6f0 commit de4a61c

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
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.5)
3+
- bugfix: Do not raise errors for InfernoJs optimization flags
4+
25
## 2025-01-22
36

47
Everything re-branched from upstream.

lib/rules/no-unknown-property.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ const SVGDOM_ATTRIBUTE_NAMES = {
204204
};
205205

206206
const DOM_PROPERTY_NAMES = [
207+
// Inferno optimization flags
208+
'$HasKeyedChildren', '$HasNonKeyedChildren', '$HasVNodeChildren', '$HasTextChildren', '$ReCreate', '$ChildFlag', '$Flags',
209+
207210
// Global attributes - can be used on any HTML/DOM element
208211
// See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
209212
'dir', 'draggable', 'hidden', 'id', 'lang', 'nonce', 'part', 'slot', 'style', 'title', 'translate', 'inert',
@@ -289,7 +292,7 @@ const DOM_PROPERTY_NAMES = [
289292
// Safari/Apple specific, no listing available
290293
'autoCorrect', // https://stackoverflow.com/questions/47985384/html-autocorrect-for-text-input-is-not-working
291294
'autoSave', // https://stackoverflow.com/questions/25456396/what-is-autosave-attribute-supposed-to-do-how-do-i-use-it
292-
// Inferno specific attributes https://reactjs.org/docs/dom-elements.html#differences-in-attributes
295+
// Inferno/React specific attributes https://reactjs.org/docs/dom-elements.html#differences-in-attributes
293296
'className', 'dangerouslySetInnerHTML', 'defaultValue', 'defaultChecked', 'htmlFor',
294297
// Events' capture events
295298
'onBeforeInput', 'onChange',

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.4",
3+
"version": "7.37.5",
44
"description": "Inferno specific linting rules for ESLint",
55
"main": "index.js",
66
"types": "index.d.ts",

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

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ const parserOptions = {
2929
const ruleTester = new RuleTester({ parserOptions });
3030
ruleTester.run('no-unknown-property', rule, {
3131
valid: parsers.all([
32+
// Inferno optimization flags should be fine
33+
{ code: '<div $HasKeyedChildren />;' },
34+
{ code: '<div $HasNonKeyedChildren />;' },
35+
{ code: '<div $HasVNodeChildren />;' },
36+
{ code: '<div $HasTextChildren />;' },
37+
{ code: '<div $ReCreate />;' },
38+
{ code: '<div $ChildFlag="{1}" />;' },
39+
{ code: '<div $Flags="{1}" />;' },
40+
3241
// Inferno components and their props/attributes should be fine
3342
{ code: '<App class="bar" />;' },
3443
{ code: '<App for="bar" />;' },

0 commit comments

Comments
 (0)