Skip to content

Commit

Permalink
add tests for camelcase
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Jun 13, 2020
1 parent 102c4db commit 3de0a1c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/lib/rules/camelcase.js
Expand Up @@ -957,6 +957,20 @@ ruleTester.run("camelcase", rule, {
type: "Identifier"
}
]
},

// Optional chaining.
{
code: "obj.o_k.non_camelcase = 0",
options: [{ properties: "always" }],
parserOptions: { ecmaVersion: 2020 },
errors: [{ messageId: "notCamelCase", data: { name: "non_camelcase" } }]
},
{
code: "(obj?.o_k).non_camelcase = 0",
options: [{ properties: "always" }],
parserOptions: { ecmaVersion: 2020 },
errors: [{ messageId: "notCamelCase", data: { name: "non_camelcase" } }]
}
]
});

0 comments on commit 3de0a1c

Please sign in to comment.