Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow no-invalid-link-text to be configured for custom link component names #2969

Open
fivetanley opened this issue Aug 30, 2023 · 0 comments

Comments

@fivetanley
Copy link
Contributor

fivetanley commented Aug 30, 2023

Right now, the no-invalid-link-text rule checks for invalid link text on <LinkTo> and <a> tags. It would be great if we could allow a custom option to the config for tag names, so that developers using custom/wrapper components could specify additional component invocations to check.

For example, say a developer has an ExternalLink component that they use to consistently style links leading away from the application. We would still want those links to have more meaningful text than "learn more"/etc.

Right now, the rule passes for the following:

<ExternalLink @href={{this.externalLink}}>Learn more</ExternalLink>

We would want the above code to fail the no-invalid-link-text check.

The config could look something like this:

// .template-lintrc.js

module.exports = {
  extends: 'recommended',
  rules: {
    'no-invalid-link-text': {
      additionalTags: ['ExternalLink']
    }
  }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant