Skip to content
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

VDirectiveKey: parsing arguments changes argument into lowercase letters. #12

Closed
armano2 opened this issue Aug 1, 2017 · 4 comments
Closed

Comments

@armano2
Copy link
Contributor

armano2 commented Aug 1, 2017

In all VDirectiveKey argument is lowercased.
required for: vuejs/eslint-plugin-vue#95

Tested on version: 2.0.0-beta.2

Input

<template>
    <div v-bind:FooBar=""></div>
</template>

Output

...
{
    "type": "VDirectiveKey",
    "range": [
        21,
        34
    ],
    "loc": {
        "start": {
            "line": 2,
            "column": 9
        },
        "end": {
            "line": 2,
            "column": 22
        }
    },
    "name": "bind",
    "argument": "foobar",
    "modifiers": [],
    "shorthand": false
}
...
@armano2 armano2 changed the title VDirectiveKey: parsing arguments (casing is removed) VDirectiveKey: parsing arguments changes argument into lowercase letters. Aug 1, 2017
@mysticatea
Copy link
Member

Thank you for this report.

In except the defined properties of custom components, v-on:attrName and v-on:attrname are the same attribute, both become v-on:attrname. So this is not a bug. However, I agree it's inconvenient if we cannot get the raw data of key.argument easily. I will add new property raw.

{
    "type": "VDirectiveKey",
    "range": [
        21,
        34
    ],
    "loc": {
        "start": {
            "line": 2,
            "column": 9
        },
        "end": {
            "line": 2,
            "column": 22
        }
    },
    "name": "bind",
    "argument": "foobar",
    "modifiers": [],
    "raw": {
        "name": "bind",
        "argument": "FooBar",
        "modifiers": [],
    },
    "shorthand": false
}

@armano2
Copy link
Contributor Author

armano2 commented Aug 2, 2017

@mysticatea thank you, its going to be easier to get it from raw than accessing source code & parsing it by my own.

@mysticatea
Copy link
Member

I added some properties (v2.0.0-beta.2...master#diff-60a3c5d4caa5a12bdd8e920349affeb7). Please use v2.0.0-beta.3.

  • VIdentifier#rawName
  • VDirectiveKey#raw
  • VElement#rawName

@armano2
Copy link
Contributor Author

armano2 commented Aug 2, 2017

@mysticatea thank you

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

No branches or pull requests

2 participants