Skip to content

Commit

Permalink
Upgrade: esquery@^1.0.1 (fixes #8733) (#10170)
Browse files Browse the repository at this point in the history
* Upgrade: esquery@^1.0.1 (fixes #8733)

* Chore: Add extra tests

* Chore: Fix lint errors

* Chore: Removing accidental copy/paste test
  • Loading branch information
platinumazure authored and aladdin-add committed Apr 3, 2018
1 parent 1e7252f commit 7d6e052
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -44,7 +44,7 @@
"eslint-scope": "^3.7.1",
"eslint-visitor-keys": "^1.0.0",
"espree": "^4.0.0-alpha.0",
"esquery": "^1.0.0",
"esquery": "^1.0.1",
"esutils": "^2.0.2",
"file-entry-cache": "^2.0.0",
"functional-red-black-tree": "^1.0.1",
Expand Down
12 changes: 11 additions & 1 deletion tests/lib/rules/no-restricted-syntax.js
Expand Up @@ -36,7 +36,10 @@ ruleTester.run("no-restricted-syntax", rule, {
{
code: "({ foo: 1, bar: 2 })",
options: [{ selector: "FunctionDeclaration[params.length>2]", message: "custom error message." }]
}
},

// https://github.com/eslint/eslint/issues/8733
{ code: "console.log(/a/);", options: ["Literal[regex.flags=/./]"] }
],
invalid: [

Expand Down Expand Up @@ -118,6 +121,13 @@ ruleTester.run("no-restricted-syntax", rule, {
code: "function foo(bar, baz, qux) {}",
options: [{ selector: "FunctionDeclaration[params.length>2]", message: "custom message with {{selector}}" }],
errors: [{ message: "custom message with {{selector}}", type: "FunctionDeclaration" }]
},

// https://github.com/eslint/eslint/issues/8733
{
code: "console.log(/a/i);",
options: ["Literal[regex.flags=/./]"],
errors: [{ message: "Using 'Literal[regex.flags=/./]' is not allowed.", type: "Literal" }]
}
]
});

0 comments on commit 7d6e052

Please sign in to comment.