forked from vuejs/eslint-plugin-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 47-props-per-line
* master: Add rule `vue/require-valid-default-prop`. (vuejs#119) 3.10.0 Update readme to 3.10.0 Chore: remove package-lock.json (vuejs#128) Fix: parserService must exist always (fixes vuejs#125) (vuejs#127) Add rule `require-render-return`. (vuejs#114) 3.9.0 Update package-lock Update: options for `no-duplicate-attributes` (fixes vuejs#112)(vuejs#113) New: add rule `attribute-hyphenation`. (fixes vuejs#92)(vuejs#95) Add namespace check of svg & mathML instead of tag names (vuejs#120)⚠️ Add support for deprecated state in update-rules⚠️ (vuejs#121) Add rules: `no-dupe-keys` and `no-reserved-keys`. (vuejs#88) Chore: Improve tests for name-property-casing & improve documentation (vuejs#115) New: add `require-prop-types` rule (fixes vuejs#19)(vuejs#85) Update: upgrade vue-eslint-parser (fixes vuejs#36, fixes vuejs#56, fixes vuejs#96) (vuejs#116)
- Loading branch information
Showing
66 changed files
with
3,115 additions
and
2,375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
node_modules | ||
lib/recommended-rules.js | ||
coverage | ||
.nyc_output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Define if attributes on cusom components can be hyphened. (attribute-hyphenation) | ||
|
||
## :wrench: Options | ||
|
||
Default casing is set to `always` | ||
|
||
``` | ||
'vue/attribute-hyphenation': [2, 'always'|'never'] | ||
``` | ||
|
||
### `"always"` - Use hyphenated name. (It errors on upper case letters.) | ||
|
||
:+1: Examples of **correct** code`: | ||
|
||
```html | ||
<template> | ||
<foo my-prop="prop"> | ||
<a onClick="return false"></a> | ||
</foo> | ||
</template> | ||
``` | ||
|
||
:-1: Examples of **incorrect** code`: | ||
|
||
```html | ||
<template> | ||
<foo myProp="prop"> | ||
<a onClick="return false"></a> | ||
</foo> | ||
</template> | ||
``` | ||
|
||
### `"never"` - Don't use hyphenated name. (It errors on hyphens except `data-` and `aria-`.) | ||
|
||
:+1: Examples of **correct** code`: | ||
|
||
```html | ||
<template> | ||
<foo myProp="prop"> | ||
<a onClick="return false"></a> | ||
</foo> | ||
</template> | ||
``` | ||
|
||
:-1: Examples of **incorrect** code`: | ||
|
||
```html | ||
<template> | ||
<foo my-prop="prop"> | ||
<a onClick="return false"></a> | ||
</foo> | ||
</template> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Prevents duplication of field names (no-dupe-keys) | ||
|
||
This rule prevents to use duplicated names. | ||
|
||
## :book: Rule Details | ||
|
||
This rule is aimed at preventing duplicated property names. | ||
|
||
:-1: Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
export default { | ||
props: { | ||
foo: String | ||
}, | ||
computed: { | ||
foo: { | ||
get () { | ||
} | ||
} | ||
}, | ||
data: { | ||
foo: null | ||
}, | ||
methods: { | ||
foo () { | ||
} | ||
} | ||
} | ||
``` | ||
|
||
:+1: Examples of **correct** code for this rule: | ||
|
||
```js | ||
export default { | ||
props: ['foo'], | ||
computed: { | ||
bar () { | ||
} | ||
}, | ||
data () { | ||
return { | ||
dat: null | ||
} | ||
}, | ||
methods: { | ||
test () { | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## :wrench: Options | ||
|
||
This rule has an object option: | ||
|
||
`"groups"`: [] (default) array of additional groups to search for duplicates. | ||
|
||
### Example: | ||
|
||
``` | ||
vue/no-dupe-keys: [2, { | ||
groups: ['asyncComputed'] | ||
}] | ||
``` | ||
|
||
:-1: Examples of **incorrect** code for this configuration | ||
|
||
```js | ||
export default { | ||
computed: { | ||
foo () {} | ||
}, | ||
asyncComputed: { | ||
foo () {} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Prevent overwrite reserved keys (no-reservered-keys) | ||
|
||
This rule prevents to use reserved names from to avoid conflicts and unexpected behavior. | ||
|
||
## Rule Details | ||
|
||
:-1: Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
export default { | ||
props: { | ||
$el: String | ||
}, | ||
computed: { | ||
$on: { | ||
get () { | ||
} | ||
} | ||
}, | ||
data: { | ||
_foo: null | ||
}, | ||
methods: { | ||
$nextTick () { | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## :wrench: Options | ||
|
||
This rule has an object option: | ||
|
||
`"reserved"`: [] (default) array of dissalowed names inside `groups`. | ||
|
||
`"groups"`: [] (default) array of additional groups to search for duplicates. | ||
|
||
### Example: | ||
|
||
``` | ||
vue/no-dupe-keys: [2, { | ||
reserved: ['foo'] | ||
}] | ||
``` | ||
|
||
:-1: Examples of **incorrect** code for this configuration | ||
|
||
```js | ||
export default { | ||
computed: { | ||
foo () {} | ||
} | ||
} | ||
``` |
Oops, something went wrong.