Skip to content

Commit 0faac27

Browse files
committed
fix: Invalid nesting parsing unrelated objects
1 parent b8cfeec commit 0faac27

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

plugin/src/rules/no-invalid-nesting.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { isIdentifier, isLiteral, isObjectExpression, isTemplateLiteral } from '../utils/nodes'
22
import { type Rule, createRule } from '../utils'
3-
import { isPandaAttribute } from '../utils/helpers'
3+
import { isInJSXProp, isInPandaFunction, isStyledProperty } from '../utils/helpers'
44

55
export const RULE_NAME = 'no-invalid-nesting'
66

@@ -21,7 +21,8 @@ const rule: Rule = createRule({
2121
return {
2222
Property(node) {
2323
if (!isObjectExpression(node.value) || isIdentifier(node.key)) return
24-
if (isPandaAttribute(node, context)) return
24+
if (!isInPandaFunction(node, context) && !isInJSXProp(node, context)) return
25+
if (isStyledProperty(node, context)) return
2526

2627
const invalidLiteral =
2728
isLiteral(node.key) && typeof node.key.value === 'string' && !node.key.value.includes('&')

plugin/src/utils/worker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { createContext } from 'fixture'
44
import { resolveTsPathPattern } from '@pandacss/config/ts-path'
55
import { findConfig, bundleConfig } from '@pandacss/config'
66
import path from 'path'
7-
import fs from 'fs'
87
import type { ImportResult } from '.'
98

109
let promise: Promise<PandaContext> | undefined

0 commit comments

Comments
 (0)