lunes, 26 de marzo de 2012

Verificador JavaScript en Gedit (JSLint)

Pasos a seguir:
Instala rhino:
    # apt-get install rhino
Descargar JSLint de:
    http://web.archive.org/web/20070627170950/http://www.jslint.com/rhino/jslint.js


Si no tienes activado el plugin "external tools" ve a Edit->Preferences->Plugins.
Agrega una nueva external tool
Tools->Manage External Tools:
    Command: rhino /home/USUARIO/.gnome2/gedit/plugins/jslint.js $GEDIT_CURRENT_DOCUMENT_PATH
    Shortcut Key: Control j
    Save: Current document
    Input: Nothing
    Ouput: Display in bottom pane


3 comentarios:

  1. Hola,

    Obtengo este error al ejecutar JSLint. Sabes de qué puede venir?

    Olivier

    =============================
    Running tool: JSLint


    node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
    ^
    ReferenceError: readFile is not defined
    at /home/olivier/.local/share/gedit/plugins/jslint.js:294:11
    at Object. (/home/olivier/.local/share/gedit/plugins/jslint.js:296:167)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:32)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)
    at EventEmitter._tickCallback (node.js:192:41)

    Exited: 256

    ResponderEliminar
  2. Ok, he encontrado el fallo. Tengo tembién instalado nodejs, y la herramienta se ejecuta entonces con nodejs. He reemplazado js por rhino en el comando, y ahora funciona bien.

    Gracias

    Un saludo

    Olivier

    ResponderEliminar