Repository: eslint/eslint
File: tests/lib/rules/object-shorthand.js (JavaScript)

Code before:
        },
        {
            code: "var x = {\n  f: function*() {\n    /* comment */\n    a(b);\n    }\n  }",
            output: "var x = {\n  *f() {\n    /* comment */\n    a(b);\n    }\n  }",
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {\n  f: /* comment */ function() {\n  }\n  }",
            output: null,
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {\n f /* comment */: function() {\n  }\n  }",
            output: null,
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {a: /* comment */ a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {a /* comment */: a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {y: function() {}}",
            output: "var x = {y() {}}",
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {y: function*() {}}",
            output: "var x = {*y() {}}",
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {x: y, y: z, a: a}",
            output: "var x = {x: y, y: z, a}",
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {ConstructorFunction: function(){}, a: b}",
            output: "var x = {ConstructorFunction(){}, a: b}",
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {x: y, y: z, a: function(){}, b() {}}",
            output: "var x = {x: y, y: z, a(){}, b() {}}",
            errors: [METHOD_ERROR]
        },

Review comment (suggestion):
Can you also add tests with quotes to make sure that case is covered.

```suggestion
        },
        {
            code: "var x = {'a': /* comment */ a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {'a' /* comment */: a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
```

Code after:
        },
        {
            code: "var x = {\n  f: function*() {\n    /* comment */\n    a(b);\n    }\n  }",
            output: "var x = {\n  *f() {\n    /* comment */\n    a(b);\n    }\n  }",
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {\n  f: /* comment */ function() {\n  }\n  }",
            output: null,
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {\n f /* comment */: function() {\n  }\n  }",
            output: null,
            errors: [METHOD_ERROR]
        },
        {
            code: "var x = {a: /* comment */ a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {a /* comment */: a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {a: (a /* comment */)}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {'a': /* comment */ a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {'a': (a /* comment */)}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {'a' /* comment */: a}",
            output: null,
            errors: [PROPERTY_ERROR]
        },
        {
            code: "var x = {y: function() {}}",
            output: "var x = {y() {}}",
            errors: [METHOD_ERROR]
        },