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, and prettier-plugin-astro
- Write an
eslint.config.js with @typescript-eslint/no-misused-promises set to 'error'
- Try to lint the following page:
---
return Astro.redirect('/404');
---
- ESLint crashes :(
Describe the Bug
If the
@typescript-eslint/no-misused-promisesrule is enabled in ESLint, a statement likereturn 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 thanprettier-plugin-astro, I can't really tell for sure, I just suspect it might be a symptom of a problem with that PR.Steps to Reproduce
typescript-eslint,eslint-plugin-prettier, andprettier-plugin-astroeslint.config.jswith@typescript-eslint/no-misused-promisesset to'error'