summaryrefslogtreecommitdiff
path: root/tools/eslint/lib/rules/default-case.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/lib/rules/default-case.js')
-rw-r--r--tools/eslint/lib/rules/default-case.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/eslint/lib/rules/default-case.js b/tools/eslint/lib/rules/default-case.js
index e8a748401e..6bcc791238 100644
--- a/tools/eslint/lib/rules/default-case.js
+++ b/tools/eslint/lib/rules/default-case.js
@@ -34,8 +34,11 @@ module.exports = function(context) {
"SwitchStatement": function(node) {
if (!node.cases.length) {
- // skip check of empty switch because there is no easy way
- // to extract comments inside it now
+
+ /*
+ * skip check of empty switch because there is no easy way
+ * to extract comments inside it now
+ */
return;
}
@@ -49,6 +52,7 @@ module.exports = function(context) {
var comments;
var lastCase = last(node.cases);
+
comments = context.getComments(lastCase).trailing;
if (comments.length) {