Skip to content

vue/prop-name-casing false positive reaction #932

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

Closed
yekver opened this issue Jul 22, 2019 · 2 comments · Fixed by #1152
Closed

vue/prop-name-casing false positive reaction #932

yekver opened this issue Jul 22, 2019 · 2 comments · Fixed by #1152
Labels

Comments

@yekver
Copy link

yekver commented Jul 22, 2019

Tell us about your environment

  • ESLint version: 6.0.1
  • eslint-plugin-vue version: 5.2.3
  • Node version: 12.6.0

What did you do?

export default {
  props: {
    $css: { type: Function, default: () => '' },
  }
}

What did you expect to happen?
No warning should be emitted

What actually happened?
Prop "$css" is not in camelCase.eslint(vue/prop-name-casing)

@sirlancelot
Copy link

sirlancelot commented Aug 8, 2019

The same is happening for props prefixed with _ as well:

image

Even worse, the linter is automatically "fixing" this which actually breaks code that would depend on the underscore being there. I'm using the underscore as a way to represent "internal" props which should never be accessed from templates.

For now my workaround is to disable that rule for these lines only:

image

This should definitely be considered a bug though, as it is changing code in a way that will break things.

@sirlancelot
Copy link

Related: #862

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants