eslint-plugin-react-naming-convention 1.43.2-next.1 → 1.45.0-next.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 +8 -8
- package/dist/index.mjs +8 -8
- package/package.json +8 -8
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.
|
|
58
|
+
var version = "1.45.0-next.3";
|
|
59
59
|
var createRule = utils.ESLintUtils.RuleCreator(shared.getDocsUrl("naming-convention"));
|
|
60
60
|
|
|
61
61
|
// src/rules/component-name.ts
|
|
@@ -126,9 +126,9 @@ function create(context) {
|
|
|
126
126
|
return {
|
|
127
127
|
...collector.listeners,
|
|
128
128
|
...collectorLegacy.listeners,
|
|
129
|
-
"Program:exit"(
|
|
130
|
-
const functionComponents = collector.ctx.getAllComponents(
|
|
131
|
-
const classComponents = collectorLegacy.ctx.getAllComponents(
|
|
129
|
+
"Program:exit"(program) {
|
|
130
|
+
const functionComponents = collector.ctx.getAllComponents(program);
|
|
131
|
+
const classComponents = collectorLegacy.ctx.getAllComponents(program);
|
|
132
132
|
for (const { node: component } of functionComponents.values()) {
|
|
133
133
|
const id = AST__namespace.getFunctionIdentifier(component);
|
|
134
134
|
if (id?.name == null) continue;
|
|
@@ -367,20 +367,20 @@ function create4(context) {
|
|
|
367
367
|
JSXFragment() {
|
|
368
368
|
hasJSXNode = true;
|
|
369
369
|
},
|
|
370
|
-
"Program:exit"(
|
|
370
|
+
"Program:exit"(program) {
|
|
371
371
|
const fileNameExt = filename.slice(filename.lastIndexOf("."));
|
|
372
372
|
const isJSXExt = extensions.includes(fileNameExt);
|
|
373
373
|
if (hasJSXNode && !isJSXExt) {
|
|
374
374
|
context.report({
|
|
375
375
|
messageId: "useJsxFileExtension",
|
|
376
|
-
node,
|
|
376
|
+
node: program,
|
|
377
377
|
data: {
|
|
378
378
|
extensions: extensionsString
|
|
379
379
|
}
|
|
380
380
|
});
|
|
381
381
|
return;
|
|
382
382
|
}
|
|
383
|
-
const hasCode =
|
|
383
|
+
const hasCode = program.body.length > 0;
|
|
384
384
|
const ignoreFilesWithoutCode = eff.isObject(options) && options.ignoreFilesWithoutCode === true;
|
|
385
385
|
if (!hasCode && ignoreFilesWithoutCode) {
|
|
386
386
|
return;
|
|
@@ -388,7 +388,7 @@ function create4(context) {
|
|
|
388
388
|
if (!hasJSXNode && isJSXExt && allow === "as-needed") {
|
|
389
389
|
context.report({
|
|
390
390
|
messageId: "useNonJsxFileExtension",
|
|
391
|
-
node,
|
|
391
|
+
node: program,
|
|
392
392
|
data: {
|
|
393
393
|
extensions: extensionsString
|
|
394
394
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -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.
|
|
32
|
+
var version = "1.45.0-next.3";
|
|
33
33
|
var createRule = ESLintUtils.RuleCreator(getDocsUrl("naming-convention"));
|
|
34
34
|
|
|
35
35
|
// src/rules/component-name.ts
|
|
@@ -100,9 +100,9 @@ function create(context) {
|
|
|
100
100
|
return {
|
|
101
101
|
...collector.listeners,
|
|
102
102
|
...collectorLegacy.listeners,
|
|
103
|
-
"Program:exit"(
|
|
104
|
-
const functionComponents = collector.ctx.getAllComponents(
|
|
105
|
-
const classComponents = collectorLegacy.ctx.getAllComponents(
|
|
103
|
+
"Program:exit"(program) {
|
|
104
|
+
const functionComponents = collector.ctx.getAllComponents(program);
|
|
105
|
+
const classComponents = collectorLegacy.ctx.getAllComponents(program);
|
|
106
106
|
for (const { node: component } of functionComponents.values()) {
|
|
107
107
|
const id = AST.getFunctionIdentifier(component);
|
|
108
108
|
if (id?.name == null) continue;
|
|
@@ -341,20 +341,20 @@ function create4(context) {
|
|
|
341
341
|
JSXFragment() {
|
|
342
342
|
hasJSXNode = true;
|
|
343
343
|
},
|
|
344
|
-
"Program:exit"(
|
|
344
|
+
"Program:exit"(program) {
|
|
345
345
|
const fileNameExt = filename.slice(filename.lastIndexOf("."));
|
|
346
346
|
const isJSXExt = extensions.includes(fileNameExt);
|
|
347
347
|
if (hasJSXNode && !isJSXExt) {
|
|
348
348
|
context.report({
|
|
349
349
|
messageId: "useJsxFileExtension",
|
|
350
|
-
node,
|
|
350
|
+
node: program,
|
|
351
351
|
data: {
|
|
352
352
|
extensions: extensionsString
|
|
353
353
|
}
|
|
354
354
|
});
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
|
-
const hasCode =
|
|
357
|
+
const hasCode = program.body.length > 0;
|
|
358
358
|
const ignoreFilesWithoutCode = isObject(options) && options.ignoreFilesWithoutCode === true;
|
|
359
359
|
if (!hasCode && ignoreFilesWithoutCode) {
|
|
360
360
|
return;
|
|
@@ -362,7 +362,7 @@ function create4(context) {
|
|
|
362
362
|
if (!hasJSXNode && isJSXExt && allow === "as-needed") {
|
|
363
363
|
context.report({
|
|
364
364
|
messageId: "useNonJsxFileExtension",
|
|
365
|
-
node,
|
|
365
|
+
node: program,
|
|
366
366
|
data: {
|
|
367
367
|
extensions: extensionsString
|
|
368
368
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.45.0-next.3",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,13 +49,13 @@
|
|
|
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.
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
55
|
-
"@eslint-react/
|
|
56
|
-
"@eslint-react/
|
|
57
|
-
"@eslint-react/var": "1.
|
|
58
|
-
"@eslint-react/
|
|
52
|
+
"@eslint-react/ast": "1.45.0-next.3",
|
|
53
|
+
"@eslint-react/core": "1.45.0-next.3",
|
|
54
|
+
"@eslint-react/jsx": "1.45.0-next.3",
|
|
55
|
+
"@eslint-react/eff": "1.45.0-next.3",
|
|
56
|
+
"@eslint-react/shared": "1.45.0-next.3",
|
|
57
|
+
"@eslint-react/var": "1.45.0-next.3",
|
|
58
|
+
"@eslint-react/kit": "1.45.0-next.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/react": "^19.1.0",
|