eslint-plugin-react-dom 1.37.0-next.0 → 1.37.1-beta.2

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
@@ -66,7 +66,7 @@ var settings = {
66
66
 
67
67
  // package.json
68
68
  var name2 = "eslint-plugin-react-dom";
69
- var version = "1.37.0-next.0";
69
+ var version = "1.37.1-beta.2";
70
70
  var createRule = shared.createRuleForPlugin("dom");
71
71
 
72
72
  // src/utils/find-custom-component.ts
@@ -1630,6 +1630,7 @@ var no_unknown_property_default = createRule({
1630
1630
  defaultOptions: []
1631
1631
  });
1632
1632
  function create10(context) {
1633
+ const report = shared.createReport(context);
1633
1634
  function getIgnoreConfig() {
1634
1635
  return context.options[0]?.ignore || DEFAULTS.ignore;
1635
1636
  }
@@ -1649,8 +1650,9 @@ function create10(context) {
1649
1650
  }
1650
1651
  if (isValidDataAttribute(name3)) {
1651
1652
  if (getRequireDataLowercase() && hasUpperCaseCharacter(name3)) {
1652
- report(context, messages.dataLowercaseRequired, "dataLowercaseRequired", {
1653
+ report({
1653
1654
  node,
1655
+ messageId: "dataLowercaseRequired",
1654
1656
  data: {
1655
1657
  name: actualName,
1656
1658
  lowerCaseName: actualName.toLowerCase()
@@ -1666,8 +1668,9 @@ function create10(context) {
1666
1668
  const allowedTags = has(ATTRIBUTE_TAGS_MAP, name3) ? ATTRIBUTE_TAGS_MAP[name3] : null;
1667
1669
  if (tagName && allowedTags) {
1668
1670
  if (allowedTags.indexOf(tagName) === -1) {
1669
- report(context, messages.invalidPropOnTag, "invalidPropOnTag", {
1671
+ report({
1670
1672
  node,
1673
+ messageId: "invalidPropOnTag",
1671
1674
  data: {
1672
1675
  name: actualName,
1673
1676
  allowedTags: allowedTags.join(", "),
@@ -1684,8 +1687,9 @@ function create10(context) {
1684
1687
  return;
1685
1688
  }
1686
1689
  if (hasStandardNameButIsNotUsed) {
1687
- report(context, messages.unknownPropWithStandardName, "unknownPropWithStandardName", {
1690
+ report({
1688
1691
  node,
1692
+ messageId: "unknownPropWithStandardName",
1689
1693
  data: {
1690
1694
  name: actualName,
1691
1695
  standardName
@@ -1696,8 +1700,9 @@ function create10(context) {
1696
1700
  });
1697
1701
  return;
1698
1702
  }
1699
- report(context, messages.unknownProp, "unknownProp", {
1703
+ report({
1700
1704
  node,
1705
+ messageId: "unknownProp",
1701
1706
  data: {
1702
1707
  name: actualName
1703
1708
  }
@@ -1711,12 +1716,6 @@ function has(obj, key) {
1711
1716
  function getText(context, node) {
1712
1717
  return context.sourceCode.getText(node);
1713
1718
  }
1714
- function report(context, message, messageId, data) {
1715
- context.report({
1716
- messageId,
1717
- ...data
1718
- });
1719
- }
1720
1719
  function testReactVersion(context, comparator, version2) {
1721
1720
  const { version: localVersion } = shared.getSettingsFromContext(context);
1722
1721
  return compareVersions.compare(localVersion, version2, comparator);
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createRuleForPlugin, getSettingsFromContext, RE_JAVASCRIPT_PROTOCOL, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
1
+ import { createRuleForPlugin, getSettingsFromContext, RE_JAVASCRIPT_PROTOCOL, createReport, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
2
2
  import * as JSX from '@eslint-react/jsx';
3
3
  import { AST_NODE_TYPES } from '@typescript-eslint/types';
4
4
  import { compare } from 'compare-versions';
@@ -43,7 +43,7 @@ var settings = {
43
43
 
44
44
  // package.json
45
45
  var name2 = "eslint-plugin-react-dom";
46
- var version = "1.37.0-next.0";
46
+ var version = "1.37.1-beta.2";
47
47
  var createRule = createRuleForPlugin("dom");
48
48
 
49
49
  // src/utils/find-custom-component.ts
@@ -1607,6 +1607,7 @@ var no_unknown_property_default = createRule({
1607
1607
  defaultOptions: []
1608
1608
  });
1609
1609
  function create10(context) {
1610
+ const report = createReport(context);
1610
1611
  function getIgnoreConfig() {
1611
1612
  return context.options[0]?.ignore || DEFAULTS.ignore;
1612
1613
  }
@@ -1626,8 +1627,9 @@ function create10(context) {
1626
1627
  }
1627
1628
  if (isValidDataAttribute(name3)) {
1628
1629
  if (getRequireDataLowercase() && hasUpperCaseCharacter(name3)) {
1629
- report(context, messages.dataLowercaseRequired, "dataLowercaseRequired", {
1630
+ report({
1630
1631
  node,
1632
+ messageId: "dataLowercaseRequired",
1631
1633
  data: {
1632
1634
  name: actualName,
1633
1635
  lowerCaseName: actualName.toLowerCase()
@@ -1643,8 +1645,9 @@ function create10(context) {
1643
1645
  const allowedTags = has(ATTRIBUTE_TAGS_MAP, name3) ? ATTRIBUTE_TAGS_MAP[name3] : null;
1644
1646
  if (tagName && allowedTags) {
1645
1647
  if (allowedTags.indexOf(tagName) === -1) {
1646
- report(context, messages.invalidPropOnTag, "invalidPropOnTag", {
1648
+ report({
1647
1649
  node,
1650
+ messageId: "invalidPropOnTag",
1648
1651
  data: {
1649
1652
  name: actualName,
1650
1653
  allowedTags: allowedTags.join(", "),
@@ -1661,8 +1664,9 @@ function create10(context) {
1661
1664
  return;
1662
1665
  }
1663
1666
  if (hasStandardNameButIsNotUsed) {
1664
- report(context, messages.unknownPropWithStandardName, "unknownPropWithStandardName", {
1667
+ report({
1665
1668
  node,
1669
+ messageId: "unknownPropWithStandardName",
1666
1670
  data: {
1667
1671
  name: actualName,
1668
1672
  standardName
@@ -1673,8 +1677,9 @@ function create10(context) {
1673
1677
  });
1674
1678
  return;
1675
1679
  }
1676
- report(context, messages.unknownProp, "unknownProp", {
1680
+ report({
1677
1681
  node,
1682
+ messageId: "unknownProp",
1678
1683
  data: {
1679
1684
  name: actualName
1680
1685
  }
@@ -1688,12 +1693,6 @@ function has(obj, key) {
1688
1693
  function getText(context, node) {
1689
1694
  return context.sourceCode.getText(node);
1690
1695
  }
1691
- function report(context, message, messageId, data) {
1692
- context.report({
1693
- messageId,
1694
- ...data
1695
- });
1696
- }
1697
1696
  function testReactVersion(context, comparator, version2) {
1698
1697
  const { version: localVersion } = getSettingsFromContext(context);
1699
1698
  return compare(localVersion, version2, comparator);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-dom",
3
- "version": "1.37.0-next.0",
3
+ "version": "1.37.1-beta.2",
4
4
  "description": "ESLint React's ESLint plugin for React DOM related rules.",
5
5
  "keywords": [
6
6
  "react",
@@ -49,12 +49,12 @@
49
49
  "compare-versions": "^6.1.1",
50
50
  "string-ts": "^2.2.1",
51
51
  "ts-pattern": "^5.6.2",
52
- "@eslint-react/ast": "1.37.0-next.0",
53
- "@eslint-react/core": "1.37.0-next.0",
54
- "@eslint-react/jsx": "1.37.0-next.0",
55
- "@eslint-react/eff": "1.37.0-next.0",
56
- "@eslint-react/shared": "1.37.0-next.0",
57
- "@eslint-react/var": "1.37.0-next.0"
52
+ "@eslint-react/ast": "1.37.1-beta.2",
53
+ "@eslint-react/core": "1.37.1-beta.2",
54
+ "@eslint-react/eff": "1.37.1-beta.2",
55
+ "@eslint-react/jsx": "1.37.1-beta.2",
56
+ "@eslint-react/shared": "1.37.1-beta.2",
57
+ "@eslint-react/var": "1.37.1-beta.2"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/react": "^19.0.12",