Fix: ignore eval (fixes babel/babel-eslint#560) (babel/babel-eslint#561)
This commit is contained in:
parent
a706e85b19
commit
3cb154df82
@ -309,6 +309,7 @@ class Referencer extends OriginalReferencer {
|
||||
|
||||
module.exports = function(ast, parserOptions) {
|
||||
const options = {
|
||||
ignoreEval: true,
|
||||
optimistic: false,
|
||||
directive: false,
|
||||
nodejsScope:
|
||||
|
||||
@ -1874,4 +1874,16 @@ describe("verify", () => {
|
||||
[]
|
||||
);
|
||||
});
|
||||
|
||||
it("ignore eval in scope analysis", () => {
|
||||
verifyAndAssertMessages(
|
||||
unpad(`
|
||||
const a = 1;
|
||||
console.log(a);
|
||||
eval('');
|
||||
`),
|
||||
{ "no-unused-vars": 1, "no-undef": 1 },
|
||||
[]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user