-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Describe the Bug
If the @typescript-eslint/no-misused-promises rule is enabled in ESLint, a statement like return Astro.redirect('/404'); in the frontmatter will cause ESLint to crash. I'm assuming this might be related to the workaround implemented in #336. Sorry if this a problem with a package other than prettier-plugin-astro, I can't really tell for sure, I just suspect it might be a symptom of a problem with that PR.
Oops! Something went wrong! :(
ESLint: 9.39.1
Error: Non-null Assertion Failed: Expected node to have a parent.
Occurred while linting [project]/src/pages/index.astro:14
Rule: "@typescript-eslint/no-misused-promises"
at nullThrows [project]/node_modules/@typescript-eslint/utils/dist/eslint-utils/nullThrows.js:18:15)
at [project]/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js:462:46
at checkReturnStatement ([project]/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-misused-promises.js:463:15)
at ruleErrorHandler ([project]/node_modules/eslint/lib/linter/linter.js:1173:33)
at [project]/node_modules/eslint/lib/linter/source-code-visitor.js:76:46
at Array.forEach (<anonymous>)
at SourceCodeVisitor.callSync ([project]/node_modules/eslint/lib/linter/source-code-visitor.js:76:30)
at [project]/node_modules/eslint/lib/linter/source-code-traverser.js:291:18
at Array.forEach (<anonymous>)
at SourceCodeTraverser.traverseSync ([project]/node_modules/eslint/lib/linter/source-code-traverser.js:290:10)
Steps to Reproduce
- Install
typescript-eslint,eslint-plugin-prettier, andprettier-plugin-astro - Write an
eslint.config.jswith@typescript-eslint/no-misused-promisesset to'error' - Try to lint the following page:
---
return Astro.redirect('/404');
---- ESLint crashes :(
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels