Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Parsing spreads in object expressions #251

Merged
merged 1 commit into from
Jun 24, 2023

Conversation

bezbac
Copy link
Contributor

@bezbac bezbac commented Jun 3, 2023

Object expression parsing

Description

The code inside ast.js previously assumed that properties of an ObjectExpression ast node would always be a Property node, but the spec also allows them to be a SpreadExpression (See here)

Fixes #250

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I added a test case with a spread expression inside the className property.
As expected this test failed, throwing "TypeError: Cannot read properties of undefined (reading 'type')". After modifying the code inside ast.js, this test now passes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@francoismassart
Copy link
Owner

Hi @bezbac,
thank you for your contributions 👏 , sorry about the delay of response, my wife has a disabled arm for few weeks and I've way more daily home tasks to handle 😅
I'll merge it and publish a beta version in order to test it against real world projects.

@francoismassart francoismassart merged commit ae7000a into francoismassart:master Jun 24, 2023
@francoismassart
Copy link
Owner

npm i eslint-plugin-tailwindcss@3.13.0-beta.0

@francoismassart
Copy link
Owner

I tested it on our main website and it work smoothly. Waiting few days for feedback and I'll be releasing v3.13.0 officially. 😺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Cannot read properties of undefined (reading 'type')
2 participants