-
-
Notifications
You must be signed in to change notification settings - Fork 681
Report type-only imports in no-undef-components
#1967
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
Conversation
Two issues in CI:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR!
parser: require.resolve('vue-eslint-parser'), | ||
errors: [ | ||
{ | ||
message: "The '<Foo>' component has been used, but not defined.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to make the message clearer. For example:
'<Foo>' component has been used, but 'Foo' only refers to a type.
What do you think?
lib/rules/no-undef-components.js
Outdated
@@ -130,7 +130,16 @@ module.exports = { | |||
(scope) => scope.type === 'module' | |||
) | |||
for (const variable of (moduleScope && moduleScope.variables) || []) { | |||
scriptVariableNames.add(variable.name) | |||
const definition = variable.defs[0] | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can more easily check if it's a value by doing:
if (!variable.isValueVariable || variable.isValueVariable())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment of mine was wrong 😓
We need to branch using semver regarding test cases failing in tseslint v4. We have already done that in some test cases. |
@@ -1,6 +1,6 @@ | |||
{ | |||
"compilerOptions": { | |||
"target": "ES2020", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This time I made vuepress support optional chaining operator
by lowering the target version.
If it is not proper, please tell me and I will find another way to make it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into what is causing the vuepress build not to work. I didn't know that setting affects vuepress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I just lost my mind at that moment 😢. This doesn't affect js
files, errors just disappear accidentally.
Thanks a lot for your comment, they are extremely helpful. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for your contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
no-undef-components
fix #1963