mgechev / codelyzer

Static analysis for Angular projects.
http://codelyzer.com/
MIT License
2.45k stars 233 forks source link

a11y errors in console have absolute paths #856

Open markgoho opened 5 years ago

markgoho commented 5 years ago

Describe the bug Errors in the console link to absolute paths. We should use relative paths.

Context and configuration

Please share: a11y rules are what are specifically linking to absolute file paths

To Reproduce Create a template that violates a rule, one for angular style guide, the other for an a11y rule

Expected behavior The error would print in the console with a relative file path

Additional context Here's an error for a style guide rule:

ERROR: C:/Users/Jack/Documents/Rosie/rosie-storefront/libs/storefront/checkout/src/lib/components/address-selector/address-selector.component.ts:5:13 - The selector should be kebab-cased and include a dash (https://angular.io/guide/styleguide#style-05-02)

When that link is ctrl+clicked on in VS Code, here's what the breadcrumbs look like: image

Here is an a11y error:

ERROR: c:/users/jack/documents/rosie/rosie-storefront/libs/storefront/checkout/src/lib/containers/payment-type/payment-type.component.html:10:4 - click must be accompanied by either keyup, keydown or keypress event for accessibility

and the breadcrumbs in VS Code: image

The issue that this presents is that VS Code can't "find" the file in the project when it's opened from an absolute path, so it doesn't show up in the sidebar. Kind of annoying.

mgechev commented 5 years ago

@mohammedzamakhan would you have a moment to look at that?

mohammedzamakhan commented 5 years ago

Sure 👍