vue-eslint-parser

The ESLint custom parser for `.vue` files.

MIT License

Downloads
16.8M
Stars
429
Committers
14

Bot releases are hidden (Show)

vue-eslint-parser -

Published by mysticatea over 5 years ago

πŸ› Bug fixes

  • 7a1bffda55ea727d002cf2c2bbdb6800bc9a644f fixed the wrong location of auto-generated .prop modifiers.
vue-eslint-parser -

Published by mysticatea over 5 years ago

This release supported the new syntax in Vue.js 2.6 πŸŽ‰

Breaking changes

This release contains a drastic change about VDirectiveKey AST node because now the directive key have gotten to be able to have JavaScript expression.

  export interface VDirectiveKey extends HasLocation, HasParent {
      type: "VDirectiveKey"
      parent: VAttribute
-     name: string
-     argument: string | null
-     modifiers: string[]
-     shorthand: boolean
+     name: VIdentifier
+     argument: VExpressionContainer | VIdentifier | null
+     modifiers: VIdentifier[]
  }
  • It changed the members name, argument, and modifiers to AST nodes from strings. Especially, argument will be a VExpressionContainer node if the directive has dynamic argument syntax.
  • It removed shorthand member. To check wheather the directive key is a shorthand or not, use name.rawName member.
    • :foo ... directiveKey.name.rawName is ":" (and directiveKey.name.name is "bind").
    • .foo ... directiveKey.name.rawName is "." (and directiveKey.name.name is "bind" and directiveKey.modifiers includes the identifier node of "prop").
    • @foo ... directiveKey.name.rawName is "@" (and directiveKey.name.name is "on").
    • #foo ... directiveKey.name.rawName is "#" (and directiveKey.name.name is "slot").

Commits

  • 0f241279dc412ff4bb0faa9211233a944465f9b4...3c356d974b4fb49f1f8371282707b40841abe4a7
vue-eslint-parser -

Published by mysticatea almost 6 years ago

πŸ’₯ Breaking changes

πŸ› Bug fixes

vue-eslint-parser -

Published by mysticatea almost 6 years ago

πŸ› Bug fixes

  • 309cf520952bd118b1e018700a2a16ce78b1a3c7 fixed a bug that it had constructed VFilterSequenceExpression nodes on the places filters are disallowed.
vue-eslint-parser -

Published by mysticatea almost 6 years ago

πŸ› Bug fixes

  • 595b9aea157888eb69459f985aa9c4b2e667ec41 fixed the bug that new nodes for Vue.js filters syntax can have wrong end location if there is a line break after a filter name.
vue-eslint-parser -

Published by mysticatea almost 6 years ago

πŸ› Bug fixes

  • 41cf26414fa3b740e72b6e52312a7e7fd0ac739b fixed wrong locations of new nodes for Vue.js filters syntax.
vue-eslint-parser -

Published by mysticatea almost 6 years ago

πŸ’₯ Breaking changes

vue-eslint-parser -

Published by mysticatea almost 6 years ago

✨ Enhancements

  • 04bf33b7f8a282534cc572f02f31812ea5a51fb7 made the parser throwing syntax errors on illegal slot-scope attributes.
vue-eslint-parser -

Published by mysticatea about 6 years ago

Chore

  • 40452394cd81da0503f7ed8bdeba76e364675888 separated a dynamic require() expression to two in order to make Webpack recognizable that it's depending on espree.
vue-eslint-parser -

Published by mysticatea about 6 years ago

Bug fixes

  • c0e91901be6b2fa8ba1de79174f0b06033eaf87e made the parser throwing syntax error on the top-level commas in v-bind directives (E.g., :foo="a,b"). It was parsed to SequenceExpression wrongly before.
vue-eslint-parser -

Published by mysticatea about 6 years ago

Enhancements

  • 9b947b11fac73ac5baac1fee35c19b47afb21f1c added the option parserOptions.parser:false to skip parsing <script> elements completely. This is useful for the language ESLint community don't provide that custom parser.

