eslint-plugin-react-naming-convention 2.7.2-beta.1 → 2.7.2-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 +25 -29
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, getConfigAdapters, getSettingsFromContext, toRegExp } from "@eslint-react/shared";
|
|
1
|
+
import { RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, defineRuleListener, getConfigAdapters, getSettingsFromContext, toRegExp } from "@eslint-react/shared";
|
|
2
2
|
import { findEnclosingAssignmentTarget, isComponentName, isCreateContextCall, isUseRefCall, isUseStateCall, useComponentCollector, useComponentCollectorLegacy } from "@eslint-react/core";
|
|
3
3
|
import { ESLintUtils } from "@typescript-eslint/utils";
|
|
4
4
|
import { AST_NODE_TYPES } from "@typescript-eslint/types";
|
|
@@ -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 = "2.7.2-beta.
|
|
44
|
+
var version = "2.7.2-beta.3";
|
|
45
45
|
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/utils/create-rule.ts
|
|
@@ -96,34 +96,30 @@ function create$5(context) {
|
|
|
96
96
|
const { rule } = options;
|
|
97
97
|
const fCollector = useComponentCollector(context);
|
|
98
98
|
const cCollector = useComponentCollectorLegacy(context);
|
|
99
|
-
return {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
rule
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
for (const { id, name: name$2, node } of cCollector.ctx.getAllComponents(program)) {
|
|
115
|
-
if (isValidName(name$2, options)) continue;
|
|
116
|
-
context.report({
|
|
117
|
-
messageId: "invalidComponentName",
|
|
118
|
-
node: id ?? node,
|
|
119
|
-
data: {
|
|
120
|
-
name: name$2,
|
|
121
|
-
rule
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
}
|
|
99
|
+
return defineRuleListener(fCollector.visitors, cCollector.visitors, { "Program:exit"(program) {
|
|
100
|
+
for (const { id, name: name$2, node: component } of fCollector.ctx.getAllComponents(program)) {
|
|
101
|
+
if (isValidName(name$2, options)) continue;
|
|
102
|
+
context.report({
|
|
103
|
+
messageId: "invalidComponentName",
|
|
104
|
+
node: id ?? component,
|
|
105
|
+
data: {
|
|
106
|
+
name: name$2,
|
|
107
|
+
rule
|
|
108
|
+
}
|
|
109
|
+
});
|
|
125
110
|
}
|
|
126
|
-
|
|
111
|
+
for (const { id, name: name$2, node } of cCollector.ctx.getAllComponents(program)) {
|
|
112
|
+
if (isValidName(name$2, options)) continue;
|
|
113
|
+
context.report({
|
|
114
|
+
messageId: "invalidComponentName",
|
|
115
|
+
node: id ?? node,
|
|
116
|
+
data: {
|
|
117
|
+
name: name$2,
|
|
118
|
+
rule
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
} });
|
|
127
123
|
}
|
|
128
124
|
function normalizeOptions(options) {
|
|
129
125
|
const opts = options[0];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "2.7.2-beta.
|
|
3
|
+
"version": "2.7.2-beta.3",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,11 +45,11 @@
|
|
|
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": "2.7.2-beta.
|
|
49
|
-
"@eslint-react/core": "2.7.2-beta.
|
|
50
|
-
"@eslint-react/eff": "2.7.2-beta.
|
|
51
|
-
"@eslint-react/shared": "2.7.2-beta.
|
|
52
|
-
"@eslint-react/var": "2.7.2-beta.
|
|
48
|
+
"@eslint-react/ast": "2.7.2-beta.3",
|
|
49
|
+
"@eslint-react/core": "2.7.2-beta.3",
|
|
50
|
+
"@eslint-react/eff": "2.7.2-beta.3",
|
|
51
|
+
"@eslint-react/shared": "2.7.2-beta.3",
|
|
52
|
+
"@eslint-react/var": "2.7.2-beta.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/react": "^19.2.8",
|