1

It is really unclear how to setup tern to work with Sublime Text and ES6 Modules.

What steps should I need to take to enable it?

Asaf Katz
  • 4,608
  • 4
  • 37
  • 42

1 Answers1

3
  1. Install tern_for_sublime using Sublime's Package Control
  2. Also, install Fix Mac Path using Sublime's Package Control (why?)
  3. Create a file named .tern-config in you Home directory (not your project):

    /Users/<your-username>/.tern-config

    {
      "plugins": {
        "node": {},
        "es_modules": {}
      },
      "libs": [
        "ecma5",
        "ecma6"
      ],
      "ecmaVersion": 6
    }
    
  4. To automatically show completions after "." is typed, open your sublime preferences (found in Sublime Text > Preferences > Settings - User) and add this line:

    "auto_complete_triggers": [{ "characters": ".", "selector": "source.js"}]
    
  5. Optionally, you can override settings per project by creating a .tern-project file in the root of your project.

Enjoy.

grg
  • 5,023
  • 3
  • 34
  • 50
Asaf Katz
  • 4,608
  • 4
  • 37
  • 42