Skip to content

Commit 13c3f9a

Browse files
author
barthy
committed
implemented requested changes
1 parent af7d4e6 commit 13c3f9a

6 files changed

+21
-23
lines changed

docs/rules/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ For example:
313313
| [vue/component-name-in-template-casing](./component-name-in-template-casing.md) | enforce specific casing for the component naming style in template | :wrench: |
314314
| [vue/component-options-name-casing](./component-options-name-casing.md) | enforce the casing of component name in `components` options | :wrench::bulb: |
315315
| [vue/custom-event-name-casing](./custom-event-name-casing.md) | enforce specific casing for custom event name | |
316-
| [vue/empty-line-between-options](./empty-line-between-options.md) | enforce empty lines between top-level options | :wrench: |
317316
| [vue/html-button-has-type](./html-button-has-type.md) | disallow usage of button without an explicit type attribute | |
318317
| [vue/html-comment-content-newline](./html-comment-content-newline.md) | enforce unified line brake in HTML comments | :wrench: |
319318
| [vue/html-comment-content-spacing](./html-comment-content-spacing.md) | enforce unified spacing in HTML comments | :wrench: |
@@ -353,6 +352,7 @@ For example:
353352
| [vue/no-v-text-v-html-on-component](./no-v-text-v-html-on-component.md) | disallow v-text / v-html on component | |
354353
| [vue/no-v-text](./no-v-text.md) | disallow use of v-text | |
355354
| [vue/padding-line-between-blocks](./padding-line-between-blocks.md) | require or disallow padding lines between blocks | :wrench: |
355+
| [vue/padding-line-between-component-options](./padding-line-between-component-options.md) | require or disallow padding lines between top-level component options | :wrench: |
356356
| [vue/prefer-import-from-vue](./prefer-import-from-vue.md) | enforce import from 'vue' instead of import from '@vue/*' | :wrench: |
357357
| [vue/prefer-separate-static-class](./prefer-separate-static-class.md) | require static class names in template to be in a separate `class` attribute | :wrench: |
358358
| [vue/prefer-true-attribute-shorthand](./prefer-true-attribute-shorthand.md) | require shorthand form attribute when `v-bind` value is `true` | :bulb: |

docs/rules/empty-line-between-options.md renamed to docs/rules/padding-line-between-component-options.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
pageClass: rule-details
33
sidebarDepth: 0
4-
title: vue/empty-line-between-options
5-
description: enforce empty lines between top-level options
4+
title: vue/padding-line-between-component-options
5+
description: require or disallow padding lines between top-level component options
66
---
7-
# vue/empty-line-between-options
7+
# vue/padding-line-between-component-options
88

9-
> enforce empty lines between top-level options
9+
> require or disallow padding lines between top-level component options
1010
1111
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> ***This rule has not been released yet.*** </badge>
1212
- :wrench: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
@@ -15,7 +15,7 @@ description: enforce empty lines between top-level options
1515

1616
This rule enforces consistent format of empty lines between Vue component options by either adding or removing them.
1717

18-
<eslint-code-block fix :rules="{'vue/empty-line-between-options': ['error', 'always']}">
18+
<eslint-code-block fix :rules="{'vue/padding-line-between-component-options': ['error', 'always']}">
1919

2020
```vue
2121
<script>
@@ -59,7 +59,7 @@ This rule enforces consistent format of empty lines between Vue component option
5959

6060
</eslint-code-block>
6161

62-
<eslint-code-block fix :rules="{'vue/empty-line-between-options': ['error', 'never']}">
62+
<eslint-code-block fix :rules="{'vue/padding-line-between-component-options': ['error', 'never']}">
6363

6464
```vue
6565
<script>
@@ -103,19 +103,22 @@ This rule enforces consistent format of empty lines between Vue component option
103103

104104
</eslint-code-block>
105105

106-
107106
## :wrench: Options
108107

109108
```json
110109
{
111-
"vue/empty-line-between-options": ["error", "always" | "never"]
110+
"vue/padding-line-between-component-options": ["error", "always" | "never"]
112111
}
113112
```
114113

115114
- `"always"` (default) ... add an empty line between options.
116115
- `"never"` ... remove empty lines between options.
117116

