eslint-plugin-react-naming-convention 1.16.2 → 1.17.0-next.0
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -2
- package/dist/index.mjs +9 -2
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -25,6 +25,7 @@ declare const _default: {
|
|
|
25
25
|
readonly "filename-extension": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$1, readonly [("always" | "as-needed") | {
|
|
26
26
|
allow?: "always" | "as-needed";
|
|
27
27
|
extensions?: readonly string[];
|
|
28
|
+
ignoreFilesWithoutCode?: boolean;
|
|
28
29
|
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
29
30
|
readonly "use-state": _typescript_eslint_utils_ts_eslint.RuleModule<"useState", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
30
31
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ declare const _default: {
|
|
|
25
25
|
readonly "filename-extension": _typescript_eslint_utils_ts_eslint.RuleModule<MessageID$1, readonly [("always" | "as-needed") | {
|
|
26
26
|
allow?: "always" | "as-needed";
|
|
27
27
|
extensions?: readonly string[];
|
|
28
|
+
ignoreFilesWithoutCode?: boolean;
|
|
28
29
|
} | undefined], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
29
30
|
readonly "use-state": _typescript_eslint_utils_ts_eslint.RuleModule<"useState", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
|
|
30
31
|
};
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var path__default = /*#__PURE__*/_interopDefault(path);
|
|
|
35
35
|
|
|
36
36
|
// package.json
|
|
37
37
|
var name = "eslint-plugin-react-naming-convention";
|
|
38
|
-
var version = "1.
|
|
38
|
+
var version = "1.17.0-next.0";
|
|
39
39
|
var createRule = shared.createRuleForPlugin("naming-convention");
|
|
40
40
|
|
|
41
41
|
// src/rules/component-name.ts
|
|
@@ -337,7 +337,8 @@ var filename_default = createRule({
|
|
|
337
337
|
var RULE_NAME3 = "filename-extension";
|
|
338
338
|
var defaultOptions3 = [{
|
|
339
339
|
allow: "as-needed",
|
|
340
|
-
extensions: [".jsx", ".tsx"]
|
|
340
|
+
extensions: [".jsx", ".tsx"],
|
|
341
|
+
ignoreFilesWithoutCode: false
|
|
341
342
|
}];
|
|
342
343
|
var schema3 = [
|
|
343
344
|
{
|
|
@@ -360,6 +361,9 @@ var schema3 = [
|
|
|
360
361
|
type: "string"
|
|
361
362
|
},
|
|
362
363
|
uniqueItems: true
|
|
364
|
+
},
|
|
365
|
+
ignoreFilesWithoutCode: {
|
|
366
|
+
type: "boolean"
|
|
363
367
|
}
|
|
364
368
|
}
|
|
365
369
|
}
|
|
@@ -403,6 +407,9 @@ var filename_extension_default = createRule({
|
|
|
403
407
|
});
|
|
404
408
|
return;
|
|
405
409
|
}
|
|
410
|
+
const hasCode = node.body.length > 0;
|
|
411
|
+
const ignoreFilesWithoutCode = tools.isObject(options) && options.ignoreFilesWithoutCode;
|
|
412
|
+
if (!hasCode && ignoreFilesWithoutCode) return;
|
|
406
413
|
if (!hasJSXCode && isJSXExt && allow === "as-needed") {
|
|
407
414
|
context.report({
|
|
408
415
|
messageId: "filenameExtensionUnexpected",
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types';
|
|
|
9
9
|
|
|
10
10
|
// package.json
|
|
11
11
|
var name = "eslint-plugin-react-naming-convention";
|
|
12
|
-
var version = "1.
|
|
12
|
+
var version = "1.17.0-next.0";
|
|
13
13
|
var createRule = createRuleForPlugin("naming-convention");
|
|
14
14
|
|
|
15
15
|
// src/rules/component-name.ts
|
|
@@ -311,7 +311,8 @@ var filename_default = createRule({
|
|
|
311
311
|
var RULE_NAME3 = "filename-extension";
|
|
312
312
|
var defaultOptions3 = [{
|
|
313
313
|
allow: "as-needed",
|
|
314
|
-
extensions: [".jsx", ".tsx"]
|
|
314
|
+
extensions: [".jsx", ".tsx"],
|
|
315
|
+
ignoreFilesWithoutCode: false
|
|
315
316
|
}];
|
|
316
317
|
var schema3 = [
|
|
317
318
|
{
|
|
@@ -334,6 +335,9 @@ var schema3 = [
|
|
|
334
335
|
type: "string"
|
|
335
336
|
},
|
|
336
337
|
uniqueItems: true
|
|
338
|
+
},
|
|
339
|
+
ignoreFilesWithoutCode: {
|
|
340
|
+
type: "boolean"
|
|
337
341
|
}
|
|
338
342
|
}
|
|
339
343
|
}
|
|
@@ -377,6 +381,9 @@ var filename_extension_default = createRule({
|
|
|
377
381
|
});
|
|
378
382
|
return;
|
|
379
383
|
}
|
|
384
|
+
const hasCode = node.body.length > 0;
|
|
385
|
+
const ignoreFilesWithoutCode = isObject(options) && options.ignoreFilesWithoutCode;
|
|
386
|
+
if (!hasCode && ignoreFilesWithoutCode) return;
|
|
380
387
|
if (!hasJSXCode && isJSXExt && allow === "as-needed") {
|
|
381
388
|
context.report({
|
|
382
389
|
messageId: "filenameExtensionUnexpected",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-naming-convention",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0-next.0",
|
|
4
4
|
"description": "ESLint React's ESLint plugin for naming convention related rules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -46,12 +46,12 @@
|
|
|
46
46
|
"@typescript-eslint/types": "^8.15.0",
|
|
47
47
|
"@typescript-eslint/utils": "^8.15.0",
|
|
48
48
|
"ts-pattern": "^5.5.0",
|
|
49
|
-
"@eslint-react/
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
54
|
-
"@eslint-react/
|
|
49
|
+
"@eslint-react/ast": "1.17.0-next.0",
|
|
50
|
+
"@eslint-react/core": "1.17.0-next.0",
|
|
51
|
+
"@eslint-react/jsx": "1.17.0-next.0",
|
|
52
|
+
"@eslint-react/shared": "1.17.0-next.0",
|
|
53
|
+
"@eslint-react/tools": "1.17.0-next.0",
|
|
54
|
+
"@eslint-react/types": "1.17.0-next.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/react": "^18.3.12",
|