Skip to content

Commit

Permalink
Update: Add failing test for camelcase option ignoreGlobals
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdado committed Jan 14, 2020
1 parent 939f30a commit 1b3838b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/lib/rules/camelcase.js
Expand Up @@ -161,6 +161,16 @@ ruleTester.run("camelcase", rule, {
options: [{ ignoreImports: false }],
parserOptions: { ecmaVersion: 6, sourceType: "module" }
},
{
code: "var _camelCased = camelCased",
options: [{ ignoreGlobals: false }],
globals: { camelCased: false }
},
{
code: "var camelCased = snake_cased",
options: [{ ignoreGlobals: true }],
globals: { snake_cased: false } // eslint-disable-line camelcase
},
{
code: "function foo({ no_camelcased: camelCased }) {};",
parserOptions: { ecmaVersion: 6 }
Expand Down Expand Up @@ -590,6 +600,18 @@ ruleTester.run("camelcase", rule, {
}
]
},
{
code: "var camelCased = snake_cased",
options: [{ ignoreGlobals: false }],
globals: { snake_cased: false }, // eslint-disable-line camelcase
errors: [
{
messageId: "notCamelCase",
data: { name: "snake_cased" },
type: "Identifier"
}
]
},
{
code: "function foo({ no_camelcased }) {};",
parserOptions: { ecmaVersion: 6 },
Expand Down

0 comments on commit 1b3838b

Please sign in to comment.