Resolve .jsx files #826

Open
wants to merge 1 commit into
from

Projects

None yet

4 participants

@tetratorus

If you wish to ignore .jsx files, you can explicitly define that in a regex in the dontLoad option

@tetratorus tetratorus Resolve .jsx files
If you wish to ignore .jsx files, you can explicitly define that in a regex in the dontLoad option
09b612e
@JelteF
JelteF commented Dec 12, 2016

I tried this, but I can't get it to work. What does your .tern-project file look like?

@@ -116,7 +116,7 @@
var path = parentFile ? resolvePath(dirName(parentFile), word) : baseName(word)
for (var prop in this.modules) {
if (prop != parentFile && filter(path, prop, query)) {
- if (/\.js$/.test(prop)) prop = prop.slice(0, prop.length - 3)
+ if (/\.jsx?$/.test(prop)) prop = prop.slice(0, prop.length - 3)
@chessman
chessman Jan 12, 2017

There must be prop.length - 4 because length(".jsx") = 4.

@JelteF
JelteF Jan 12, 2017

It can be either 3 or 4, so jou would need two different if statements

@chessman
chessman Jan 12, 2017

and 'else if' is also appreciated because it won't work with "foo.jsx.js" file name.

@marijnh
marijnh Jan 12, 2017 Member

Preferably, just store the regexp match and use match[0].length to get its actual length

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment