facebook/jscodeshift

Declaration has "null" loc field when inside export

slonoed opened this issue · 1 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