uilint-eslint 0.2.21 → 0.2.23
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 +66 -140
- package/dist/index.js.map +1 -1
- package/dist/rules/consistent-dark-mode.js +62 -136
- package/dist/rules/consistent-dark-mode.js.map +1 -1
- package/dist/rules/enforce-absolute-imports.js.map +1 -1
- package/dist/rules/no-any-in-props.js +1 -1
- package/dist/rules/no-any-in-props.js.map +1 -1
- package/dist/rules/no-prop-drilling-depth.js +3 -16
- package/dist/rules/no-prop-drilling-depth.js.map +1 -1
- package/package.json +2 -2
- package/src/rules/consistent-dark-mode.test.ts +61 -25
- package/src/rules/consistent-dark-mode.ts +86 -160
- package/src/rules/enforce-absolute-imports.ts +3 -2
- package/src/rules/no-any-in-props.ts +5 -2
- package/src/rules/no-prop-drilling-depth.ts +4 -10
|
@@ -205,9 +205,12 @@ function containsAnyType(
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
for (const param of node.params) {
|
|
208
|
+
// Skip TSParameterProperty (doesn't have typeAnnotation) and RestElement
|
|
208
209
|
if (
|
|
209
|
-
param.
|
|
210
|
-
param.type !== "
|
|
210
|
+
param.type !== "RestElement" &&
|
|
211
|
+
param.type !== "TSParameterProperty" &&
|
|
212
|
+
"typeAnnotation" in param &&
|
|
213
|
+
param.typeAnnotation?.typeAnnotation
|
|
211
214
|
) {
|
|
212
215
|
const result = containsAnyType(
|
|
213
216
|
param.typeAnnotation.typeAnnotation,
|
|
@@ -13,11 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
import type { TSESTree } from "@typescript-eslint/utils";
|
|
15
15
|
import { createRule, defineRuleMeta } from "../utils/create-rule.js";
|
|
16
|
-
import {
|
|
17
|
-
resolveImportPath,
|
|
18
|
-
parseFile,
|
|
19
|
-
clearResolverCaches,
|
|
20
|
-
} from "../utils/export-resolver.js";
|
|
21
16
|
|
|
22
17
|
type MessageIds = "propDrilling";
|
|
23
18
|
type Options = [
|
|
@@ -60,9 +55,9 @@ export const meta = defineRuleMeta({
|
|
|
60
55
|
{
|
|
61
56
|
key: "ignoredProps",
|
|
62
57
|
label: "Ignored props",
|
|
63
|
-
type: "
|
|
64
|
-
defaultValue:
|
|
65
|
-
description: "
|
|
58
|
+
type: "text",
|
|
59
|
+
defaultValue: "className, style, children, key, ref, id",
|
|
60
|
+
description: "Comma-separated prop names to ignore (common pass-through props)",
|
|
66
61
|
},
|
|
67
62
|
],
|
|
68
63
|
},
|
|
@@ -157,7 +152,6 @@ const componentPropCache = new Map<string, ComponentPropInfo>();
|
|
|
157
152
|
*/
|
|
158
153
|
export function clearPropCache(): void {
|
|
159
154
|
componentPropCache.clear();
|
|
160
|
-
clearResolverCaches();
|
|
161
155
|
}
|
|
162
156
|
|
|
163
157
|
/**
|
|
@@ -295,7 +289,7 @@ function analyzeJSXPropPassing(
|
|
|
295
289
|
// Recurse into children
|
|
296
290
|
for (const key of Object.keys(node)) {
|
|
297
291
|
if (key === "parent" || key === "loc" || key === "range") continue;
|
|
298
|
-
const child = (node as Record<string, unknown>)[key];
|
|
292
|
+
const child = (node as unknown as Record<string, unknown>)[key];
|
|
299
293
|
if (Array.isArray(child)) {
|
|
300
294
|
for (const item of child) {
|
|
301
295
|
if (item && typeof item === "object") {
|