Skip to content

typeof VueComponent being inferred as any #81

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

Open
2 tasks done
n0099 opened this issue Dec 18, 2023 · 0 comments
Open
2 tasks done

typeof VueComponent being inferred as any #81

n0099 opened this issue Dec 18, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@n0099
Copy link
Contributor

n0099 commented Dec 18, 2023

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?

8.56.0

What version of typescript-eslint-parser-for-extra-files are you using?

What did you do?

Configuration

https://github.com/n0099/open-tbm/blob/3ac89945c462f35f5400bec45fa9e4e1c26622f3/fe/.eslintrc.cjs#L485

parserOptions: {
    project: ['./tsconfig.json', './tsconfig.node.json'],
    tsconfigRootDir: __dirname,
},
overrides: [{ // https://stackoverflow.com/questions/57107800/eslint-disable-extends-in-override
    files: '*.ts',
    parser: 'typescript-eslint-parser-for-extra-files',
    settings: { 'import/resolver': { typescript: true } },
}, {
    files: '*.vue',
    parser: 'vue-eslint-parser',
    parserOptions: {
        parser: 'typescript-eslint-parser-for-extra-files',
        project: ['./tsconfig.json', './tsconfig.node.json'],
        tsconfigRootDir: __dirname,
    },

https://github.com/n0099/open-tbm/blob/3ac89945c462f35f5400bec45fa9e4e1c26622f3/fe/src/views/Post.vue#L100

const queryFormRef = ref<typeof QueryForm>();
// ...
    switch (queryFormRef.value?.getCurrentQueryType()) {
            ^^^^^^^^^^^^
// Unsafe call of an `any` typed value.(@typescript-eslint/no-unsafe-call)

What did you expect to happen?

Not reporting since the typing of typeof VueComponent is correctly inferred: image

What actually happened?

typeof VueComponent being inferred as any

Link to GitHub Repo with Minimal Reproducible Example

https://github.com/n0099/open-tbm/blob/3ac89945c462f35f5400bec45fa9e4e1c26622f3/fe

Additional comments

No response

@ota-meshi ota-meshi added the help wanted Extra attention is needed label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants