tern icon indicating copy to clipboard operation
tern copied to clipboard

Resolve .jsx files

Open tetratorus opened this issue 9 years ago • 5 comments
trafficstars

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

tetratorus avatar Sep 06 '16 21:09 tetratorus

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

JelteF avatar Dec 12 '16 12:12 JelteF

Hi! Any updates on this issue? ... I can't use tern because I have a lot of .jsx files that it simply doesn't see them.

0xMarkian avatar Mar 06 '17 17:03 0xMarkian

@marijnh Can I help with something ... maybe update PR? I really like tern and would like to use it :)

0xMarkian avatar Mar 07 '17 13:03 0xMarkian

I just used the webpack plugin as I use that anyway, so I didn't have a need for this anymore.

JelteF avatar Mar 07 '17 13:03 JelteF

@JelteF can you describe it more? Because I also use webpack plugin ... but it doesn't help.

So my .tern-project files looks like this:

{
  "plugins": {
    "webpack": {
      "configPath": "./client/webpack.config.js"
    }
  },
  "libs": [
    "browser"
  ],
  "ecmaVersion": 6
}

webpack.config:

resolve: {
    extensions: [
      '*',
      '.js',
      '.jsx'
    ],
    alias: {
      actions: srcPath + '/actions/',
      components: srcPath + '/components/',
      containers: srcPath + '/containers/',
      reducers: srcPath + '/reducers/',
      store: srcPath + '/store/',
      images: srcPath + '/images',
      config: srcPath + '/config',
      configuredLibraries: srcPath + '/configuredLibraries',
      utils: srcPath + '/utils.js',
    },
  },

Webpack plugin helps tern resolve webpack's aliases, but tern still doesn't see .jsx files. Though it became to see them after .jsx files got edited and saved.

0xMarkian avatar Mar 07 '17 13:03 0xMarkian