Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit bb1f2e9

Browse files
committed
validateIndentation: ensure semicolon free indentations are on correct line
Fixes #964
1 parent 990e9bc commit bb1f2e9

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"cli-table": "~0.3.1",
6464
"colors": "~1.0.3",
6565
"commander": "~2.6.0",
66-
"esprima": "~1.2.2",
66+
"esprima": "~1.2.4",
6767
"esprima-harmony-jscs": "1.1.0-tolerate-import",
6868
"estraverse": "~1.9.0",
6969
"exit": "~0.1.2",

test/rules/validate-indentation.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,21 @@ describe('rules/validate-indentation', function() {
253253
);
254254
});
255255

256+
it('should not report errors for switches without semicolons', function() {
257+
assert(
258+
checker.checkString(' ' +
259+
'function a (x) {\n' +
260+
' switch (x) {\n' +
261+
' case 1:\n' +
262+
' return 1\n' +
263+
' default:\n' +
264+
' return 2\n' +
265+
' }\n' +
266+
'}'
267+
).isEmpty()
268+
);
269+
});
270+
256271
it('should report errors for indent after no indent in same switch statement', function() {
257272
assert(
258273
checker.checkString(

0 commit comments

Comments
 (0)