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

Upgrade vue-eslint-parser to 7.1.1 and fixed CRLF issues. #1332

Merged
merged 2 commits into from Oct 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -40,7 +40,7 @@ Since single file components in Vue are not plain JavaScript, the default parser

To know more about certain nodes in produced ASTs, go here:
- [ESTree docs](https://github.com/estree/estree)
- [vue-eslint-parser AST docs](https://github.com/mysticatea/vue-eslint-parser/blob/master/docs/ast.md)
- [vue-eslint-parser AST docs](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md)

The `vue-eslint-parser` provides a few useful parser services that help traverse the produced AST and access tokens of the template:
- `context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)`
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/README.md
Expand Up @@ -39,7 +39,7 @@ Since single file components in Vue are not plain JavaScript, we can't use the d

To know more about certain nodes in produced ASTs, go here:
- [ESTree docs](https://github.com/estree/estree)
- [vue-eslint-parser AST docs](https://github.com/mysticatea/vue-eslint-parser/blob/master/docs/ast.md)
- [vue-eslint-parser AST docs](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md)

The `vue-eslint-parser` provides few useful parser services, to help traverse the produced AST and access tokens of the template:
- `context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)`
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/html-indent.md
Expand Up @@ -82,7 +82,7 @@ This rule enforces a consistent indentation style in `<template>`. The default s
- `closeBracket.endTag` (`integer`) ... The multiplier of indentation for right brackets of end tags (`</div>`). Default is `0`.
- `closeBracket.selfClosingTag` (`integer`) ... The multiplier of indentation for right brackets of start tags (`<div/>`). Default is `0`.
- `alignAttributesVertically` (`boolean`) ... Condition for whether attributes should be vertically aligned to the first attribute in multiline case or not. Default is `true`
- `ignores` (`string[]`) ... The selector to ignore nodes. The AST spec is [here](https://github.com/mysticatea/vue-eslint-parser/blob/master/docs/ast.md). You can use [esquery](https://github.com/estools/esquery#readme) to select nodes. Default is an empty array.
- `ignores` (`string[]`) ... The selector to ignore nodes. The AST spec is [here](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md). You can use [esquery](https://github.com/estools/esquery#readme) to select nodes. Default is an empty array.

### `2, {"attribute": 1, "closeBracket": 1}`

Expand Down
4 changes: 2 additions & 2 deletions docs/rules/no-restricted-syntax.md
Expand Up @@ -46,8 +46,8 @@ Forbids call expressions inside mustache interpolation.

[no-restricted-syntax]: https://eslint.org/docs/rules/no-restricted-syntax
[ESTree]: https://github.com/estree/estree
[vue-eslint-parser]: https://github.com/mysticatea/vue-eslint-parser
[vue-eslint-parser - AST docs]: https://github.com/mysticatea/vue-eslint-parser/blob/master/docs/ast.md
[vue-eslint-parser]: https://github.com/vuejs/vue-eslint-parser
[vue-eslint-parser - AST docs]: https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md

## :mag: Implementation

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/script-indent.md
Expand Up @@ -59,7 +59,7 @@ This rule has some options.
- `TYPE` (`number | "tab"`) ... The type of indentation. Default is `2`. If this is a number, it's the number of spaces for one indent. If this is `"tab"`, it uses one tab for one indent.
- `baseIndent` (`integer`) ... The multiplier of indentation for top-level statements. Default is `0`.
- `switchCase` (`integer`) ... The multiplier of indentation for `case`/`default` clauses. Default is `0`.
- `ignores` (`string[]`) ... The selector to ignore nodes. The AST spec is [here](https://github.com/mysticatea/vue-eslint-parser/blob/master/docs/ast.md). You can use [esquery](https://github.com/estools/esquery#readme) to select nodes. Default is an empty array.
- `ignores` (`string[]`) ... The selector to ignore nodes. The AST spec is [here](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md). You can use [esquery](https://github.com/estools/esquery#readme) to select nodes. Default is an empty array.

::: warning Note
This rule only checks `.vue` files and does not interfere with other `.js` files. Unfortunately the default `indent` rule when turned on will try to lint both, so in order to make them complementary you can use `overrides` setting and disable `indent` rule on `.vue` files:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -56,7 +56,7 @@
"eslint-utils": "^2.1.0",
"natural-compare": "^1.4.0",
"semver": "^7.3.2",
"vue-eslint-parser": "^7.1.0"
"vue-eslint-parser": "^7.1.1"
},
"devDependencies": {
"@types/eslint": "^7.2.0",
Expand Down
11 changes: 10 additions & 1 deletion tests/lib/rules/v-on-function-call.js
Expand Up @@ -117,7 +117,7 @@ tester.run('v-on-function-call', rule, {
{
filename: 'test.vue',
code: '<template><div @click="foo"></div></template>',
output: `<template><div @click="foo"></div></template>`,
output: null,
errors: [
"Method calls inside of 'v-on' directives must have parentheses."
],
Expand Down Expand Up @@ -246,6 +246,15 @@ tester.run('v-on-function-call', rule, {
"Method calls without arguments inside of 'v-on' directives must not have parentheses."
],
options: ['never']
},
{
filename: 'test.vue',
code: '<template>\r\n<div\r\n@click="foo()" /></template>',
output: '<template>\r\n<div\r\n@click="foo" /></template>',
errors: [
"Method calls without arguments inside of 'v-on' directives must not have parentheses."
],
options: ['never']
}
]
})
2 changes: 1 addition & 1 deletion typings/eslint-plugin-vue/util-types/ast/v-ast.ts
@@ -1,5 +1,5 @@
/**
* @see https://github.com/mysticatea/vue-eslint-parser/blob/master/docs/ast.md
* @see https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md
*/
import { HasParentNode, BaseNode } from '../node'
import { Token, HTMLComment, HTMLBogusComment, Comment } from '../node'
Expand Down