facebook / jscodeshift

A JavaScript codemod toolkit.

Home Page:https://jscodeshift.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Declaration has "null" loc field when inside export

slonoed opened this issue · comments

Happens with jscodeshift@0.14

Simplest demonstration

This returns null

require('jscodeshift')('export const a = 1').nodes()[0].program.body[0].declaration.loc

While this returns proper location

require('jscodeshift')('const a = 1').nodes()[0].program.body[0].loc

Same happens when exporting class