eslint-plugin-react-naming-convention 1.42.2-next.2 → 1.42.2-next.4
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 +4 -4
- package/dist/index.mjs +5 -5
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var rules = {
|
|
|
55
55
|
|
|
56
56
|
// package.json
|
|
57
57
|
var name2 = "eslint-plugin-react-naming-convention";
|
|
58
|
-
var version = "1.42.2-next.
|
|
58
|
+
var version = "1.42.2-next.4";
|
|
59
59
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("naming-convention"));
|
|
60
60
|
|
|
61
61
|
// src/rules/component-name.ts
|
|
@@ -203,7 +203,7 @@ function create2(context) {
|
|
|
203
203
|
if (!ER2__namespace.isCreateContextCall(context, node)) return;
|
|
204
204
|
const id = ER2__namespace.getInstanceId(node);
|
|
205
205
|
if (id == null) return;
|
|
206
|
-
const name3 = tsPattern.match(id).with({ type: types.AST_NODE_TYPES.Identifier, name: tsPattern.P.select() }, eff.identity).with({ type: types.AST_NODE_TYPES.MemberExpression, property: { name: tsPattern.P.select(tsPattern.P.string) } }, eff.identity).otherwise(() =>
|
|
206
|
+
const name3 = tsPattern.match(id).with({ type: types.AST_NODE_TYPES.Identifier, name: tsPattern.P.select() }, eff.identity).with({ type: types.AST_NODE_TYPES.MemberExpression, property: { name: tsPattern.P.select(tsPattern.P.string) } }, eff.identity).otherwise(() => null);
|
|
207
207
|
if (name3 != null && ER2__namespace.isComponentName(name3) && name3.endsWith("Context")) return;
|
|
208
208
|
context.report({
|
|
209
209
|
messageId: "invalid",
|
|
@@ -433,7 +433,7 @@ function create5(context) {
|
|
|
433
433
|
context.report({ messageId: "missingDestructuring", node });
|
|
434
434
|
return;
|
|
435
435
|
}
|
|
436
|
-
const setterName = tsPattern.match(setter).with({ type: types.AST_NODE_TYPES.Identifier }, (id2) => id2.name).otherwise(() =>
|
|
436
|
+
const setterName = tsPattern.match(setter).with({ type: types.AST_NODE_TYPES.Identifier }, (id2) => id2.name).otherwise(() => null);
|
|
437
437
|
if (setterName == null || !setterName.startsWith("set")) {
|
|
438
438
|
context.report({ messageId: "invalidSetterNaming", node });
|
|
439
439
|
return;
|
|
@@ -446,7 +446,7 @@ function create5(context) {
|
|
|
446
446
|
return acc;
|
|
447
447
|
}, []);
|
|
448
448
|
return values.join("_");
|
|
449
|
-
}).otherwise(() =>
|
|
449
|
+
}).otherwise(() => null);
|
|
450
450
|
if (valueName == null || `set_${valueName}` !== stringTs.snakeCase(setterName)) {
|
|
451
451
|
context.report({ messageId: "invalidSetterNaming", node });
|
|
452
452
|
return;
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import * as ER2 from '@eslint-react/core';
|
|
|
3
3
|
import { toRegExp, RE_PASCAL_CASE, RE_CONSTANT_CASE, RE_CAMEL_CASE, RE_KEBAB_CASE, RE_SNAKE_CASE } from '@eslint-react/kit';
|
|
4
4
|
import { getDocsUrl } from '@eslint-react/shared';
|
|
5
5
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
6
|
-
import { identity,
|
|
6
|
+
import { identity, isObject } from '@eslint-react/eff';
|
|
7
7
|
import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
8
8
|
import { match, P } from 'ts-pattern';
|
|
9
9
|
import path from 'node:path';
|
|
@@ -29,7 +29,7 @@ var rules = {
|
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
31
|
var name2 = "eslint-plugin-react-naming-convention";
|
|
32
|
-
var version = "1.42.2-next.
|
|
32
|
+
var version = "1.42.2-next.4";
|
|
33
33
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("naming-convention"));
|
|
34
34
|
|
|
35
35
|
// src/rules/component-name.ts
|
|
@@ -177,7 +177,7 @@ function create2(context) {
|
|
|
177
177
|
if (!ER2.isCreateContextCall(context, node)) return;
|
|
178
178
|
const id = ER2.getInstanceId(node);
|
|
179
179
|
if (id == null) return;
|
|
180
|
-
const name3 = match(id).with({ type: AST_NODE_TYPES.Identifier, name: P.select() }, identity).with({ type: AST_NODE_TYPES.MemberExpression, property: { name: P.select(P.string) } }, identity).otherwise(() =>
|
|
180
|
+
const name3 = match(id).with({ type: AST_NODE_TYPES.Identifier, name: P.select() }, identity).with({ type: AST_NODE_TYPES.MemberExpression, property: { name: P.select(P.string) } }, identity).otherwise(() => null);
|
|
181
181
|
if (name3 != null && ER2.isComponentName(name3) && name3.endsWith("Context")) return;
|
|
182
182
|
context.report({
|
|
183
183
|
messageId: "invalid",
|
|
@@ -407,7 +407,7 @@ function create5(context) {
|
|
|
407
407
|
context.report({ messageId: "missingDestructuring", node });
|
|
408
408
|
return;
|
|
409
409
|
}
|
|
410
|
-
const setterName = match(setter).with({ type: AST_NODE_TYPES.Identifier }, (id2) => id2.name).otherwise(() =>
|
|
410
|
+
const setterName = match(setter).with({ type: AST_NODE_TYPES.Identifier }, (id2) => id2.name).otherwise(() => null);
|
|
411
411
|
if (setterName == null || !setterName.startsWith("set")) {
|
|
412
412
|
context.report({ messageId: "invalidSetterNaming", node });
|
|
413
413
|
return;
|
|
@@ -420,7 +420,7 @@ function create5(context) {
|
|
|
420
420
|
return acc;
|
|
421
421
|
}, []);
|
|
422
422
|
return values.join("_");
|
|
423
|
-
}).otherwise(() =>
|
|
423
|
+
}).otherwise(() => null);
|
|
424
424
|
if (valueName == null || `set_${valueName}` !== snakeCase(setterName)) {
|
|
425
425
|
context.report({ messageId: "invalidSetterNaming", node });
|
|
426
426
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "1.42.2-next.
|
|
3
|
+
"version": "1.42.2-next.4",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,17 +49,17 @@
|
|
|
49
49
|
"@typescript-eslint/utils": "^8.29.1",
|
|
50
50
|
"string-ts": "^2.2.1",
|
|
51
51
|
"ts-pattern": "^5.7.0",
|
|
52
|
-
"@eslint-react/ast": "1.42.2-next.
|
|
53
|
-
"@eslint-react/core": "1.42.2-next.
|
|
54
|
-
"@eslint-react/jsx": "1.42.2-next.
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.42.2-next.4",
|
|
53
|
+
"@eslint-react/core": "1.42.2-next.4",
|
|
54
|
+
"@eslint-react/jsx": "1.42.2-next.4",
|
|
55
|
+
"@eslint-react/shared": "1.42.2-next.4",
|
|
56
|
+
"@eslint-react/eff": "1.42.2-next.4",
|
|
57
|
+
"@eslint-react/kit": "1.42.2-next.4",
|
|
58
|
+
"@eslint-react/var": "1.42.2-next.4"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.0",
|
|
62
|
-
"@types/react-dom": "^19.1.
|
|
62
|
+
"@types/react-dom": "^19.1.2",
|
|
63
63
|
"tsup": "^8.4.0",
|
|
64
64
|
"@local/configs": "0.0.0"
|
|
65
65
|
},
|