Skip to content

TypeError in no-unused-class-name #526

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

Closed
2 tasks done
marekdedic opened this issue Jun 28, 2023 · 0 comments · Fixed by #527
Closed
2 tasks done

TypeError in no-unused-class-name #526

marekdedic opened this issue Jun 28, 2023 · 0 comments · Fixed by #527

Comments

@marekdedic
Copy link
Contributor

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

v8.42.0

What version of eslint-plugin-svelte are you using?

v2.32.0

What did you do?

See skaut/shared-drive-mover#1333

What did you expect to happen?

No error

What actually happened?

Oops! Something went wrong! :(

ESLint: 8.42.0

TypeError: Cannot read properties of undefined (reading 'flatMap')
Occurred while linting /home/marekdedic/shared-drive-mover/src/frontend/App.svelte:1
Rule: "svelte/no-unused-class-name"
    at findClassesInPostCSSNode (/home/marekdedic/shared-drive-mover/node_modules/eslint-plugin-svelte/lib/rules/no-unused-class-name.js:89:27)
    at Array.flatMap (<anonymous>)
    at findClassesInPostCSSNode (/home/marekdedic/shared-drive-mover/node_modules/eslint-plugin-svelte/lib/rules/no-unused-class-name.js:89:27)
    at Program:exit (/home/marekdedic/shared-drive-mover/node_modules/eslint-plugin-svelte/lib/rules/no-unused-class-name.js:54:23)
    at ruleErrorHandler (/home/marekdedic/shared-drive-mover/node_modules/eslint/lib/linter/linter.js:1050:28)
    at /home/marekdedic/shared-drive-mover/node_modules/eslint/lib/linter/safe-emitter.js:45:58
    at Array.forEach (<anonymous>)
    at Object.emit (/home/marekdedic/shared-drive-mover/node_modules/eslint/lib/linter/safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (/home/marekdedic/shared-drive-mover/node_modules/eslint/lib/linter/node-event-generator.js:297:26)
    at NodeEventGenerator.applySelectors (/home/marekdedic/shared-drive-mover/node_modules/eslint/lib/linter/node-event-generator.js:326:22)

Link to GitHub Repo with Minimal Reproducible Example

skaut/shared-drive-mover#1333

Additional comments

The problem is this at-rule because it has no children...

https://github.com/skaut/shared-drive-mover/blob/2c121a54100c8126ce989d41a6f25b9a45be41fd/src/frontend/App.svelte#L226

Will take a look at it tomorrow...

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 a pull request may close this issue.

1 participant