Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

help: eslint error by importing 'PropType' #189

Closed
qhantom opened this issue Aug 6, 2020 · 2 comments
Closed

help: eslint error by importing 'PropType' #189

qhantom opened this issue Aug 6, 2020 · 2 comments
Assignees

Comments

@qhantom
Copy link

qhantom commented Aug 6, 2020

I would like to import PropType from nuxt-composition-api module. According to the source code, nuxt-composition-api exposes @vue/composition-api so that I can use PropType without any issues. As far as I see, no error is generated technically but ESLint confuses me here:

image

Is it just a linting bug or is there anything configured wrongly?

Thanks and happy coding!

@qhantom qhantom changed the title help: eslint error by importing PropTypes help: eslint error by importing 'PropType' Aug 6, 2020
@danielroe
Copy link
Member

@qhantom This is a known issue with that particular rule in eslint and TypeScript code, and is not particular to this project.

I'd recommend ensuring you have eslint set up with the correct parse (see Nuxt recommended config), turning the rule off for TypeScript code (as there is another TypeScript eslint rule) or doing an explicit type import (import type { PropType } ...).

Some background:

@silverbackdan
Copy link

This issue appeared again for me today after an npm dependency upgrade.

The fix to explicitly import PropType as a type using import type { PropType } from 'vue' still works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants