eslint-plugin-react-dom 1.37.1-beta.4 → 1.37.1-next.1

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