117+
## :couple: Related Rules
118+
119+
- [vue/padding-line-between-blocks](./padding-line-between-blocks.md)
120+
118121
## :mag: Implementation
119122

120-
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/empty-line-between-options.js)
121-
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/empty-line-between-options.js)
123+
- [Rule source](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/padding-line-between-component-options.js)
124+
- [Test source](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/padding-line-between-component-options.js)

lib/configs/no-layout-rules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module.exports = {
1515
'vue/comma-spacing': 'off',
1616
'vue/comma-style': 'off',
1717
'vue/dot-location': 'off',
18-
'vue/empty-line-between-options': 'off',
1918
'vue/first-attribute-linebreak': 'off',
2019
'vue/func-call-spacing': 'off',
2120
'vue/html-closing-bracket-newline': 'off',
@@ -41,6 +40,7 @@ module.exports = {
4140
'vue/object-property-newline': 'off',
4241
'vue/operator-linebreak': 'off',
4342
'vue/padding-line-between-blocks': 'off',
43+
'vue/padding-line-between-component-options': 'off',
4444
'vue/script-indent': 'off',
4545
'vue/singleline-html-element-content-newline': 'off',
4646
'vue/space-in-parens': 'off',

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ module.exports = {
2929
'custom-event-name-casing': require('./rules/custom-event-name-casing'),
3030
'dot-location': require('./rules/dot-location'),
3131
'dot-notation': require('./rules/dot-notation'),
32-
'empty-line-between-options': require('./rules/empty-line-between-options'),
3332
eqeqeq: require('./rules/eqeqeq'),
3433
'experimental-script-setup-vars': require('./rules/experimental-script-setup-vars'),
3534
'first-attribute-linebreak': require('./rules/first-attribute-linebreak'),
@@ -158,6 +157,7 @@ module.exports = {
158157
'operator-linebreak': require('./rules/operator-linebreak'),
159158
'order-in-components': require('./rules/order-in-components'),
160159
'padding-line-between-blocks': require('./rules/padding-line-between-blocks'),
160+
'padding-line-between-component-options': require('./rules/padding-line-between-component-options'),
161161
'prefer-import-from-vue': require('./rules/prefer-import-from-vue'),
162162
'prefer-separate-static-class': require('./rules/prefer-separate-static-class'),
163163
'prefer-template': require('./rules/prefer-template'),

lib/rules/empty-line-between-options.js renamed to lib/rules/padding-line-between-component-options.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010

1111
const utils = require('../utils')
1212

13-
// ------------------------------------------------------------------------------
14-
// Helpers
15-
// ------------------------------------------------------------------------------
16-
17-
// ...
18-
1913
// ------------------------------------------------------------------------------
2014
// Rule Definition
2115
// ------------------------------------------------------------------------------
@@ -24,9 +18,10 @@ module.exports = {
2418
meta: {
2519
type: 'layout',
2620
docs: {
27-
description: 'enforce empty lines between top-level options',
21+
description:
22+
'require or disallow padding lines between top-level component options',
2823
categories: undefined,
29-
url: 'https://eslint.vuejs.org/rules/empty-line-between-options.html'
24+
url: 'https://eslint.vuejs.org/rules/padding-line-between-component-options.html'
3025
},
3126
fixable: 'whitespace',
3227
schema: [{ enum: ['always', 'never'] }],

tests/lib/rules/empty-line-between-options.js renamed to tests/lib/rules/padding-line-between-component-options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'use strict'
66

77
const RuleTester = require('eslint').RuleTester
8-
const rule = require('../../../lib/rules/empty-line-between-options')
8+
const rule = require('../../../lib/rules/padding-line-between-component-options')
99

1010
const tester = new RuleTester({
1111
parser: require.resolve('vue-eslint-parser'),
@@ -15,7 +15,7 @@ const tester = new RuleTester({
1515
}
1616
})
1717

18-
tester.run('empty-line-between-options', rule, {
18+
tester.run('padding-line-between-component-options', rule, {
1919
valid: [
2020
{
2121
filename: 'test.vue',

0 commit comments

Comments
 (0)