Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-6748

Improve clarity of eslint failures

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Low Low
    • Integration
    • None

      As suggested by brendanheywood we should make the eslint errors clearer.

      Instead of fudging the line numbers a simpler solution could be to dump out the line of the snippet that got sent off to the inner linter. It could also show a caret with the position of the error like this:

      /admin/tool/dataflows/templates/available-fields.mustache - WARNING: ESLint error []: Parsing error: Unexpected token expression ( ), Line: 3 Column: 13
      line 3:         for (let i = 0; i < expression.length; i++) {
                           ^
      

      Also on reflect I don't completely agree with the 'we are just passing back a raw error message' concept. There is still assumed knowledge missing which is that the mustache linter has taken a subset of the template and outsourced it to a different linter. If there was any issue at all with an inner linter of any type then in the generic case I think the outer linter should have something like 'There was an issue linting the #js chunk on lines 51-69 and it's error was: ... verbatim whatever error'

            dobedobedoh Andrew Lyons
            dobedobedoh Andrew Lyons
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.