eslint-plugin-react-naming-convention 3.0.0-next.0 → 3.0.0-next.12
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 +9 -9
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -41,7 +41,7 @@ const rules = {
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region package.json
|
|
43
43
|
var name = "eslint-plugin-react-naming-convention";
|
|
44
|
-
var version = "3.0.0-next.
|
|
44
|
+
var version = "3.0.0-next.12";
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/utils/create-rule.ts
|
|
@@ -163,7 +163,7 @@ function create$3(context) {
|
|
|
163
163
|
if (!context.sourceCode.text.includes("createContext")) return {};
|
|
164
164
|
const { version } = getSettingsFromContext(context);
|
|
165
165
|
if (compare(version, "19.0.0", "<")) return {};
|
|
166
|
-
return { CallExpression(node) {
|
|
166
|
+
return defineRuleListener({ CallExpression(node) {
|
|
167
167
|
if (!core.isCreateContextCall(context, node)) return;
|
|
168
168
|
const [id, name] = match(findEnclosingAssignmentTarget(node)).with({
|
|
169
169
|
type: AST_NODE_TYPES.Identifier,
|
|
@@ -178,7 +178,7 @@ function create$3(context) {
|
|
|
178
178
|
messageId: "invalidContextName",
|
|
179
179
|
node: id
|
|
180
180
|
});
|
|
181
|
-
} };
|
|
181
|
+
} });
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
//#endregion
|
|
@@ -197,7 +197,7 @@ var id_name_default = createRule({
|
|
|
197
197
|
});
|
|
198
198
|
function create$2(context) {
|
|
199
199
|
if (!context.sourceCode.text.includes("useId")) return {};
|
|
200
|
-
return { CallExpression(node) {
|
|
200
|
+
return defineRuleListener({ CallExpression(node) {
|
|
201
201
|
if (!core.isUseIdCall(node)) return;
|
|
202
202
|
const [id, name] = match(findEnclosingAssignmentTarget(node)).with({
|
|
203
203
|
type: AST_NODE_TYPES.Identifier,
|
|
@@ -212,7 +212,7 @@ function create$2(context) {
|
|
|
212
212
|
messageId: "invalidIdName",
|
|
213
213
|
node: id
|
|
214
214
|
});
|
|
215
|
-
} };
|
|
215
|
+
} });
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
//#endregion
|
|
@@ -231,7 +231,7 @@ var ref_name_default = createRule({
|
|
|
231
231
|
});
|
|
232
232
|
function create$1(context) {
|
|
233
233
|
if (!context.sourceCode.text.includes("useRef")) return {};
|
|
234
|
-
return { CallExpression(node) {
|
|
234
|
+
return defineRuleListener({ CallExpression(node) {
|
|
235
235
|
if (!core.isUseRefCall(node)) return;
|
|
236
236
|
if (ast.getUnderlyingExpression(node.parent).type === AST_NODE_TYPES.MemberExpression) return;
|
|
237
237
|
const [id, name] = match(findEnclosingAssignmentTarget(node)).with({
|
|
@@ -247,7 +247,7 @@ function create$1(context) {
|
|
|
247
247
|
messageId: "invalidRefName",
|
|
248
248
|
node: id
|
|
249
249
|
});
|
|
250
|
-
} };
|
|
250
|
+
} });
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
//#endregion
|
|
@@ -287,7 +287,7 @@ var use_state_default = createRule({
|
|
|
287
287
|
});
|
|
288
288
|
function create(context) {
|
|
289
289
|
const { enforceAssignment = false, enforceSetterName = true } = context.options[0] ?? defaultOptions[0];
|
|
290
|
-
return { CallExpression(node) {
|
|
290
|
+
return defineRuleListener({ CallExpression(node) {
|
|
291
291
|
if (!core.isUseStateCall(node)) return;
|
|
292
292
|
if (node.parent.type !== AST_NODE_TYPES.VariableDeclarator) {
|
|
293
293
|
if (!enforceAssignment) return;
|
|
@@ -344,7 +344,7 @@ function create(context) {
|
|
|
344
344
|
});
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
|
-
} };
|
|
347
|
+
} });
|
|
348
348
|
}
|
|
349
349
|
|
|
350
350
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.12",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"./package.json"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@typescript-eslint/scope-manager": "
|
|
42
|
-
"@typescript-eslint/type-utils": "
|
|
43
|
-
"@typescript-eslint/types": "
|
|
44
|
-
"@typescript-eslint/utils": "
|
|
41
|
+
"@typescript-eslint/scope-manager": "canary",
|
|
42
|
+
"@typescript-eslint/type-utils": "canary",
|
|
43
|
+
"@typescript-eslint/types": "canary",
|
|
44
|
+
"@typescript-eslint/utils": "canary",
|
|
45
45
|
"compare-versions": "^6.1.1",
|
|
46
46
|
"string-ts": "^2.3.1",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "3.0.0-next.
|
|
49
|
-
"@eslint-react/core": "3.0.0-next.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "3.0.0-next.12",
|
|
49
|
+
"@eslint-react/core": "3.0.0-next.12",
|
|
50
|
+
"@eslint-react/shared": "3.0.0-next.12",
|
|
51
|
+
"@eslint-react/var": "3.0.0-next.12",
|
|
52
|
+
"@eslint-react/eff": "3.0.0-next.12"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.14",
|