Skip to content

Commit

Permalink
wip.
Browse files Browse the repository at this point in the history
  • Loading branch information
薛定谔的猫 committed Sep 30, 2017
1 parent 0c6c588 commit 9497c82
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/lib/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,20 @@ describe("Linter", () => {
messages = linter.verify(codeB, config, filename, false);
assert.equal(messages.length, 1);
});

// https://github.com/eslint/eslint/issues/9366
it("rules should handle regex option correctly", () => {
const config = {};
const code = [
// "\\\\W" equals to "\\W" in source code.
"/* eslint id-match: [2, \"^(([^$\\\\W]|\\\\$[a-f\\\\d]{2})+|[$_]\\\\w*|[^\\\\W\\\\d]\\\\w*|[A-Z]([A-Z_]*[A-Z])?)$\", {properties: true}] */",
"var is$2dvoid = 0;"
].join("\n");

let messages = linter.verify(code, config, filename, false);

assert.equal(messages.length, 0);
});
});

describe("when evaluating code with invalid comments to enable rules", () => {
Expand Down

0 comments on commit 9497c82

Please sign in to comment.