#8039 Change jslint to use an npm tool instead of java

v1.4.0
closed
sf-2 (994)
General
Heith Seewald
2016-01-25
2015-12-15
No

We should switch our jslint tests to use npm-based jslint/jshint tool instead of java. Or eslint if it works.

It will also let us remove the dependency on default-jre-headless which currently cases latest docker to hang with this:

Setting up ca-certificates-java (20130815ubuntu1) ...

Which is issue https://github.com/docker/docker/issues/18180

Discussion

  • Dave Brondsema

    Dave Brondsema - 2016-01-13
    • labels: --> sf-current, sf-2
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,4 @@
    -We should switch our jslint tests to use npm-based tool instead of java.  This will be more fitting with the es6 validation in [#8035].
    +We should switch our jslint tests to use npm-based jslint/jshint tool instead of java.   Or eslint if it works.
    
     It will also let us remove the dependency on `default-jre-headless` which currently cases latest docker to hang with this:
    
     

    Related

    Tickets: #8035

  • Dave Brondsema

    Dave Brondsema - 2016-01-13
    • status: open --> in-progress
    • assigned_to: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2016-01-15
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2016-01-15

    db/8039

    • make sure you install the new npm packages, as noted in the installation docs. AFAIK they have to be global and can't be specified in package.js because local packages won't add eslint to the PATH
    • allura.tests.functional.test_static:TestStatic.test_static_controller is the only test that exercises JS validation by default
    • at the bottom of Allura/test.ini you can set validate_inlinejs to true and then all functional tests will do more validation. There are many failures though.
      • Note that when errors are captured and printed to the terminal, unicode comes through like \u2716. This is a limitation in nose, but for our Jenkins runs that use xunit xml files, the unicode will come through correctly there.
    • we have no tests that cover .js files

    [#8035] will need to modify .eslintrc and/or set up 2 different files. After that gets sorted out, we probably should make a ticket to enable JS validation by default and fix all the issues with .js files and inline script.

     

    Related

    Tickets: #8035

  • Heith Seewald - 2016-01-18
    • Reviewer: Heith Seewald
     
  • Heith Seewald - 2016-01-18
    • status: review --> in-progress
     
  • Heith Seewald - 2016-01-18

    As discussed: we should be able to use a local version of some dependencies through use of node_modules/.bin

     
  • Dave Brondsema

    Dave Brondsema - 2016-01-18
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2016-01-18

    Cleaned that up, as well as a broccoli global package :)

     
  • Heith Seewald - 2016-01-18
    • status: review --> closed
     
  • Heith Seewald - 2016-01-18

    I added broccoli-timepiece to the locally installed node packages and merged.
    Great job with this one :)

     
  • Dave Brondsema

    Dave Brondsema - 2016-01-25
    • labels: sf-current, sf-2 --> sf-2
     
  • Dave Brondsema

    Dave Brondsema - 2016-04-11
    • Milestone: unreleased --> v1.4.0
     

Log in to post a comment.