eslint-plugin-crisp 1.4.11 → 1.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/package.json +1 -1
- package/recommended-vue.js +5 -0
- package/rules/vue-data-comment.js +4 -4
package/README.md
CHANGED
|
@@ -90,6 +90,7 @@ Each item has emojis denoting:
|
|
|
90
90
|
| [no-multiple-empty-lines](https://eslint.org/docs/latest/rules/no-multiple-empty-lines) | Allows a maximum of 1 consecutive empty lines | | 🟢 | 🟣 |
|
|
91
91
|
| [no-mixed-spaces-and-tabs](https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs) | Disallows mixed spaces and tabs for indentation | 🟠 | 🟢 | 🟣 |
|
|
92
92
|
| [no-restricted-syntax](https://eslint.org/docs/latest/rules/no-restricted-syntax) | Enforces `switch` `case`'s content to be enclosed in braces | | 🟢 | 🟣 |
|
|
93
|
+
| [no-restricted-syntax](https://eslint.org/docs/latest/rules/no-restricted-syntax) | Enforces `watch` watchers to use the object form with a `handler` function | | 🟢 | |
|
|
93
94
|
| [no-tabs](https://eslint.org/docs/latest/rules/no-tabs) | Disallows tabs | 🟠 | 🟢 | 🟣 |
|
|
94
95
|
| [no-trailing-spaces](https://eslint.org/docs/latest/rules/no-trailing-spaces) | Disallows trailing whitespace at the end of lines | 🟠 | 🟢 | 🟣 |
|
|
95
96
|
| [no-undef](https://eslint.org/docs/latest/rules/no-undef) | Disallows use of undeclared variables | 🟠 | 🟢 | 🟣 |
|
package/package.json
CHANGED
package/recommended-vue.js
CHANGED
|
@@ -111,6 +111,11 @@ export default function configRecommendedVue(pluginCrisp) {
|
|
|
111
111
|
{
|
|
112
112
|
"selector": "SwitchCase > *.consequent[type!='BlockStatement']",
|
|
113
113
|
"message": "Switch cases without braces are disallowed."
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
{
|
|
117
|
+
"selector": "Property[key.name='watch'] > ObjectExpression > Property[value.type='FunctionExpression']",
|
|
118
|
+
"message": "Watchers must use the object form with a `handler` function."
|
|
114
119
|
}
|
|
115
120
|
],
|
|
116
121
|
"no-tabs": "error",
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
},
|
|
12
12
|
|
|
13
13
|
create(context) {
|
|
14
|
-
const COMMENT_PATTERN = /^--> (STATE|DATA|ROUTE PARAMS|COMPONENTS) <--$/;
|
|
14
|
+
const COMMENT_PATTERN = /^--> (STATE|DATA|ROUTE PARAMS|ROUTE QUERY|COMPONENTS) <--$/;
|
|
15
15
|
const COMMENT_LIKE_PATTERN = /^--> .+ <--$/;
|
|
16
16
|
|
|
17
17
|
return {
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
message:
|
|
32
32
|
"data() return object must start with a comment: " +
|
|
33
33
|
"'// --> STATE <--', '// --> DATA <--', " +
|
|
34
|
-
"'// --> ROUTE PARAMS <--', or '// --> COMPONENTS <--'."
|
|
34
|
+
"'// --> ROUTE PARAMS <--', '// --> ROUTE QUERY <--', or '// --> COMPONENTS <--'."
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
return;
|
|
@@ -48,7 +48,7 @@ export default {
|
|
|
48
48
|
message:
|
|
49
49
|
"data() return object must start with a comment: " +
|
|
50
50
|
"'// --> STATE <--', '// --> DATA <--', " +
|
|
51
|
-
"'// --> ROUTE PARAMS <--', or '// --> COMPONENTS <--'."
|
|
51
|
+
"'// --> ROUTE PARAMS <--', '// --> ROUTE QUERY <--', or '// --> COMPONENTS <--'."
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -65,7 +65,7 @@ export default {
|
|
|
65
65
|
message:
|
|
66
66
|
"Invalid comment. Must be '// --> STATE <--', " +
|
|
67
67
|
"'// --> DATA <--', '// --> ROUTE PARAMS <--', " +
|
|
68
|
-
"or '// --> COMPONENTS <--'."
|
|
68
|
+
"'// --> ROUTE QUERY <--', or '// --> COMPONENTS <--'."
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
}
|