eslint-plugin-react-x 1.52.1-beta.2 → 1.52.1-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 +19 -3
- package/dist/index.mjs +20 -4
- package/package.json +7 -7
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-beta.
|
|
145
|
+
var version = "1.52.1-beta.3";
|
|
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
|
|
1908
|
-
|
|
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-beta.
|
|
118
|
+
var version = "1.52.1-beta.3";
|
|
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
|
|
1881
|
-
|
|
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-beta.
|
|
3
|
+
"version": "1.52.1-beta.3",
|
|
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-beta.
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/kit": "1.52.1-beta.
|
|
57
|
-
"@eslint-react/shared": "1.52.1-beta.
|
|
58
|
-
"@eslint-react/var": "1.52.1-beta.
|
|
53
|
+
"@eslint-react/ast": "1.52.1-beta.3",
|
|
54
|
+
"@eslint-react/core": "1.52.1-beta.3",
|
|
55
|
+
"@eslint-react/eff": "1.52.1-beta.3",
|
|
56
|
+
"@eslint-react/kit": "1.52.1-beta.3",
|
|
57
|
+
"@eslint-react/shared": "1.52.1-beta.3",
|
|
58
|
+
"@eslint-react/var": "1.52.1-beta.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.7",
|