HTMLHint icon indicating copy to clipboard operation
HTMLHint copied to clipboard

Print relative paths in error reports (including console)

Open hyperupcall opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe.

When printing hinting violations, it prints the absolute path of the HTML file:

/storage/ur/storage_home/Docs/Programming/Repositories/fox-forks/HTMLHint/test/cli/formatters/example.html
      L8 |  <div bad='' bad=''></div>
                ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)
      L8 |  <div bad='' bad=''></div>
                       ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)
      L8 |  <div bad='' bad=''></div>
                       ^ Duplicate of attribute name [ bad ] was found. (attr-no-duplication)
      L9 |  <div bad='' bad=''></div>
                ^ The value of attribute [ bad ] must be in double quotes. (attr-value-double-quotes)

Describe the solution you'd like

Both ESLint and Prettier print relative file paths. Relative file paths make it significantly easier to parse the error message and know exactly what file violated a linting rule. This compounds when file paths are long.

Describe alternatives you've considered

Using absolute paths

Additional context Add any other context or screenshots about the feature request here.

hyperupcall avatar Oct 19 '23 08:10 hyperupcall