JSPM

retext-google-styleguide

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29
  • Score
    100M100P100Q63795F
  • License MIT

Word usage guidence from Google Developer Documentation Style Guide

Package Exports

  • retext-google-styleguide

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (retext-google-styleguide) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

retext-google-styleguide

Word usage guidence from Google Developer Documentation Style Guide.

retext-google-styleguide is a retext plugin for the word usage advice from Google Developer Documentation Style Guide. It highlights errors and provide word usage advice.

Installation

npm:

npm install retext-google-styleguide

Usage

For the following file, example.txt:

For 3-D rotation, abort the app first.
Then hit autoupdate to update the app.

And our script, example.js, looks as follows:

var vfile = require('to-vfile');
var report = require('vfile-reporter');
var retext = require('retext');
var googlestyleguide = require('retext-google-styleguide');

retext()
  .use(googlestyleguide)
  .process(vfile.readSync('example.txt'), function (err, file) {
    console.error(report(err || file));
  });

Yields:

example.txt
    1:5-1:8  warning  Do not use. Replace with “3D”.                             3-d         googlestyleguide
  1:19-1:24  warning  Do not use. Replace with “stop”, “exit”, “cancel”, “end”.  abort       googlestyleguide
    2:6-2:9  warning  Don't use as a synonym for "click."                        hit         googlestyleguide
  2:10-2:20  warning  Do not use. Replace with “automatically update”.           autoupdate  googlestyleguide

⚠ 4 warnings

API

retext().use(googlestyleguide)

Rules

See index.json