From d79ef1968d8600f25d49476def3c981a18e3531d Mon Sep 17 00:00:00 2001 From: Markus Oberlehner Date: Mon, 9 Oct 2017 18:56:43 +0200 Subject: [PATCH 1/3] Prevent trimming trailing whitespace in markdown files --- .editorconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.editorconfig b/.editorconfig index 9d08a1a82..4bd3bd8be 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,6 @@ indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false From 072933fbe1883ff883b2a961c5fc7d023d5926ce Mon Sep 17 00:00:00 2001 From: Markus Oberlehner Date: Mon, 9 Oct 2017 19:03:27 +0200 Subject: [PATCH 2/3] Use error code 2 instead of "error" consistently --- docs/rules/html-self-closing.md | 2 +- docs/rules/no-parsing-error.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rules/html-self-closing.md b/docs/rules/html-self-closing.md index 2a89d6732..760ebb0b1 100644 --- a/docs/rules/html-self-closing.md +++ b/docs/rules/html-self-closing.md @@ -16,7 +16,7 @@ This rule has options which specify self-closing style for each context. ```json { - "html-self-closing": ["error", { + "html-self-closing": [2, { "html": { "normal": "never", "void": "never", diff --git a/docs/rules/no-parsing-error.md b/docs/rules/no-parsing-error.md index 6770b5da1..ab6e7d029 100644 --- a/docs/rules/no-parsing-error.md +++ b/docs/rules/no-parsing-error.md @@ -37,7 +37,7 @@ Then reports syntax errors if exist. ```json { - "vue/no-parsing-error": ["error", { + "vue/no-parsing-error": [2, { "abrupt-closing-of-empty-comment": false, "absence-of-digits-in-numeric-character-reference": false, "cdata-in-html-content": false, From ff3d02f6f457523016a2e4a5eb2cf1238ef5a82f Mon Sep 17 00:00:00 2001 From: Markus Oberlehner Date: Mon, 9 Oct 2017 19:13:11 +0200 Subject: [PATCH 3/3] Use syntax highlighting in demos consistently --- README.md | 2 +- docs/rules/max-attributes-per-line.md | 3 +- docs/rules/no-dupe-keys.md | 10 +++--- docs/rules/no-reserved-keys.md | 12 ++++--- docs/rules/no-reservered-keys.md | 10 +++--- docs/rules/order-in-components.md | 40 ++++++++++++----------- docs/rules/return-in-computed-property.md | 10 +++--- 7 files changed, 48 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 303f0b341..d9576793d 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ If you want to check previous releases [go here](https://github.com/vuejs/eslint ## :cd: Installation -``` +```bash npm install --save-dev eslint eslint-plugin-vue@beta ``` diff --git a/docs/rules/max-attributes-per-line.md b/docs/rules/max-attributes-per-line.md index b125f425f..8920a766b 100644 --- a/docs/rules/max-attributes-per-line.md +++ b/docs/rules/max-attributes-per-line.md @@ -38,12 +38,11 @@ There is a configurable number of attributes that are acceptable in one-line cas sit="4" > - ``` ### :wrench: Options -``` +```json { "vue/max-attributes-per-line": [2, { "singleline": 3, diff --git a/docs/rules/no-dupe-keys.md b/docs/rules/no-dupe-keys.md index 983b45550..6f3bb547a 100644 --- a/docs/rules/no-dupe-keys.md +++ b/docs/rules/no-dupe-keys.md @@ -58,10 +58,12 @@ This rule has an object option: ### Example: -``` -vue/no-dupe-keys: [2, { - groups: ['asyncComputed'] -}] +```json +{ + "vue/no-dupe-keys": [2, { + "groups": ["asyncComputed"] + }] +} ``` :-1: Examples of **incorrect** code for this configuration diff --git a/docs/rules/no-reserved-keys.md b/docs/rules/no-reserved-keys.md index 32568d0ac..6bf480c15 100644 --- a/docs/rules/no-reserved-keys.md +++ b/docs/rules/no-reserved-keys.md @@ -37,11 +37,13 @@ This rule has an object option: ### Example: -``` -vue/no-reserved-keys: [2, { - reserved: ['foo', 'foo2'], - groups: ['asyncComputed'] -}] +```json +{ + "vue/no-reserved-keys": [2, { + "reserved": ["foo", "foo2"], + "groups": ["asyncComputed"] + }] +} ``` :-1: Examples of **incorrect** code for this configuration diff --git a/docs/rules/no-reservered-keys.md b/docs/rules/no-reservered-keys.md index 3439907a0..838a5669f 100644 --- a/docs/rules/no-reservered-keys.md +++ b/docs/rules/no-reservered-keys.md @@ -39,10 +39,12 @@ This rule has an object option: ### Example: -``` -vue/no-dupe-keys: [2, { - reserved: ['foo'] -}] +```json +{ + "vue/no-dupe-keys": [2, { + "reserved": ["foo"] + }] +} ``` :-1: Examples of **incorrect** code for this configuration diff --git a/docs/rules/order-in-components.md b/docs/rules/order-in-components.md index d246eb1b0..97032823c 100644 --- a/docs/rules/order-in-components.md +++ b/docs/rules/order-in-components.md @@ -63,25 +63,27 @@ export default { If you want you can change the order providing the optional configuration in your `.eslintrc` file. Setting responsible for the above order looks like this: -``` -vue/order-in-components: [2, { - order: [ - ['name', 'delimiters', 'functional', 'model'], - ['components', 'directives', 'filters'], - ['parent', 'mixins', 'extends', 'provide', 'inject'], - 'el', - 'template', - 'props', - 'propsData', - 'data', - 'computed', - 'watch', - 'LIFECYCLE_HOOKS', - 'methods', - 'render', - 'renderError' - ] -}] +```json +{ + "vue/order-in-components": [2, { + "order": [ + ["name", "delimiters", "functional", "model"], + ["components", "directives", "filters"], + ["parent", "mixins", "extends", "provide", "inject"], + "el", + "template", + "props", + "propsData", + "data", + "computed", + "watch", + "LIFECYCLE_HOOKS", + "methods", + "render", + "renderError" + ] + }] +} ``` If you want some of properties to be treated equally in order you can group them into arrays, like we did with `name`, `delimiters`, `funcitonal` and `model`. diff --git a/docs/rules/return-in-computed-property.md b/docs/rules/return-in-computed-property.md index f4e20fcab..83c1adae1 100644 --- a/docs/rules/return-in-computed-property.md +++ b/docs/rules/return-in-computed-property.md @@ -37,8 +37,10 @@ export default { This rule has an object option: - `"treatUndefinedAsUnspecified"`: `true` (default) disallows implicitly returning undefined with a `return;` statement. -``` -vue/return-in-computed-property: [2, { - treatUndefinedAsUnspecified: true -}] +```json +{ + "vue/return-in-computed-property": [2, { + "treatUndefinedAsUnspecified": true + }] +} ```