How to use the isIdentifier function from @babel/core

Find comprehensive JavaScript @babel/core.isIdentifier code examples handpicked from public code repositorys.

23
24
25
26
27
28
29
30
31
32
33


var getImportedVisitor = {
    ImportSpecifier(path, map) {
        if (t.isIdentifier(path.node.imported)) {
            map[path.node.local.name] = {
                value: t.isIdentifier(path.node.imported) ? path.node.imported.name : path.node.local.name,
                self: path.node,
            };
        }
        return;
fork icon0
star icon1
watch icon0

118
119
120
121
122
123
124
125
126
127
    }
  });
},
MemberExpression(path) {
  if (
    t.isIdentifier(path.node.object) &&
    path.node.object.name === FEATURES_GLOBAL &&
    !path.scope.hasBinding(FEATURES_GLOBAL) &&
    t.isIdentifier(path.node.property) &&
    features.hasOwnProperty(path.node.property.name)
fork icon0
star icon0
watch icon211

+ 3 other calls in file

119
120
121
122
123
124
125
126
127
128
// case 2: (row) => `${row.id}`;
if (t.isTemplateLiteral(expression.body)) {
  if (expression.body.expressions.length === 1) {
    const { object, property } = expression.body.expressions[0];

    if (object.name === rowName && t.isIdentifier(property)) {
      context.report({
        node: value,
        messageId: 'UnnecessaryArrowFunction',
        fix(fixer) {
fork icon0
star icon0
watch icon2

+ 17 other calls in file