Bug fixes

  • 7de2b86dcb5740861a94b3c3b9a5e777f8ee7b28 fixed the list of void element names to be acording to WHATWG spec.
  • adbaf4b7a4651d0b3c7627e9aba74adf9c7c3d8c fixed the list of normal element names to be acording to WHATWG spec.
  • 7ded10486eed4ebc22a9c6524b89e1ceff98d1d7 fixed the parser to handle {{}} as a part of text rather than an empty mustache.
  • 6906fb16d099fe6c04a6f3adb1b48ac46a241e9c fixed the parser to allow empty mustaches.
vue-eslint-parser -

Published by mysticatea over 6 years ago

Bug fixes

  • fa73293541c1b3f0113438fa5765ecf407cffa20 fixed the bug that vue-eslint-parser parsed the v-on directive with no argument and an object expression (e.g., v-on="{foo: bar}") to a block statement. (#30)
vue-eslint-parser -

Published by mysticatea over 6 years ago

Enhancements

  • f6f42bb075cf186cdc19e3b55469a0c6c95f7257 allows the xmlns attribute on <template> elements in order to define custom elements which are a part of SVG/MathML.
vue-eslint-parser -

Published by mysticatea over 6 years ago

Breaking changes

  • c83140fea45537fc16beb50a2bb210afd4ce4911 dropped the support of Node.js 4.x.
  • 4e2cd771dcf011b040eeccf7a748f40aba001201 dropped the support of ESLint 3.x and 4.x. And it upgraded espree and eslint-scope packages, vue-eslint-parser is using internally, to 4.0.0. This means it dropped the support of parserOptions.ecmaFeatures.experimentalObjectRestSpread option. Use ecmaVersion option instead.
  • 87efc6d22d03a3e56c0e8097b33d826b69a35e29 added the support of slot-scope attribute to define variables which are available on inside of the element. The slot-scope attribute is expressed as new VSlotScopeExpression node. And it changed the AST of <template scope> attribute to the VSlotScopeExpression node.
vue-eslint-parser -

Published by mysticatea over 6 years ago

Bug fixes

  • f115c263200479f617de7c311712972c33173a58 fixed to allow empty directive values.
vue-eslint-parser -

Published by mysticatea almost 7 years ago

Bug fixes

  • 812fd21a596e590eeade692298292e4b3ce950b0 fixed a bug that context.parserServices.defineTemplateBodyVisitor() doesn't work if AST object was reused.
vue-eslint-parser -

Published by mysticatea almost 7 years ago

vue-eslint-parser has been rewritten completely!

Now vue-eslint-parser gets the ability to parse <template> (only HTML) in .vue files to AST.

  • New parserServices:
    • defineTemplateBodyVisitor(templateVisitor, scriptVisitor) ... returns ESLint visitor to traverse <template>.
    • getTemplateBodyTokenStore() ... returns ESLint TokenStore to get the tokens of <template>.
  • ast.md is <template> AST specification.
  • mustache-interpolation-spacing.js is an example.
vue-eslint-parser -

Published by mysticatea over 7 years ago

This is experimental version.

Features

  • vue-eslint-parser parses <template> of single file components.
    • Plugin rules can traverse the AST of <template>.
    • Plugin rules can get tokens of the AST to check styles.
    • Plugin rules can get external references in expressions of directives to check typo or something like.
vue-eslint-parser -

Published by mysticatea almost 8 years ago

No change. It gets stable.

vue-eslint-parser -

Published by mysticatea almost 8 years ago

Breaking changes

  • 5766096687a0b1420b1f0780d1970c13e9044351 changed the minimum ESLint version vue-eslint-parser supports. It requires 3.9.0 or later.
    The reason is that vue-eslint-parser needs parserServices feature to release the capabilities to access ASTs of <template> in future.

If no problem, I will release 1.0.0 with this version after a few day.