Thanks to @Dmitry's comment above, I was able to resolve this issue by configuring the default plugins for Tern.
In the tern
file from the repo under bin/tern
, I edited the default plugins here:
var defaultConfig = {
libs: [],
loadEagerly: false,
plugins: {"commonjs":{}, "node":{}, "requirejs":{}, "node_resolve":{}},
ecmaScript: true,
ecmaVersion: 6,
dependencyBudget: tern.defaultOptions.dependencyBudget
};
Where I changed the plugins
property from plugins: {},
to plugins: {"commonjs":{}, "node":{}, "requirejs":{}, "node_resolve":{}},
.
Now tern-find-definition
is working well!
I am still having an issue with andFurthermore, for the false-positive require
statement being recognized as an error. I will update when, I find a fix..was able to correct this by running M-x customize group RET js2-mode
and enabling Js2 Include Node Externs
.