Giter VIP home page Giter VIP logo

remark-lint-link-text's Introduction

remark-lint-link-text

A remark-lint plugin that warns against non-descriptive link text.

βœ… Visit [Mapbox documentation](https://docs.mapbox.com) to learn more.
🚫 Learn more [here](https://docs.mapbox.com).

The linter warns against:

  • click here
  • here
  • read more
  • this link
  • more here
  • this article
  • this [whatever words in between] article

And several others.

πŸ’‘ For all banned phrases that begin with this or the, any words that come between will also fail. For example "this post", "this Mapbox post", and "this Mapbox blog post" will all fail.

Install

npm install --save-dev remark-cli @mapbox/remark-lint-link-text

In package.json:

"scripts": {
  "lint-md": "remark src/pages/"
},
"remarkConfig": {
  "plugins": [
    ["@mapbox/remark-lint-link-text", [2]]
  ]
},

If you do not want the linter to fail, but only give warnings:

"remarkConfig": {
  "plugins": [
    "@mapbox/remark-lint-link-text"
  ]
},

Banned link text

Save banned link text in banned.json.

Proper link text guidelines

When calling the user to action, use brief but meaningful link text that:

  • provides some information when read out of context
  • explains what the link offers
  • doesn't talk about mechanics
  • is not a verb phrase

Write links that make sense out of context. Use descriptive link text detailing the destination; not just β€œclick here,” or other similar phrases.

remark-lint-link-text's People

Contributors

chriswhong avatar dependabot[bot] avatar katydecorah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remark-lint-link-text's Issues

Ban "this [word] blog post"

Look at an instance of "this Mapbox blog post", ideally ban anything with the pattern: this [word] blog post|document|page

Improve error messages

We should refactor the error messages to make sure it's more instructive. Particularly it should do two things:

  1. Point out what about the current link text is considered problematic
  2. Provide clearer instruction on how to fix it

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.