linting: disallow t.identifier("undefined") in plugins (#6096)
* add new custom eslint rule, replace remaining t.identifier("undefined") with buildUndefinedNode(), update tests
* change no-undefined-identifier reporting descriptor
This commit is contained in:
committed by
Justin Ridgewell
parent
4577bd1b7c
commit
2db0c3ad1d
@@ -112,7 +112,11 @@ export default function({ types: t }) {
|
||||
//
|
||||
|
||||
const tempConditional = t.conditionalExpression(
|
||||
t.binaryExpression("===", tempValueRef, t.identifier("undefined")),
|
||||
t.binaryExpression(
|
||||
"===",
|
||||
tempValueRef,
|
||||
this.scope.buildUndefinedNode(),
|
||||
),
|
||||
pattern.right,
|
||||
tempValueRef,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user