0.3.0 • Published 9 years ago

tern-browser-extension v0.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

tern-browser-extension

Build Status NPM version

tern-browser-extension is a tern plugin which extends browser.json and provides the following features :

Use tern inside HTML

The plugin extracts JavaScript code from scripts tags, before creating the acorn AST. The plugin also resolves script tags with the src attribute and HTML Imports.

Element ID

  • get completion for element ids when document.getElementById is used:

CodeMirror & GetElementById completion

  • go at the definition of the attribute id :

CodeMirror & GetElementById definition

  • validate element id if the editor supports tern-lint :

CodeMirror & GetElementById validation

  • returns the well HTML element instance (eg : HTMLInputElement) when getElementById or createElement is used.

CSS Selector

  • get completion for CSS ID selector when document.querySelector is used:

CodeMirror & QuerySelector completion

  • validate syntax of CSS selector if the editor supports tern-lint :

CodeMirror & QuerySelector validation

Event type

  • get completion for Event type when document.addEventListener is used:

CodeMirror & Event type completion

  • validate existing of Event type if the editor supports tern-lint :

CodeMirror & Event type validation