8000 update docs and fix typings · vuejs/eslint-plugin-vue@96425c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96425c6

Browse files
committed
update docs and fix typings
1 parent 110b236 commit 96425c6

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

docs/rules/new-line-between-multi-line-property.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ description: enforce new lines between multi-line properties in Vue components
1313

1414
This rule aims at enforcing new lines between multi-line properties in Vue components to help readability
1515

16-
Examples of **incorrect** code for this rule:
17-
1816
<eslint-code-block fix :rules="{'vue/new-line-between-multi-line-property': ['error']}">
1917

2018
```vue
2119
<script>
20+
/* ✗ BAD */
2221
export default {
2322
props: {
2423
value: {
@@ -43,13 +42,11 @@ export default {
4342

4443
</eslint-code-block>
4544

46-
47-
Examples of **correct** code for this rule:
48-
4945
<eslint-code-block fix :rules="{'vue/new-line-between-multi-line-property': ['error']}">
5046

5147
```vue
5248
<script>
49+
/* ✓ GOOD */
5350
export default {
5451
props: {
5552
value: {
@@ -77,16 +74,21 @@ export default {
7774
</eslint-code-block>
7875

7976
## :wrench: Option
77+
8078
```json
8179
{
8280
"vue/new-line-between-multiline-property": ["error", {
8381
"minLineOfMultilineProperty": 2
8482
}]
8583
}
8684
```
87-
- `minLineOfMultilineProperty` ... `type: number`, Define the minimum number of rows for a multi-line property .`type:` number, `default:` 2 , `min:`: 2
85+
86+
- `minLineOfMultilineProperty` ... Define the minimum number of rows for a multi-line property. default `2`
87+
8888
## :books: Further Reading
89-
Nothing here
89+
90+
- [Style guide - Empty lines in component/instance options](https://v3.vuejs.org/style-guide/#empty-lines-in-component-instance-options-recommended)
91+
9092
## :mag: Implementation
9193

9294
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/new-line-between-multi-line-property.js)

lib/rules/new-line-between-multi-line-property.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const utils = require('../utils')
88
// ------------------------------------------------------------------------------
99
// Rule Definition
1010
// ------------------------------------------------------------------------------
11-
// @ts-ignore
1211
module.exports = {
1312
meta: {
1413
type: 'layout',
@@ -48,7 +47,7 @@ module.exports = {
4847
minLineOfMultilineProperty = context.options[0].minLineOfMultilineProperty
4948
}
5049

51-
/** @type {any[]} */
50+
/** @type {CallExpression[]} */
5251
const callStack = []
5352
const sourceCode = context.getSourceCode()
5453
return Object.assign(
@@ -92,7 +91,6 @@ module.exports = {
9291
loc: pre.loc,
9392
message:
9493
'Enforce new lines between multi-line properties in Vue components.',
95-
// @ts-ignore
9694
fix(fixer) {
9795
let firstPositionOfLine = cur.range[0] - cur.loc.start.column
9896
if (leadingComments.length) {

lib/rules/no-restricted-custom-event.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const regexp = require('../utils/regexp')
1919
/**
2020
* @typedef {object} ParsedOption
2121
* @property { (name: string) => boolean } test
22-
* @property {string} [message]
23-
* @property {string} [suggest]
22+
* @property {string|undefined} [message]
23+
* @property {string|undefined} [suggest]
2424
*/
2525

2626
/**

lib/rules/no-restricted-props.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const regexp = require('../utils/regexp')
1010
/**
1111
* @typedef {object} ParsedOption
1212
* @property { (name: string) => boolean } test
13-
* @property {string} [message]
14-
* @property {string} [suggest]
13+
* @property {string|undefined} [message]
14+
* @property {string|undefined} [suggest]
1515
*/
1616

1717
/**

0 commit comments

Comments
 (0)
0