Skip to content

Commit

Permalink
fix: Invalid nesting parsing unrelated objects
Browse files Browse the repository at this point in the history
  • Loading branch information
anubra266 committed Feb 10, 2024
1 parent b8cfeec commit 0faac27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions plugin/src/rules/no-invalid-nesting.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isIdentifier, isLiteral, isObjectExpression, isTemplateLiteral } from '../utils/nodes'
import { type Rule, createRule } from '../utils'
import { isPandaAttribute } from '../utils/helpers'
import { isInJSXProp, isInPandaFunction, isStyledProperty } from '../utils/helpers'

export const RULE_NAME = 'no-invalid-nesting'

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

const invalidLiteral =
isLiteral(node.key) && typeof node.key.value === 'string' && !node.key.value.includes('&')
Expand Down
1 change: 0 additions & 1 deletion plugin/src/utils/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createContext } from 'fixture'
import { resolveTsPathPattern } from '@pandacss/config/ts-path'
import { findConfig, bundleConfig } from '@pandacss/config'
import path from 'path'
import fs from 'fs'
import type { ImportResult } from '.'

let promise: Promise<PandaContext> | undefined
Expand Down

0 comments on commit 0faac27

Please sign in to comment.