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

[BUG] Cannot read properties of undefined (reading 'type') #250

Closed
ericbf opened this issue Jun 2, 2023 · 0 comments · Fixed by #251
Closed

[BUG] Cannot read properties of undefined (reading 'type') #250

ericbf opened this issue Jun 2, 2023 · 0 comments · Fixed by #251
Labels
bug Something isn't working

Comments

@ericbf
Copy link

ericbf commented Jun 2, 2023

Describe the bug

When I use >= eslint-plugin-taildwindcss@3.11.0, I get this error:

$ eslint src --ext .ts,.tsx --max-warnings 0


Oops! Something went wrong! :(

ESLint: 8.41.0

TypeError: Cannot read properties of undefined (reading 'type')
Occurred while linting XXX:133
Rule: "tailwindcss/no-custom-classname"
    at XXX/node_modules/eslint-plugin-tailwindcss/lib/util/ast.js:292:24
    at Array.forEach (<anonymous>)
    at Object.parseNodeRecursive (XXX/node_modules/eslint-plugin-tailwindcss/lib/util/ast.js:289:30)
    at attributeVisitor (XXX/node_modules/eslint-plugin-tailwindcss/lib/rules/no-custom-classname.js:163:17)
    at ruleErrorHandler (XXX/node_modules/eslint/lib/linter/lint..er.js:1050:28)
    at XXX/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (XXX/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (XXX/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (XXX/node_modules/eslint/lib/linter/node-event-generator.js:326:22)

But when I install eslint-plugin-tailwindcss@~3.10.0, it succeeds without any issues.

A clear and concise description of what the bug is.

To Reproduce

I don’t have a minimal reproduction. Is there some playground or starter that I can use to try to put one together?

Steps to reproduce the behavior:

  1. Install >3.11.0
  2. Run lint with no-custom-classname
  3. See error

Expected behavior

Success.

Environment (please complete the following information):

  • OS: macOS
  • Softwares + version used:
    • npm 9.5.1
    • eslint 8.4.1
    • node v18.16.0

eslint config file or live demo

{
	"extends": [
		"plugin:tailwindcss/recommended",
	],
	"parserOptions": {
		"project": "./tsconfig.json"
	},
	"rules": {
		"tailwindcss/classnames-order": "off"
	}
}
@ericbf ericbf added the bug Something isn't working label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant