eslint-plugin-react-dom 1.24.0-beta.0 → 1.24.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var eff = require('@eslint-react/eff');
4
3
  var JSX3 = require('@eslint-react/jsx');
4
+ var eff = require('@eslint-react/eff');
5
5
  var VAR = require('@eslint-react/var');
6
6
  var tsPattern = require('ts-pattern');
7
7
  var shared = require('@eslint-react/shared');
@@ -34,7 +34,7 @@ var AST__namespace = /*#__PURE__*/_interopNamespace(AST);
34
34
 
35
35
  // package.json
36
36
  var name = "eslint-plugin-react-dom";
37
- var version = "1.24.0-beta.0";
37
+ var version = "1.24.0-beta.3";
38
38
  function getAdditionalAttributes(name2, additionalComponents) {
39
39
  return additionalComponents.findLast((c) => c.name === name2 || c.re.test(name2))?.attributes ?? [];
40
40
  }
@@ -46,7 +46,7 @@ function getAttributeStringValue(attributeName, element, context, additionalAttr
46
46
  context.sourceCode.getScope(element),
47
47
  element.openingElement.attributes
48
48
  );
49
- if (actualAttributeNode === eff._) return attributeConfig?.defaultValue;
49
+ if (actualAttributeNode == null) return attributeConfig?.defaultValue;
50
50
  const actualAttributeScope = context.sourceCode.getScope(actualAttributeNode);
51
51
  const actualAttributeValue = JSX3__namespace.getPropValue(actualAttributeNode, actualAttributeScope);
52
52
  const actualAttributeValueResolved = VAR__namespace.toResolved(actualAttributeValue).value;
