eslint-plugin-react-x 1.52.1-next.2 → 1.52.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
@@ -142,7 +142,7 @@ var settings3 = {
142
142
 
143
143
  // package.json
144
144
  var name4 = "eslint-plugin-react-x";
145
- var version = "1.52.1-next.2";
145
+ var version = "1.52.1";
146
146
  var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("x"));
147
147
 
148
148
  // src/rules/avoid-shorthand-boolean.ts
@@ -1901,11 +1901,27 @@ function create33(context) {
1901
1901
  return ER25__namespace.isInstanceIdEqual(context, id, object);
1902
1902
  });
1903
1903
  if (!hasDisplayNameAssignment) {
1904
+ const semi = kit.LanguagePreference.defaultLanguagePreference.semicolons === "always" ? ";" : "";
1904
1905
  context.report({
1905
1906
  messageId: "noMissingContextDisplayName",
1906
1907
  node: id,
1907
- fix: id.type === types.AST_NODE_TYPES.Identifier && id.parent === call.parent ? (fixer) => fixer.insertTextAfter(call, `
1908
- ${id.name}.displayName = ${JSON.stringify(id.name)}`) : null
1908
+ fix(fixer) {
1909
+ if (id.type !== types.AST_NODE_TYPES.Identifier || id.parent !== call.parent) return [];
1910
+ return fixer.insertTextAfter(
1911
+ context.sourceCode.getTokenAfter(call) ?? call,
1912
+ [
1913
+ "\n",
1914
+ id.name,
1915
+ ".",
1916
+ "displayName",
1917
+ " ",
1918
+ "=",
1919
+ " ",
1920
+ JSON.stringify(id.name),
1921
+ semi
1922
+ ].join("")
1923
+ );
1924
+ }
1909
1925
  });
1910
1926
  }
1911
1927
  }
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { getDocsUrl, getSettingsFromContext, coerceSettings, DEFAULT_ESLINT_REACT_SETTINGS } from '@eslint-react/shared';
2
2
  import * as ER25 from '@eslint-react/core';
3
3
  import { ESLintUtils } from '@typescript-eslint/utils';
4
- import { JsxConfig, Reporter, Selector } from '@eslint-react/kit';
4
+ import { JsxConfig, Reporter, Selector, LanguagePreference } from '@eslint-react/kit';
5
5
  import { AST_NODE_TYPES } from '@typescript-eslint/types';
6
6
  import * as VAR2 from '@eslint-react/var';
7
7
  import { match, isMatching, P } from 'ts-pattern';
@@ -115,7 +115,7 @@ var settings3 = {
115
115
 
116
116
  // package.json
117
117
  var name4 = "eslint-plugin-react-x";
118
- var version = "1.52.1-next.2";
118
+ var version = "1.52.1";
119
119
  var createRule = ESLintUtils.RuleCreator(getDocsUrl("x"));
120
120
 
121
121
  // src/rules/avoid-shorthand-boolean.ts
@@ -1874,11 +1874,27 @@ function create33(context) {
1874
1874
  return ER25.isInstanceIdEqual(context, id, object);
1875
1875
  });
1876
1876
  if (!hasDisplayNameAssignment) {
1877
+ const semi = LanguagePreference.defaultLanguagePreference.semicolons === "always" ? ";" : "";
1877
1878
  context.report({
1878
1879
  messageId: "noMissingContextDisplayName",
1879
1880
  node: id,
1880
- fix: id.type === AST_NODE_TYPES.Identifier && id.parent === call.parent ? (fixer) => fixer.insertTextAfter(call, `
1881
- ${id.name}.displayName = ${JSON.stringify(id.name)}`) : null
1881
+ fix(fixer) {
1882
+ if (id.type !== AST_NODE_TYPES.Identifier || id.parent !== call.parent) return [];
1883
+ return fixer.insertTextAfter(
1884
+ context.sourceCode.getTokenAfter(call) ?? call,
1885
+ [
1886
+ "\n",
1887
+ id.name,
1888
+ ".",
1889
+ "displayName",
1890
+ " ",
1891
+ "=",
1892
+ " ",
1893
+ JSON.stringify(id.name),
1894
+ semi
1895
+ ].join("")
1896
+ );
1897
+ }
1882
1898
  });
1883
1899
  }
1884
1900
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-react-x",
3
- "version": "1.52.1-next.2",
3
+ "version": "1.52.1",
4
4
  "description": "A set of composable ESLint rules for for libraries and frameworks that use React as a UI runtime.",
5
5
  "keywords": [
6
6
  "react",
@@ -50,12 +50,12 @@
50
50
  "is-immutable-type": "^5.0.1",
51
51
  "string-ts": "^2.2.1",
52
52
  "ts-pattern": "^5.7.1",
53
- "@eslint-react/ast": "1.52.1-next.2",
54
- "@eslint-react/core": "1.52.1-next.2",
55
- "@eslint-react/eff": "1.52.1-next.2",
56
- "@eslint-react/kit": "1.52.1-next.2",
57
- "@eslint-react/shared": "1.52.1-next.2",
58
- "@eslint-react/var": "1.52.1-next.2"
53
+ "@eslint-react/kit": "1.52.1",
54
+ "@eslint-react/core": "1.52.1",
55
+ "@eslint-react/shared": "1.52.1",
56
+ "@eslint-react/var": "1.52.1",
57
+ "@eslint-react/ast": "1.52.1",
58
+ "@eslint-react/eff": "1.52.1"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/react": "^19.1.7",