File tree Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Expand file tree Collapse file tree 5 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ For example:
237
237
| [ vue/no-empty-component-block] | disallow the ` <template> ` ` <script> ` ` <style> ` block to be empty | :wrench : | :hammer : |
238
238
| [ vue/no-import-compiler-macros] | disallow importing Vue compiler macros | :wrench : | :warning : |
239
239
| [ vue/no-multiple-objects-in-class] | disallow passing multiple objects in an array to class | | :hammer : |
240
- | [ vue/no-negated-condition] | disallow negated conditions in v-if/v-else | | :hammer : |
240
+ | [ vue/no-negated-v-if- condition] | disallow negated conditions in v-if/v-else | | :hammer : |
241
241
| [ vue/no-potential-component-option-typo] | disallow a potential typo in your component property | :bulb : | :hammer : |
242
242
| [ vue/no-ref-object-reactivity-loss] | disallow usages of ref objects that can lead to loss of reactivity | | :warning : |
243
243
| [ vue/no-restricted-block] | disallow specific block | | :hammer : |
@@ -483,7 +483,7 @@ The following rules extend the rules provided by ESLint itself and apply them to
483
483
[ vue/no-multiple-slot-args ] : ./no-multiple-slot-args.md
484
484
[ vue/no-multiple-template-root ] : ./no-multiple-template-root.md
485
485
[ vue/no-mutating-props ] : ./no-mutating-props.md
486
- [ vue/no-negated-condition ] : ./no-negated-condition.md
486
+ [ vue/no-negated-v-if- condition ] : ./no-negated-v-if -condition.md
487
487
[ vue/no-parsing-error ] : ./no-parsing-error.md
488
488
[ vue/no-potential-component-option-typo ] : ./no-potential-component-option-typo.md
489
489
[ vue/no-ref-as-operand ] : ./no-ref-as-operand.md
Original file line number Diff line number Diff line change 1
1
---
2
2
pageClass : rule-details
3
3
sidebarDepth : 0
4
- title : vue/no-negated-condition
4
+ title : vue/no-negated-v-if- condition
5
5
description : disallow negated conditions in v-if/v-else
6
6
---
7
7
8
- # vue/no-negated-condition
8
+ # vue/no-negated-v-if- condition
9
9
10
10
> disallow negated conditions in v-if/v-else
11
11
@@ -17,7 +17,7 @@ This rule disallows negated conditions in `v-if` and `v-else-if` directives whic
17
17
18
18
Negated conditions make the code less readable. When there's an ` else ` clause, it's better to use a positive condition and switch the branches.
19
19
20
- <eslint-code-block :rules =" {'vue/no-negated-condition': ['error']} " >
20
+ <eslint-code-block :rules =" {'vue/no-negated-v-if- condition': ['error']} " >
21
21
22
22
``` vue
23
23
<template>
@@ -53,9 +53,9 @@ Nothing.
53
53
54
54
## :couple : Related Rules
55
55
56
- - [ no-negated-condition] ( https://eslint.org/docs/rules/no-negated-condition )
56
+ - [ no-negated-v-if- condition] ( https://eslint.org/docs/rules/no-negated-v-if -condition )
57
57
58
58
## :mag : Implementation
59
59
60
- - [ Rule source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/no-negated-condition.js )
61
- - [ Test source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/no-negated-condition.js )
60
+ - [ Rule source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/no-negated-v-if- condition.js )
61
+ - [ Test source] ( https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/no-negated-v-if- condition.js )
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ const plugin = {
141
141
'no-multiple-slot-args' : require ( './rules/no-multiple-slot-args' ) ,
142
142
'no-multiple-template-root' : require ( './rules/no-multiple-template-root' ) ,
143
143
'no-mutating-props' : require ( './rules/no-mutating-props' ) ,
144
- 'no-negated-condition' : require ( './rules/no-negated-condition' ) ,
144
+ 'no-negated-v-if- condition' : require ( './rules/no-negated-v-if -condition' ) ,
145
145
'no-parsing-error' : require ( './rules/no-parsing-error' ) ,
146
146
'no-potential-component-option-typo' : require ( './rules/no-potential-component-option-typo' ) ,
147
147
'no-ref-as-operand' : require ( './rules/no-ref-as-operand' ) ,
Original file line number Diff line number Diff line change 1
1
/**
2
- * @author Wayne
2
+ * @author Wayne Zhang
3
3
* See LICENSE file in root directory for full license.
4
4
*/
5
5
'use strict'
@@ -75,7 +75,7 @@ module.exports = {
75
75
docs : {
76
76
description : 'disallow negated conditions in v-if/v-else' ,
77
77
categories : undefined ,
78
- url : 'https://eslint.vuejs.org/rules/no-negated-condition.html'
78
+ url : 'https://eslint.vuejs.org/rules/no-negated-v-if- condition.html'
79
79
} ,
80
80
fixable : null ,
81
81
schema : [ ] ,
Original file line number Diff line number Diff line change 1
1
/**
2
- * @author Wayne
2
+ * @author Wayne Zhang
3
3
* See LICENSE file in root directory for full license.
4
4
*/
5
5
'use strict'
6
6
7
7
const RuleTester = require ( '../../eslint-compat' ) . RuleTester
8
- const rule = require ( '../../../lib/rules/no-negated-condition' )
8
+ const rule = require ( '../../../lib/rules/no-negated-v-if- condition' )
9
9
10
10
const tester = new RuleTester ( {
11
11
languageOptions : {
@@ -15,7 +15,7 @@ const tester = new RuleTester({
15
15
}
16
16
} )
17
17
18
- tester . run ( 'no-negated-condition' , rule , {
18
+ tester . run ( 'no-negated-v-if- condition' , rule , {
19
19
valid : [
20
20
{
21
21
filename : 'test.vue' ,
You can’t perform that action at this time.
0 commit comments