Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

vue/no-shadow false positive in double script block #1800

Open
@sqal

Description

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: 8.9.0
  • eslint-plugin-vue version: 8.4.1
  • Node version:
  • Operating System:

Please show your full configuration:

module.exports = {
 extends: [
 'plugin:vue/vue3-recommended',
 ],
 rules: {
 'no-shadow': 'error',
 },
};

What did you do?

<script>
 export function useModal() {
 const close = () => {}

 return { close }
 }
</script>
<script setup>
 function close() {

 }
</script>
<template>
 <Modal @close="close"></Modal>
</template>

What did you expect to happen?
No errors reported for the no-shadow rule.

What actually happened?

[3:11]: 'close' is already declared in the upper scope on line 10 column 12. (no-shadow)

Repository to reproduce this issue

Online Playground

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /