eslint-plugin-astro
eslint-plugin-astro copied to clipboard
Default export of an Astro component has a type `any`
Before You File a Bug Report Please Confirm You Have Done The Following...
- [X] I have tried restarting my IDE and the issue persists.
- [X] I have updated to the latest version of the packages.
What version of ESLint are you using?
8.57.0
What version of eslint-plugin-astro
are you using?
0.33.1
What did you do?
Configuration
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:astro/recommended"
],
parserOptions: {
project: "./tsconfig.json",
},
overrides: [
{
files: ["*.astro"],
parser: "astro-eslint-parser",
parserOptions: {
parser: "@typescript-eslint/parser",
extraFileExtensions: [".astro"],
},
}
]
}
<!-- Foo.astro -->
<div></div>
---
// ErrorComponent.astro
import Foo from './Foo.astro';
const Errored = Foo;
---
<Errored />
What did you expect to happen?
const Errored = Foo;
There should be no lint errors.
What actually happened?
Unsafe assignment of an `any` value @typescript-eslint/no-unsafe-assignment
Link to Minimal Reproducible Example
https://eslint-online-playground.netlify.app/#eNp9UstOwzAQ/BXLFyREHKBUoFAQEo8rH4A5RM62uG3syHaroqr/ztqbtKmacsljd2Z2Z+wt907l785Z92rrxhowQZQ+OMsLnmWZNBqrLrAPa9nU2ZpdiBy/CXPxKI00yhofWNKAij1FKNYTWZpJV8+fpeFXadyejzMmlV4/T/L4TP3gUW6qZ2LurcH+FkWC5LAJYCovecEkT9y8Q/ocf7VCkDS7pCHAL7UJTgk196hR22q1BAGb6MTjhijKWCtZsK/4x1CXaIUDZesae1BJftU1m+Vqpk3xEn4b8MrpJmSEz3v4LHYz9QNqMUSmxY/0I+I74ZrSeXCfTdCYZ0E7YtXZOagQbYu95RROK79LT7sG53QFBzstn7GpXlKZX1LqktPAJJ+G7kNtLWVU3hs4t9yxwkA0Jzopdld+4E7vMX9Perjc6W7kDN8po+5wm1Ityhn07kcMuIImBmqUhnRJ2gVbW3Rt7sRY3NxS5KQdeeu3c9R//ES5e5S77p3xALxLM53+MIsg1HsQ4/uBZsvPelauxWgkbnrIw2wCjMWdGLVWKbndHzgBR2k=
Additional comments
Unlike issue https://github.com/ota-meshi/eslint-plugin-astro/issues/341, using https://github.com/ota-meshi/typescript-eslint-parser-for-extra-files still results in a lint error.
Maybe related with https://github.com/ota-meshi/astro-eslint-parser/issues/259