Closed lejafo closed 9 years ago
yup, this is just something I haven't got to yet because I don't use modules. I am requesting module support in the call to espree. PRs are always welcome if you're up for it :)
I think I did it.
Just adding this code to javascript-processor.js
process
method:
const modules = ast.body.filter((el) => {
return el.type === 'ImportDeclaration';
});
modules.map((mod) => {
let { start, end } = mod.source.loc;
let { value } = mod.source;
results.push({
moduleName: value,
range: [
// espree uses 1-indexed lines where
// atom uses 0-indexed
[start.line - 1, start.column],
[end.line - 1, end.column]
]
});
});
Maybe I did it in a wrong way, i don't know, but if you correct me I would be very grateful.
PS I could not PR this - says i haven't permission to repository. PPS Sorry for my english - I'm from Russia
Thanks. I'll verify this and get it in.
For future reference I looked up a guide from github on contributing to open source. Everyone on github can fork a repository (get your own copy), then make changes there, then issue a pull request.
@AsaAyers Thanks!
@AsaAyers By the way, I made PR.
I use babel in my project and es6 modules as well. So, in my code I use things like this:
But your plugin doesn't work for links like this. It would be great if you include this functionality in your package.
Thanks!