@@ -77,7 +77,7 @@ var no_dangerously_set_innerhtml_default = createRule({
77
77
  JSXElement(node) {
78
78
  const attributes = node.openingElement.attributes;
79
79
  const prop = JSX3__namespace.getProp("dangerouslySetInnerHTML", context.sourceCode.getScope(node), attributes);
80
- if (prop === eff._) return;
80
+ if (prop == null) return;
81
81
  context.report({
82
82
  messageId: "noDangerouslySetInnerhtml",
83
83
  node: prop
@@ -268,7 +268,7 @@ var no_missing_iframe_sandbox_default = createRule({
268
268
  );
269
269
  };
270
270
  const sandboxValue = getPropValue3("sandbox");
271
- if (sandboxValue === eff._) {
271
+ if (sandboxValue == null) {
272
272
  context.report({
273
273
  messageId: "noMissingIframeSandbox",
274
274
  node: node.openingElement
@@ -1512,7 +1512,7 @@ var no_unsafe_iframe_sandbox_default = createRule({
1512
1512
  );
1513
1513
  };
1514
1514
  const sandboxValue = getPropValue3("sandbox");
1515
- if (sandboxValue === eff._) return;
1515
+ if (sandboxValue == null) return;
1516
1516
  const values = sandboxValue.split(" ");
1517
1517
  if (unsafeCombinations.some((unsafes) => unsafes.every((x) => values.includes(x)))) {
1518
1518
  context.report({
@@ -1530,11 +1530,11 @@ var RULE_FEATURES10 = [
1530
1530
  "CHK"
1531
1531
  ];
1532
1532
  function isExternalLinkLike(value) {
1533
- if (value === eff._) return false;
1533
+ if (value == null) return false;
1534
1534
  return value.startsWith("https://") || /^(?:\w+:|\/\/)/u.test(value);
1535
1535
  }
1536
1536
  function isSafeRel(value) {
1537
- if (value === eff._) return false;
1537
+ if (value == null) return false;
1538
1538
  return value === "noreferrer" || /\bnoreferrer\b/u.test(value);
1539
1539
  }
1540
1540
  var no_unsafe_target_blank_default = createRule({
@@ -1640,7 +1640,7 @@ var no_void_elements_with_children_default = createRule({
1640
1640
  }
1641
1641
  const { attributes } = node.openingElement;
1642
1642
  const initialScope = context.sourceCode.getScope(node);
1643
- const hasAttribute = (name2) => JSX3__namespace.findPropInAttributes(name2, initialScope, attributes) !== eff._;
1643
+ const hasAttribute = (name2) => JSX3__namespace.findPropInAttributes(name2, initialScope, attributes) != null;
1644
1644
  if (hasAttribute("children") || hasAttribute("dangerouslySetInnerHTML")) {
1645
1645
  context.report({
1646
1646
  messageId: "noVoidElementsWithChildren",
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { _, identity } from '@eslint-react/eff';
2
1
  import * as JSX3 from '@eslint-react/jsx';
2
+ import { identity, _ } from '@eslint-react/eff';
3
3
  import * as VAR from '@eslint-react/var';
4
4
  import { match, P } from 'ts-pattern';
5
5
  import { createRuleForPlugin, getSettingsFromContext, RE_JAVASCRIPT_PROTOCOL } from '@eslint-react/shared';
@@ -10,7 +10,7 @@ import { compare } from 'compare-versions';
10
10
 
11
11
  // package.json
12
12
  var name = "eslint-plugin-react-dom";
13
- var version = "1.24.0-beta.0";
13
+ var version = "1.24.0-beta.3";
14
14
  function getAdditionalAttributes(name2, additionalComponents) {
15
15
  return additionalComponents.findLast((c) => c.name === name2 || c.re.test(name2))?.attributes ?? [];
16
16
  }
@@ -22,7 +22,7 @@ function getAttributeStringValue(attributeName, element, context, additionalAttr
22
22
  context.sourceCode.getScope(element),
23
23
  element.openingElement.attributes
24
24
  );
25
- if (actualAttributeNode === _) return attributeConfig?.defaultValue;
25
+ if (actualAttributeNode == null) return attributeConfig?.defaultValue;
26
26
  const actualAttributeScope = context.sourceCode.getScope(actualAttributeNode);
27
27
  const actualAttributeValue = JSX3.getPropValue(actualAttributeNode, actualAttributeScope);
28
28
  const actualAttributeValueResolved = VAR.toResolved(actualAttributeValue).value;
@@ -53,7 +53,7 @@ var no_dangerously_set_innerhtml_default = createRule({
53
53
  JSXElement(node) {
54
54
  const attributes = node.openingElement.attributes;
55
55
  const prop = JSX3.getProp("dangerouslySetInnerHTML", context.sourceCode.getScope(node), attributes);
56
- if (prop === _) return;
56
+ if (prop == null) return;
57
57
  context.report({
58
58
  messageId: "noDangerouslySetInnerhtml",
59
59
  node: prop
@@ -244,7 +244,7 @@ var no_missing_iframe_sandbox_default = createRule({
244
244
  );
245
245
  };
246
246
  const sandboxValue = getPropValue3("sandbox");
247
- if (sandboxValue === _) {
247
+ if (sandboxValue == null) {
248
248
  context.report({
249
249
  messageId: "noMissingIframeSandbox",
250
250
  node: node.openingElement
@@ -1488,7 +1488,7 @@ var no_unsafe_iframe_sandbox_default = createRule({
1488
1488
  );
1489
1489
  };
1490
1490
  const sandboxValue = getPropValue3("sandbox");
1491
- if (sandboxValue === _) return;
1491
+ if (sandboxValue == null) return;
1492
1492
  const values = sandboxValue.split(" ");
1493
1493
  if (unsafeCombinations.some((unsafes) => unsafes.every((x) => values.includes(x)))) {
1494
1494
  context.report({
@@ -1506,11 +1506,11 @@ var RULE_FEATURES10 = [
1506
1506
  "CHK"
1507
1507
  ];
1508
1508
  function isExternalLinkLike(value) {
1509
- if (value === _) return false;
1509
+ if (value == null) return false;
1510
1510
  return value.startsWith("https://") || /^(?:\w+:|\/\/)/u.test(value);
1511
1511
  }
1512
1512
  function isSafeRel(value) {
1513
- if (value === _) return false;
1513
+ if (value == null) return false;
1514
1514
  return value === "noreferrer" || /\bnoreferrer\b/u.test(value);
1515
1515
  }
1516
1516
  var no_unsafe_target_blank_default = createRule({
@@ -1616,7 +1616,7 @@ var no_void_elements_with_children_default = createRule({
1616
1616
  }
1617
1617
  const { attributes } = node.openingElement;
1618
1618
  const initialScope = context.sourceCode.getScope(node);
1619
- const hasAttribute = (name2) => JSX3.findPropInAttributes(name2, initialScope, attributes) !== _;
1619
+ const hasAttribute = (name2) => JSX3.findPropInAttributes(name2, initialScope, attributes) != null;
1620
1620
  if (hasAttribute("children") || hasAttribute("dangerouslySetInnerHTML")) {
1621
1621
  context.report({
1622
1622
  messageId: "noVoidElementsWithChildren",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-dom",
3
- "version": "1.24.0-beta.0",
3
+ "version": "1.24.0-beta.3",
4
4
  "description": "ESLint React's ESLint plugin for React DOM related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -47,17 +47,17 @@
47
47
  "compare-versions": "^6.1.1",
48
48
  "string-ts": "^2.2.0",
49
49
  "ts-pattern": "^5.6.0",
50
- "@eslint-react/core": "1.24.0-beta.0",
51
- "@eslint-react/ast": "1.24.0-beta.0",
52
- "@eslint-react/shared": "1.24.0-beta.0",
53
- "@eslint-react/types": "1.24.0-beta.0",
54
- "@eslint-react/jsx": "1.24.0-beta.0",
55
- "@eslint-react/eff": "1.24.0-beta.0",
56
- "@eslint-react/var": "1.24.0-beta.0"
50
+ "@eslint-react/ast": "1.24.0-beta.3",
51
+ "@eslint-react/eff": "1.24.0-beta.3",
52
+ "@eslint-react/core": "1.24.0-beta.3",
53
+ "@eslint-react/jsx": "1.24.0-beta.3",
54
+ "@eslint-react/types": "1.24.0-beta.3",
55
+ "@eslint-react/shared": "1.24.0-beta.3",
56
+ "@eslint-react/var": "1.24.0-beta.3"
57
57
  },
58
58
  "devDependencies": {
59
- "@types/react": "^19.0.4",
60
- "@types/react-dom": "^19.0.2",
59
+ "@types/react": "^19.0.6",
60
+ "@types/react-dom": "^19.0.3",
61
61
  "tsup": "^8.3.5",
62
62
  "@workspace/configs": "0.0.0"
63
63
  },