Repository: eslint/eslint
File: tests/lib/rules/no-empty.js (JavaScript)

Code before:
            errors: [{
                messageId: "unexpected",
                data: { type: "block" },
                type: "BlockStatement",
                suggestions: [{
                    messageId: "suggestComment",
                    output: "for (;foo;) { /* empty */ }"
                }]
            }]
        },
        {
            code: "switch(foo) {}",
            errors: [{
                messageId: "unexpected",
                data: { type: "switch" },
                type: "SwitchStatement"
            }]
        },
        {
            code: "switch (foo) { /* empty */ }",
            errors: [{
                messageId: "unexpected",
                data: { type: "switch" },
                type: "SwitchStatement"
            }]
        },
        {
            code: "try {} catch (ex) {}",
            options: [{ allowEmptyCatch: true }],
            errors: [{
                messageId: "unexpected",
                data: { type: "block" },
                type: "BlockStatement",
                suggestions: [{
                    messageId: "suggestComment",
                    output: "try { /* empty */ } catch (ex) {}"
                }]
            }]
        },
        {
            code: "try { foo(); } catch (ex) {} finally {}",
            options: [{ allowEmptyCatch: true }],
            errors: [{
                messageId: "unexpected",
                data: { type: "block" },
                type: "BlockStatement",
                suggestions: [{
                    messageId: "suggestComment",
                    output: "try { foo(); } catch (ex) {} finally { /* empty */ }"
                }]
            }]

Review comment (suggestion):
Can you also add `suggestions: null` in errors for switch statements, to assert that the rule in that case does not provide suggestions.

Code after:
                }]
            }]
        },
        {
            code: "for (;foo;) {}",
            errors: [{
                messageId: "unexpected",
                data: { type: "block" },
                type: "BlockStatement",
                suggestions: [{
                    messageId: "suggestComment",
                    data: { type: "block" },
                    output: "for (;foo;) { /* empty */ }"
                }]
            }]
        },
        {
            code: "switch(foo) {}",
            errors: [{
                messageId: "unexpected",
                data: { type: "switch" },
                type: "SwitchStatement",
                suggestions: null
            }]
        },
        {
            code: "switch (foo) { /* empty */ }",
            errors: [{
                messageId: "unexpected",
                data: { type: "switch" },
                type: "SwitchStatement",
                suggestions: null
            }]
        },
        {
            code: "try {} catch (ex) {}",
            options: [{ allowEmptyCatch: true }],
            errors: [{
                messageId: "unexpected",
                data: { type: "block" },
                type: "BlockStatement",
                suggestions: [{
                    messageId: "suggestComment",
                    data: { type: "block" },
                    output: "try { /* empty */ } catch (ex) {}"
                }]
            }]
        },
        {
            code: "try { foo(); } catch (ex) {} finally {}",
            options: [{ allowEmptyCatch: true }],