Skip to content

prefer-const rule not work at .vue file #2132

@daiwanxing

Description

@daiwanxing

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: latest
  • eslint-plugin-vue version: latest
  • Node version: 16.10.0
  • Operating System: windows 11

Please show your full configuration:

What did you do?

// detect this code and report warning or error.
var foo = 'foo'; 

I would like give a live demo link which from eslint-plugin-vue provided demo site.

As you can see from the demo, I used var keywords and declared a variable which named foo, and then I enabled prefer-const rule, This code should has been detected error by linter, But actually It didn't.

image

please give me a solution, Thanks!

What did you expect to happen?

Report error or warning by rule params

What actually happened?

not change

Repository to reproduce this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions